2021-04-21 13:40:47 +08:00
|
|
|
# Disable warnings for upstream projects.
|
|
|
|
if (MSVC)
|
|
|
|
set(DISABLE_WARNING_FLAGS
|
|
|
|
-wd4018 # 'expression' : signed/unsigned mismatch
|
|
|
|
-wd4090 # 'operation' : different 'modifier' qualifiers
|
|
|
|
-wd4200 # nonstandard extension used: zero-sized array in struct/union
|
|
|
|
-wd4201 # nonstandard extension used: nameless struct/union
|
|
|
|
-wd4334 # 'operator': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
|
|
|
|
-wd4221 # nonstandard extension used : 'identifier' : cannot be initialized using address of automatic variable
|
|
|
|
)
|
|
|
|
else ()
|
|
|
|
set(DISABLE_WARNING_FLAGS "-w")
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
|
2015-09-24 19:30:22 +08:00
|
|
|
# External: Integer Set Library
|
2017-02-28 01:54:25 +08:00
|
|
|
if (POLLY_BUNDLED_ISL)
|
|
|
|
set(ISL_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/isl")
|
|
|
|
set(ISL_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/isl")
|
|
|
|
|
|
|
|
# Determine version of isl
|
|
|
|
if (EXISTS "${ISL_SOURCE_DIR}/GIT_HEAD_ID")
|
|
|
|
# The source comes from a 'make dist' archive
|
|
|
|
file(READ "${ISL_SOURCE_DIR}/GIT_HEAD_ID" ISL_GIT_HEAD_ID)
|
|
|
|
string(STRIP "${ISL_GIT_HEAD_ID}" ISL_GIT_HEAD_ID)
|
|
|
|
elseif (EXISTS "${ISL_SOURCE_DIR}/gitversion.h")
|
|
|
|
# The source directory is preconfigured
|
|
|
|
file(READ "${ISL_SOURCE_DIR}/gitversion.h" GITVERSION_H)
|
|
|
|
string(REGEX REPLACE ".*\\\"([^\\\"]*)\\\".*" "\\1" ISL_GIT_HEAD_ID "${GITVERSION_H}")
|
|
|
|
elseif ()
|
|
|
|
# Unknown revision
|
|
|
|
# TODO: We could look for a .git and get the revision from HEAD
|
|
|
|
set(ISL_GIT_HEAD_ID "UNKNOWN")
|
2015-09-24 19:30:22 +08:00
|
|
|
endif ()
|
2017-02-28 01:54:25 +08:00
|
|
|
|
|
|
|
message(STATUS "ISL version: ${ISL_GIT_HEAD_ID}")
|
|
|
|
|
|
|
|
# Enable small integer optimization and imath
|
|
|
|
set(USE_GMP_FOR_MP OFF)
|
|
|
|
set(USE_IMATH_FOR_MP ON)
|
|
|
|
set(USE_SMALL_INT_OPT ON)
|
|
|
|
|
|
|
|
# Determine compiler characteristics
|
|
|
|
include(CheckCSourceCompiles)
|
|
|
|
|
|
|
|
# Like check_c_source_compiles, but sets the result to either
|
|
|
|
# 0 (error while compiling) or 1 (compiled successfully)
|
|
|
|
# Required for compatibility with autotool's AC_CHECK_DECLS
|
|
|
|
function (check_c_source_compiles_numeric _prog _var)
|
|
|
|
check_c_source_compiles("${_prog}" "${_var}")
|
|
|
|
if ("${${_var}}")
|
|
|
|
set("${_var}" 1 PARENT_SCOPE)
|
|
|
|
else ()
|
|
|
|
set("${_var}" 0 PARENT_SCOPE)
|
|
|
|
endif ()
|
|
|
|
endfunction ()
|
|
|
|
|
|
|
|
# Check for the existance of a type
|
|
|
|
function (check_c_type_exists _type _files _variable)
|
|
|
|
set(_includes "")
|
|
|
|
foreach (file_name ${_files})
|
|
|
|
set(_includes "${_includes}#include<${file_name}>\n")
|
|
|
|
endforeach()
|
|
|
|
check_c_source_compiles("
|
2015-09-24 19:30:22 +08:00
|
|
|
${_includes}
|
|
|
|
${_type} typeVar;
|
|
|
|
int main() {
|
2017-02-28 01:54:25 +08:00
|
|
|
return 0;
|
2015-09-24 19:30:22 +08:00
|
|
|
}
|
|
|
|
" ${_variable})
|
2017-02-28 01:54:25 +08:00
|
|
|
endfunction ()
|
2015-09-24 19:30:22 +08:00
|
|
|
|
|
|
|
|
2017-02-28 01:54:25 +08:00
|
|
|
check_c_source_compiles("
|
2015-09-24 19:30:22 +08:00
|
|
|
int func(void) __attribute__((__warn_unused_result__));
|
|
|
|
int main() { return 0; }
|
|
|
|
" HAS_ATTRIBUTE_WARN_UNUSED_RESULT)
|
2017-02-28 01:54:25 +08:00
|
|
|
set(GCC_WARN_UNUSED_RESULT)
|
|
|
|
if (HAS_ATTRIBUTE_WARN_UNUSED_RESULT)
|
|
|
|
set(GCC_WARN_UNUSED_RESULT "__attribute__((__warn_unused_result__))")
|
|
|
|
endif ()
|
2015-09-24 19:30:22 +08:00
|
|
|
|
2017-02-28 01:54:25 +08:00
|
|
|
check_c_source_compiles("
|
2016-10-20 19:16:19 +08:00
|
|
|
__attribute__ ((unused)) static void foo(void);
|
2015-09-24 19:30:22 +08:00
|
|
|
int main() { return 0; }
|
|
|
|
" HAVE___ATTRIBUTE__)
|
|
|
|
|
|
|
|
|
2017-02-28 01:54:25 +08:00
|
|
|
check_c_source_compiles_numeric("
|
2015-09-24 19:30:22 +08:00
|
|
|
#include <strings.h>
|
2015-10-07 05:45:06 +08:00
|
|
|
int main() { (void)ffs(0); return 0; }
|
2015-09-24 19:30:22 +08:00
|
|
|
" HAVE_DECL_FFS)
|
|
|
|
|
2017-02-28 01:54:25 +08:00
|
|
|
check_c_source_compiles_numeric("
|
2016-10-20 19:16:19 +08:00
|
|
|
int main() { (void)__builtin_ffs(0); return 0; }
|
2015-09-24 19:30:22 +08:00
|
|
|
" HAVE_DECL___BUILTIN_FFS)
|
|
|
|
|
2017-02-28 01:54:25 +08:00
|
|
|
check_c_source_compiles_numeric("
|
2015-09-24 19:30:22 +08:00
|
|
|
#include <intrin.h>
|
2016-10-20 19:16:19 +08:00
|
|
|
int main() { (void)_BitScanForward(NULL, 0); return 0; }
|
2015-09-24 19:30:22 +08:00
|
|
|
" HAVE_DECL__BITSCANFORWARD)
|
|
|
|
|
2017-02-28 01:54:25 +08:00
|
|
|
if (NOT HAVE_DECL_FFS AND
|
|
|
|
NOT HAVE_DECL___BUILTIN_FFS AND
|
|
|
|
NOT HAVE_DECL__BITSCANFORWARD)
|
|
|
|
message(FATAL_ERROR "No ffs implementation found")
|
|
|
|
endif ()
|
2015-09-24 19:30:22 +08:00
|
|
|
|
|
|
|
|
2017-02-28 01:54:25 +08:00
|
|
|
check_c_source_compiles_numeric("
|
2015-09-24 19:30:22 +08:00
|
|
|
#include <strings.h>
|
2015-10-07 05:45:06 +08:00
|
|
|
int main() { (void)strcasecmp(\"\", \"\"); return 0; }
|
2015-09-24 19:30:22 +08:00
|
|
|
" HAVE_DECL_STRCASECMP)
|
|
|
|
|
2017-02-28 01:54:25 +08:00
|
|
|
check_c_source_compiles_numeric("
|
2015-09-24 19:30:22 +08:00
|
|
|
#include <string.h>
|
2016-10-20 19:16:19 +08:00
|
|
|
int main() { (void)_stricmp(\"\", \"\"); return 0; }
|
2015-09-24 19:30:22 +08:00
|
|
|
" HAVE_DECL__STRICMP)
|
|
|
|
|
2017-02-28 01:54:25 +08:00
|
|
|
if (NOT HAVE_DECL_STRCASECMP AND NOT HAVE_DECL__STRICMP)
|
|
|
|
message(FATAL_ERROR "No strcasecmp implementation found")
|
|
|
|
endif ()
|
2015-09-24 19:30:22 +08:00
|
|
|
|
|
|
|
|
2017-02-28 01:54:25 +08:00
|
|
|
check_c_source_compiles_numeric("
|
2015-09-24 19:30:22 +08:00
|
|
|
#include <strings.h>
|
2015-10-07 05:45:06 +08:00
|
|
|
int main() { (void)strncasecmp(\"\", \"\", 0); return 0; }
|
2015-09-24 19:30:22 +08:00
|
|
|
" HAVE_DECL_STRNCASECMP)
|
|
|
|
|
2017-02-28 01:54:25 +08:00
|
|
|
check_c_source_compiles_numeric("
|
2015-09-24 19:30:22 +08:00
|
|
|
#include <string.h>
|
2016-10-20 19:16:19 +08:00
|
|
|
int main() { (void)_strnicmp(\"\", \"\", 0); return 0; }
|
2015-09-24 19:30:22 +08:00
|
|
|
" HAVE_DECL__STRNICMP)
|
|
|
|
|
2017-02-28 01:54:25 +08:00
|
|
|
if (NOT HAVE_DECL_STRNCASECMP AND NOT HAVE_DECL__STRNICMP)
|
|
|
|
message(FATAL_ERROR "No strncasecmp implementation found")
|
|
|
|
endif ()
|
2015-09-24 19:30:22 +08:00
|
|
|
|
|
|
|
|
2017-02-28 01:54:25 +08:00
|
|
|
check_c_source_compiles_numeric("
|
2015-09-24 19:30:22 +08:00
|
|
|
#include <stdio.h>
|
2016-10-15 13:08:12 +08:00
|
|
|
int main() { snprintf((void*)0, 0, \" \"); return 0; }
|
2015-09-24 19:30:22 +08:00
|
|
|
" HAVE_DECL_SNPRINTF)
|
|
|
|
|
2017-02-28 01:54:25 +08:00
|
|
|
check_c_source_compiles_numeric("
|
2015-09-24 19:30:22 +08:00
|
|
|
#include <stdio.h>
|
2016-10-15 13:08:12 +08:00
|
|
|
int main() { _snprintf((void*)0, 0, \" \"); return 0; }
|
2015-09-24 19:30:22 +08:00
|
|
|
" HAVE_DECL__SNPRINTF)
|
|
|
|
|
2017-02-28 01:54:25 +08:00
|
|
|
if (NOT HAVE_DECL_SNPRINTF AND NOT HAVE_DECL__SNPRINTF)
|
|
|
|
message(FATAL_ERROR "No snprintf implementation found")
|
|
|
|
endif ()
|
2015-09-24 19:30:22 +08:00
|
|
|
|
|
|
|
|
2017-02-28 01:54:25 +08:00
|
|
|
check_c_type_exists(uint8_t "" HAVE_UINT8T)
|
|
|
|
check_c_type_exists(uint8_t "stdint.h" HAVE_STDINT_H)
|
|
|
|
check_c_type_exists(uint8_t "inttypes.h" HAVE_INTTYPES_H)
|
|
|
|
check_c_type_exists(uint8_t "sys/types.h" HAVE_SYS_INTTYPES_H)
|
|
|
|
if (HAVE_UINT8T)
|
|
|
|
set(INCLUDE_STDINT_H "")
|
|
|
|
elseif (HAVE_STDINT_H)
|
|
|
|
set(INCLUDE_STDINT_H "#include <stdint.h>")
|
|
|
|
elseif (HAVE_INTTYPES_H)
|
|
|
|
set(INCLUDE_STDINT_H "#include <inttypes.h>")
|
|
|
|
elseif (HAVE_SYS_INTTYPES_H)
|
|
|
|
set(INCLUDE_STDINT_H "#include <sys/inttypes.h>")
|
|
|
|
else ()
|
|
|
|
message(FATAL_ERROR "No stdint.h or compatible found")
|
|
|
|
endif ()
|
2015-09-24 19:30:22 +08:00
|
|
|
|
2017-02-28 01:54:25 +08:00
|
|
|
# Write configure result
|
|
|
|
# configure_file(... COPYONLY) avoids that the time stamp changes if the file is identical
|
|
|
|
file(WRITE "${ISL_BINARY_DIR}/gitversion.h.tmp"
|
|
|
|
"#define GIT_HEAD_ID \"${ISL_GIT_HEAD_ID}\"")
|
|
|
|
configure_file("${ISL_BINARY_DIR}/gitversion.h.tmp"
|
|
|
|
"${ISL_BINARY_DIR}/gitversion.h" COPYONLY)
|
|
|
|
|
|
|
|
file(WRITE "${ISL_BINARY_DIR}/include/isl/stdint.h.tmp"
|
|
|
|
"${INCLUDE_STDINT_H}\n")
|
|
|
|
configure_file("${ISL_BINARY_DIR}/include/isl/stdint.h.tmp"
|
|
|
|
"${ISL_BINARY_DIR}/include/isl/stdint.h" COPYONLY)
|
|
|
|
|
|
|
|
configure_file("isl_config.h.cmake" "${ISL_BINARY_DIR}/isl_config.h")
|
|
|
|
configure_file("isl_srcdir.c.cmake" "${ISL_BINARY_DIR}/isl_srcdir.c")
|
|
|
|
|
|
|
|
include_directories(BEFORE
|
|
|
|
${ISL_BINARY_DIR}
|
|
|
|
${ISL_SOURCE_DIR}/imath
|
|
|
|
${ISL_SOURCE_DIR}/include
|
|
|
|
${ISL_SOURCE_DIR}
|
|
|
|
)
|
2015-09-24 19:30:22 +08:00
|
|
|
|
2017-02-28 01:54:25 +08:00
|
|
|
# ISL files to compile
|
|
|
|
set (ISL_FILES
|
2015-09-24 19:30:22 +08:00
|
|
|
isl/basis_reduction_tab.c
|
|
|
|
isl/isl_aff.c
|
2018-07-06 17:00:26 +08:00
|
|
|
isl/isl_aff_map.c
|
2015-09-24 19:30:22 +08:00
|
|
|
isl/isl_affine_hull.c
|
|
|
|
isl/isl_arg.c
|
|
|
|
isl/isl_ast_build.c
|
|
|
|
isl/isl_ast_build_expr.c
|
|
|
|
isl/isl_ast.c
|
|
|
|
isl/isl_ast_codegen.c
|
|
|
|
isl/isl_ast_graft.c
|
|
|
|
isl/isl_bernstein.c
|
|
|
|
isl/isl_blk.c
|
|
|
|
isl/isl_bound.c
|
2018-06-11 22:25:42 +08:00
|
|
|
isl/isl_box.c
|
2015-09-24 19:30:22 +08:00
|
|
|
isl/isl_coalesce.c
|
|
|
|
isl/isl_constraint.c
|
|
|
|
isl/isl_convex_hull.c
|
|
|
|
isl/isl_ctx.c
|
|
|
|
isl/isl_deprecated.c
|
|
|
|
isl/isl_dim_map.c
|
|
|
|
isl/isl_equalities.c
|
|
|
|
isl/isl_factorization.c
|
|
|
|
isl/isl_farkas.c
|
|
|
|
isl/isl_ffs.c
|
|
|
|
isl/isl_flow.c
|
|
|
|
isl/isl_fold.c
|
|
|
|
isl/isl_hash.c
|
|
|
|
isl/isl_id.c
|
|
|
|
isl/isl_id_to_ast_expr.c
|
2016-02-26 19:35:12 +08:00
|
|
|
isl/isl_id_to_id.c
|
2015-09-24 19:30:22 +08:00
|
|
|
isl/isl_id_to_pw_aff.c
|
|
|
|
isl/isl_ilp.c
|
|
|
|
isl/isl_imath.c
|
|
|
|
isl/isl_input.c
|
|
|
|
isl/isl_int_sioimath.c
|
2016-03-26 03:38:18 +08:00
|
|
|
isl/isl_local.c
|
2015-09-24 19:30:22 +08:00
|
|
|
isl/isl_local_space.c
|
|
|
|
isl/isl_lp.c
|
|
|
|
isl/isl_map.c
|
|
|
|
isl/isl_map_list.c
|
|
|
|
isl/isl_map_simplify.c
|
|
|
|
isl/isl_map_subtract.c
|
|
|
|
isl/isl_map_to_basic_set.c
|
|
|
|
isl/isl_mat.c
|
|
|
|
isl/isl_morph.c
|
|
|
|
isl/isl_obj.c
|
|
|
|
isl/isl_options.c
|
|
|
|
isl/isl_output.c
|
|
|
|
isl/isl_point.c
|
|
|
|
isl/isl_polynomial.c
|
|
|
|
isl/isl_printer.c
|
|
|
|
isl/isl_range.c
|
|
|
|
isl/isl_reordering.c
|
|
|
|
isl/isl_sample.c
|
|
|
|
isl/isl_scan.c
|
|
|
|
isl/isl_schedule.c
|
|
|
|
isl/isl_schedule_band.c
|
2016-10-02 03:46:51 +08:00
|
|
|
isl/isl_schedule_constraints.c
|
2015-09-24 19:30:22 +08:00
|
|
|
isl/isl_schedule_node.c
|
|
|
|
isl/isl_schedule_read.c
|
|
|
|
isl/isl_schedule_tree.c
|
|
|
|
isl/isl_scheduler.c
|
|
|
|
isl/isl_seq.c
|
|
|
|
isl/isl_set_list.c
|
[Polly] Update ISL to isl-0.22.1-87-gfee05a13.
The primary motivation is to fix an assertion failure in
isl_basic_map_alloc_equality:
isl_assert(ctx, room_for_con(bmap, 1), return -1);
Although the assertion does not occur anymore, I could not identify
which of ISL's commits fixed it.
Compared to the previous ISL version, Polly requires some changes for this update
* Since ISL commit
20d3574 "perform parameter alignment by modifying both arguments to function"
isl_*_gist_* and similar functions do not always align the paramter
list anymore. This caused the parameter lists in JScop files to
become out-of-sync. Since many regression tests use JScop files with
a fixed parameter list and order, we explicitly call align_params to
ensure a predictable parameter list.
* ISL changed some return types to isl_size, a typedef of (signed) int.
This caused some issues where the return type was unsigned int before:
- No overload for std::max(unsigned,isl_size)
- It cause additional 'mixed signed/unsigned comparison' warnings.
Since they do not break compilation, and sizes larger than 2^31
were never supported, I am going to fix it separately.
* With the change to isl_size, commit
57d547 "isl_*_list_size: return isl_size"
also changed the return value in case of an error from 0 to -1. This
caused undefined looping over isl_iterator since the 'end iterator'
got index -1, never reached from the 'begin iterator' with index 0.
* Some internal changes in ISL caused the number of operations to
increase when determining access ranges to determine aliasing
overlaps. In one test, this caused exceeding the default limit of
800000. The operations-limit was disabled for this test.
2020-02-11 04:51:33 +08:00
|
|
|
isl/isl_set_to_ast_graft_list.c
|
2015-09-24 19:30:22 +08:00
|
|
|
isl/isl_sort.c
|
|
|
|
isl/isl_space.c
|
2018-02-20 15:26:42 +08:00
|
|
|
isl/isl_stride.c
|
2015-09-24 19:30:22 +08:00
|
|
|
isl/isl_stream.c
|
|
|
|
isl/isl_tab.c
|
|
|
|
isl/isl_tab_pip.c
|
|
|
|
isl/isl_tarjan.c
|
|
|
|
isl/isl_transitive_closure.c
|
|
|
|
isl/isl_union_map.c
|
|
|
|
isl/isl_val.c
|
|
|
|
isl/isl_val_sioimath.c
|
|
|
|
isl/isl_vec.c
|
|
|
|
isl/isl_version.c
|
|
|
|
isl/isl_vertices.c
|
|
|
|
isl/print.c
|
2018-04-21 16:34:22 +08:00
|
|
|
isl/set_to_map.c
|
|
|
|
isl/set_from_map.c
|
|
|
|
isl/uset_to_umap.c
|
|
|
|
isl/uset_from_umap.c
|
2015-09-24 19:30:22 +08:00
|
|
|
isl/imath/gmp_compat.c
|
|
|
|
isl/imath/imath.c
|
|
|
|
isl/imath/imrat.c
|
|
|
|
)
|
|
|
|
|
2017-02-28 01:54:25 +08:00
|
|
|
add_polly_library(PollyISL
|
|
|
|
${ISL_FILES}
|
|
|
|
)
|
2015-09-24 19:30:22 +08:00
|
|
|
|
2017-02-21 00:57:14 +08:00
|
|
|
|
2017-02-28 01:54:25 +08:00
|
|
|
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
|
|
|
|
install(DIRECTORY
|
|
|
|
${ISL_SOURCE_DIR}/include/
|
|
|
|
${ISL_BINARY_DIR}/include/
|
2022-01-18 15:05:47 +08:00
|
|
|
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/polly"
|
2017-02-28 01:54:25 +08:00
|
|
|
FILES_MATCHING
|
|
|
|
PATTERN "*.h"
|
|
|
|
PATTERN "CMakeFiles" EXCLUDE
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
add_executable(polly-isl-test
|
|
|
|
isl/isl_test.c
|
2017-02-21 00:57:14 +08:00
|
|
|
)
|
2017-02-28 01:54:25 +08:00
|
|
|
set_target_properties(polly-isl-test PROPERTIES FOLDER "Polly")
|
2017-02-21 00:57:14 +08:00
|
|
|
|
2018-01-13 00:09:18 +08:00
|
|
|
target_link_libraries(polly-isl-test PRIVATE
|
2017-02-28 01:54:25 +08:00
|
|
|
PollyISL
|
|
|
|
)
|
2016-10-05 03:48:40 +08:00
|
|
|
|
2017-02-28 01:54:25 +08:00
|
|
|
# ISL requires at least C99 to compile. gcc < 5.0 use -std=gnu89 as default.
|
2020-09-05 23:15:32 +08:00
|
|
|
set_property(TARGET PollyISL polly-isl-test PROPERTY C_STANDARD 99)
|
2021-04-21 13:40:47 +08:00
|
|
|
|
|
|
|
target_compile_options(PollyISL PRIVATE ${DISABLE_WARNING_FLAGS})
|
|
|
|
target_compile_options(polly-isl-test PRIVATE ${DISABLE_WARNING_FLAGS})
|
2017-02-28 01:54:25 +08:00
|
|
|
endif (POLLY_BUNDLED_ISL)
|
2015-09-24 19:30:22 +08:00
|
|
|
|
2016-07-13 23:54:47 +08:00
|
|
|
|
2021-04-21 13:40:47 +08:00
|
|
|
# External: Polyhedral Parallel Code Generator
|
|
|
|
if (GPU_CODEGEN)
|
|
|
|
set(PET_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/pet")
|
|
|
|
set(PPCG_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ppcg")
|
|
|
|
set(PPCG_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/ppcg")
|
2016-09-14 05:09:35 +08:00
|
|
|
|
2021-04-21 13:40:47 +08:00
|
|
|
# Determine version of ppcg
|
|
|
|
if (EXISTS "${PPCG_SOURCE_DIR}/GIT_HEAD_ID")
|
|
|
|
# The source comes from a 'make dist' archive
|
|
|
|
file(READ "${PPCG_SOURCE_DIR}/GIT_HEAD_ID" PPCG_GIT_HEAD_ID)
|
|
|
|
string(STRIP "${PPCG_GIT_HEAD_ID}" PPCG_GIT_HEAD_ID)
|
|
|
|
elseif (EXISTS "${PPCG_SOURCE_DIR}/gitversion.h")
|
|
|
|
# The source directory is preconfigured
|
|
|
|
file(READ "${PPCG_SOURCE_DIR}/gitversion.h" GITVERSION_H)
|
|
|
|
string(REGEX REPLACE ".*\\\"([^\\\"]*)\\\".*" "\\1" PPCG_GIT_HEAD_ID "${GITVERSION_H}")
|
|
|
|
elseif ()
|
|
|
|
# Unknown revision
|
|
|
|
# TODO: We could look for a .git and get the revision from HEAD
|
|
|
|
set(PPCG_GIT_HEAD_ID "UNKNOWN")
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
message(STATUS "PPCG version: ${PPCG_GIT_HEAD_ID}")
|
|
|
|
|
|
|
|
set (PPCG_FILES
|
|
|
|
ppcg/cuda.c
|
|
|
|
ppcg/cuda_common.c
|
|
|
|
ppcg/external.c
|
|
|
|
ppcg/gpu_array_tile.c
|
|
|
|
ppcg/gpu.c
|
|
|
|
ppcg/gpu_array_tile.c
|
|
|
|
ppcg/gpu_group.c
|
|
|
|
ppcg/gpu_hybrid.c
|
|
|
|
ppcg/gpu_print.c
|
|
|
|
ppcg/gpu_tree.c
|
|
|
|
ppcg/grouping.c
|
|
|
|
ppcg/hybrid.c
|
|
|
|
ppcg/ppcg.c
|
|
|
|
ppcg/ppcg_options.c
|
|
|
|
ppcg/print.c
|
|
|
|
ppcg/schedule.c
|
|
|
|
ppcg/util.c
|
|
|
|
)
|
|
|
|
|
|
|
|
include_directories(BEFORE
|
|
|
|
${PPCG_BINARY_DIR}
|
|
|
|
${PPCG_SOURCE_DIR}/imath
|
|
|
|
${PPCG_SOURCE_DIR}/include
|
|
|
|
${PET_SOURCE_DIR}/include
|
|
|
|
)
|
|
|
|
|
|
|
|
add_polly_library(PollyPPCG
|
|
|
|
${PPCG_FILES}
|
2016-10-07 20:38:32 +08:00
|
|
|
)
|
2016-10-08 04:58:20 +08:00
|
|
|
|
2021-04-21 13:40:47 +08:00
|
|
|
target_link_libraries(PollyPPCG PUBLIC ${ISL_TARGET})
|
|
|
|
|
|
|
|
# Disable warnings for upstream projects.
|
|
|
|
if (MSVC)
|
|
|
|
set(DISABLE_WARNING_FLAGS
|
|
|
|
-wd4018 # 'expression' : signed/unsigned mismatch
|
|
|
|
-wd4090 # 'operation' : different 'modifier' qualifiers
|
|
|
|
-wd4200 # nonstandard extension used: zero-sized array in struct/union
|
|
|
|
-wd4201 # nonstandard extension used: nameless struct/union
|
|
|
|
-wd4334 # 'operator': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
|
|
|
|
-wd4221 # nonstandard extension used : 'identifier' : cannot be initialized using address of automatic variable
|
|
|
|
)
|
|
|
|
if (POLLY_BUNDLED_ISL)
|
|
|
|
target_compile_options(PollyISL PRIVATE ${DISABLE_WARNING_FLAGS})
|
|
|
|
target_compile_options(polly-isl-test PRIVATE ${DISABLE_WARNING_FLAGS})
|
|
|
|
endif (POLLY_BUNDLED_ISL)
|
|
|
|
target_compile_options(PollyPPCG PRIVATE ${DISABLE_WARNING_FLAGS})
|
|
|
|
else ()
|
|
|
|
if (POLLY_BUNDLED_ISL)
|
|
|
|
set_target_properties(PollyISL polly-isl-test PROPERTIES COMPILE_FLAGS "-w")
|
|
|
|
endif (POLLY_BUNDLED_ISL)
|
|
|
|
set_target_properties(PollyPPCG PROPERTIES COMPILE_FLAGS "-w")
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
if(MSVC)
|
|
|
|
# In the Windows API (with some exceptions), the maximum length for a path is
|
|
|
|
# MAX_PATH, which is defined as 260 characters.
|
|
|
|
target_compile_definitions(PollyPPCG PRIVATE "-DPATH_MAX=260")
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
target_compile_options(PollyPPCG PRIVATE ${DISABLE_WARNING_FLAGS})
|
2016-10-08 04:58:20 +08:00
|
|
|
endif ()
|