ADD: added other eigen lib

This commit is contained in:
Henry Winkel
2022-12-21 16:19:04 +01:00
parent a570766dc6
commit 9e56c7f2c0
832 changed files with 36586 additions and 20006 deletions

View File

@@ -23,10 +23,14 @@ macro(ei_add_test_internal testname testname_with_suffix)
set(EIGEN_SUBTESTS_LIST "${EIGEN_SUBTESTS_LIST}${targetname}\n")
set_property(GLOBAL PROPERTY EIGEN_SUBTESTS_LIST "${EIGEN_SUBTESTS_LIST}")
set(is_gpu_test OFF)
if(EIGEN_ADD_TEST_FILENAME_EXTENSION STREQUAL cu)
set(is_gpu_test ON)
if(EIGEN_TEST_HIP)
hip_reset_flags()
hip_add_executable(${targetname} ${filename} HIPCC_OPTIONS "-DEIGEN_USE_HIP ${ARGV2}")
hip_add_executable(${targetname} ${filename} HIPCC_OPTIONS -std=c++14)
target_compile_definitions(${targetname} PRIVATE -DEIGEN_USE_HIP)
set_property(TARGET ${targetname} PROPERTY HIP_ARCHITECTURES gfx900 gfx906 gfx908 gfx90a gfx1030)
elseif(EIGEN_TEST_CUDA_CLANG)
set_source_files_properties(${filename} PROPERTIES LANGUAGE CXX)
@@ -36,54 +40,46 @@ macro(ei_add_test_internal testname testname_with_suffix)
link_directories("${CUDA_TOOLKIT_ROOT_DIR}/lib")
endif()
if (${ARGC} GREATER 2)
add_executable(${targetname} ${filename})
else()
add_executable(${targetname} ${filename} OPTIONS ${ARGV2})
endif()
add_executable(${targetname} ${filename})
set(CUDA_CLANG_LINK_LIBRARIES "cudart_static" "cuda" "dl" "pthread")
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(CUDA_CLANG_LINK_LIBRARIES ${CUDA_CLANG_LINK_LIBRARIES} "rt")
endif()
target_link_libraries(${targetname} ${CUDA_CLANG_LINK_LIBRARIES})
else()
if (${ARGC} GREATER 2)
cuda_add_executable(${targetname} ${filename} OPTIONS ${ARGV2})
else()
cuda_add_executable(${targetname} ${filename})
endif()
cuda_add_executable(${targetname} ${filename})
endif()
else()
add_executable(${targetname} ${filename})
endif()
if (targetname MATCHES "^eigen2_")
add_dependencies(eigen2_buildtests ${targetname})
else()
add_dependencies(buildtests ${targetname})
add_dependencies(buildtests ${targetname})
if (is_gpu_test)
add_dependencies(buildtests_gpu ${targetname})
endif()
if(EIGEN_NO_ASSERTION_CHECKING)
ei_add_target_property(${targetname} COMPILE_FLAGS "-DEIGEN_NO_ASSERTION_CHECKING=1")
target_compile_definitions(${targetname} PRIVATE EIGEN_NO_ASSERTION_CHECKING=1)
else()
if(EIGEN_DEBUG_ASSERTS)
ei_add_target_property(${targetname} COMPILE_FLAGS "-DEIGEN_DEBUG_ASSERTS=1")
target_compile_definitions(${targetname} PRIVATE EIGEN_DEBUG_ASSERTS=1)
endif()
endif()
ei_add_target_property(${targetname} COMPILE_FLAGS "-DEIGEN_TEST_MAX_SIZE=${EIGEN_TEST_MAX_SIZE}")
target_compile_definitions(${targetname} PRIVATE EIGEN_TEST_MAX_SIZE=${EIGEN_TEST_MAX_SIZE})
if(MSVC)
ei_add_target_property(${targetname} COMPILE_FLAGS "/bigobj")
target_compile_options(${targetname} PRIVATE "/bigobj")
endif()
# let the user pass flags.
if(${ARGC} GREATER 2)
ei_add_target_property(${targetname} COMPILE_FLAGS "${ARGV2}")
target_compile_options(${targetname} PRIVATE ${ARGV2})
endif()
if(EIGEN_TEST_CUSTOM_CXX_FLAGS)
ei_add_target_property(${targetname} COMPILE_FLAGS "${EIGEN_TEST_CUSTOM_CXX_FLAGS}")
target_compile_options(${targetname} PRIVATE ${EIGEN_TEST_CUSTOM_CXX_FLAGS})
endif()
if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO)
@@ -118,21 +114,14 @@ macro(ei_add_test_internal testname testname_with_suffix)
add_dependencies("Build${current_subproject}" ${targetname})
set_property(TEST ${testname_with_suffix} PROPERTY LABELS "${current_subproject}")
endif()
if (is_gpu_test)
# Add gpu tag for testing only GPU tests.
set_property(TEST ${testname_with_suffix} APPEND PROPERTY LABELS "gpu")
endif()
if(EIGEN_SYCL)
# Force include of the SYCL file at the end to avoid errors.
set_property(TARGET ${targetname} PROPERTY COMPUTECPP_INCLUDE_AFTER 1)
# Set COMPILE_FLAGS to COMPILE_DEFINITIONS instead to avoid having to duplicate the flags
# to the device compiler.
get_target_property(target_compile_flags ${targetname} COMPILE_FLAGS)
separate_arguments(target_compile_flags)
foreach(flag ${target_compile_flags})
if(${flag} MATCHES "^-D.*")
string(REPLACE "-D" "" definition_flag ${flag})
set_property(TARGET ${targetname} APPEND PROPERTY COMPILE_DEFINITIONS ${definition_flag})
list(REMOVE_ITEM target_compile_flags ${flag})
endif()
endforeach()
set_property(TARGET ${targetname} PROPERTY COMPILE_FLAGS ${target_compile_flags})
# Link against pthread and add sycl to target
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
@@ -209,12 +198,13 @@ macro(ei_add_test testname)
if( (EIGEN_SPLIT_LARGE_TESTS AND suffixes) OR explicit_suffixes)
add_custom_target(${testname})
foreach(suffix ${suffixes})
ei_add_test_internal(${testname} ${testname}_${suffix}
"${ARGV1} -DEIGEN_TEST_PART_${suffix}=1" "${ARGV2}")
ei_add_test_internal(${testname} ${testname}_${suffix} "${ARGV1}" "${ARGV2}")
add_dependencies(${testname} ${testname}_${suffix})
target_compile_definitions(${testname}_${suffix} PRIVATE -DEIGEN_TEST_PART_${suffix}=1)
endforeach()
else()
ei_add_test_internal(${testname} ${testname} "${ARGV1} -DEIGEN_TEST_PART_ALL=1" "${ARGV2}")
ei_add_test_internal(${testname} ${testname} "${ARGV1}" "${ARGV2}")
target_compile_definitions(${testname} PRIVATE -DEIGEN_TEST_PART_ALL=1)
endif()
endmacro()
@@ -375,12 +365,6 @@ macro(ei_testing_print_summary)
message(STATUS "S390X ZVECTOR: Using architecture defaults")
endif()
if(EIGEN_TEST_CXX11)
message(STATUS "C++11: ON")
else()
message(STATUS "C++11: OFF")
endif()
if(EIGEN_TEST_SYCL)
if(EIGEN_SYCL_TRISYCL)
message(STATUS "SYCL: ON (using triSYCL)")
@@ -455,15 +439,7 @@ endmacro()
macro(ei_get_compilerver VAR)
if(MSVC)
# on windows system, we use a modified CMake script
include(EigenDetermineVSServicePack)
EigenDetermineVSServicePack( my_service_pack )
if( my_service_pack )
set(${VAR} ${my_service_pack})
else()
set(${VAR} "na")
endif()
set(${VAR} "${CMAKE_CXX_COMPILER_VERSION}")
elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "PGI")
set(${VAR} "${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION}")
else()
@@ -598,10 +574,7 @@ macro(ei_set_build_string)
ei_get_compilerver(LOCAL_COMPILER_VERSION)
ei_get_cxxflags(LOCAL_COMPILER_FLAGS)
include(EigenDetermineOSVersion)
DetermineOSVersion(OS_VERSION)
set(TMP_BUILD_STRING ${OS_VERSION}-${LOCAL_COMPILER_VERSION})
set(TMP_BUILD_STRING ${CMAKE_SYSTEM}-${LOCAL_COMPILER_VERSION})
if (NOT ${LOCAL_COMPILER_FLAGS} STREQUAL "")
set(TMP_BUILD_STRING ${TMP_BUILD_STRING}-${LOCAL_COMPILER_FLAGS})
@@ -618,10 +591,6 @@ macro(ei_set_build_string)
set(TMP_BUILD_STRING ${TMP_BUILD_STRING}-64bit)
endif()
if(EIGEN_TEST_CXX11)
set(TMP_BUILD_STRING ${TMP_BUILD_STRING}-cxx11)
endif()
if(EIGEN_BUILD_STRING_SUFFIX)
set(TMP_BUILD_STRING ${TMP_BUILD_STRING}-${EIGEN_BUILD_STRING_SUFFIX})
endif()
@@ -671,8 +640,8 @@ endmacro()
# Split all tests listed in EIGEN_TESTS_LIST into num_splits many targets
# named buildtestspartN with N = { 0, ..., num_splits-1}.
#
# The intention behind the existance of this macro is the size of Eigen's
# testsuite. Together with the relativly big compile-times building all tests
# The intention behind the existence of this macro is the size of Eigen's
# testsuite. Together with the relatively big compile-times building all tests
# can take a substantial amount of time depending on the available hardware.
#
# The last buildtestspartN target will build possible remaining tests.
@@ -775,8 +744,7 @@ macro(ei_add_smoke_tests smoke_test_list)
if ("${test}" IN_LIST EIGEN_SUBTESTS_LIST)
add_dependencies("${buildtarget}" "${test}")
# Add label smoketest to be able to run smoketests using ctest
get_property(test_labels TEST ${test} PROPERTY LABELS)
set_property(TEST ${test} PROPERTY LABELS "${test_labels};smoketest")
set_property(TEST ${test} APPEND PROPERTY LABELS "smoketest")
endif()
endforeach()
endmacro(ei_add_smoke_tests)