Fix loongarch64 emulated tests.

This commit is contained in:
Antonio Sánchez
2025-01-31 19:30:42 +00:00
parent 2926b2e0a9
commit 9589cc4e7f
4 changed files with 22 additions and 16 deletions

View File

@@ -33,7 +33,7 @@ macro(ei_add_test_internal testname testname_with_suffix)
set_property(TARGET ${targetname} PROPERTY HIP_ARCHITECTURES gfx900 gfx906 gfx908 gfx90a gfx940 gfx941 gfx942 gfx1030)
elseif(EIGEN_TEST_CUDA_CLANG)
set_source_files_properties(${filename} PROPERTIES LANGUAGE CXX)
if(CUDA_64_BIT_DEVICE_CODE AND (EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/lib64"))
link_directories("${CUDA_TOOLKIT_ROOT_DIR}/lib64")
else()
@@ -54,7 +54,7 @@ macro(ei_add_test_internal testname testname_with_suffix)
endif()
add_dependencies(buildtests ${targetname})
if (is_gpu_test)
add_dependencies(buildtests_gpu ${targetname})
endif()
@@ -107,7 +107,7 @@ macro(ei_add_test_internal testname testname_with_suffix)
endif()
endif()
add_test(${testname_with_suffix} "${targetname}")
add_test(NAME ${testname_with_suffix} COMMAND "${targetname}")
# Specify target and test labels according to EIGEN_CURRENT_SUBPROJECT
get_property(current_subproject GLOBAL PROPERTY EIGEN_CURRENT_SUBPROJECT)
@@ -120,7 +120,7 @@ macro(ei_add_test_internal testname testname_with_suffix)
# 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)
@@ -237,6 +237,11 @@ macro(ei_add_failtest testname)
add_test(NAME ${test_target_ko}
COMMAND ${CMAKE_COMMAND} --build . --target ${test_target_ko} --config $<CONFIG>
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
# Disable emulator if cross-compiling.
if (CMAKE_CROSSCOMPILING)
set_property(TEST ${test_target_ok} PROPERTY CROSSCOMPILING_EMULATOR "")
set_property(TEST ${test_target_ko} PROPERTY CROSSCOMPILING_EMULATOR "")
endif()
# Expect the second test to fail
set_tests_properties(${test_target_ko} PROPERTIES WILL_FAIL TRUE)
@@ -518,12 +523,12 @@ macro(ei_get_compilerver_from_cxx_version_string VERSTRING CNAME CVER)
string(REGEX MATCH "[^0-9][0-9]+\\.[0-9]+" eicver ${VERSTRING})
if (NOT eicver AND ei_has_mingw)
# try to extract 1 number plus suffix:
string(REGEX MATCH "[^0-9][0-9]+-win32" eicver ${VERSTRING})
string(REGEX MATCH "[^0-9][0-9]+-win32" eicver ${VERSTRING})
endif()
endif()
endif()
endif()
if (NOT eicver)
set(eicver " _")
endif()
@@ -653,7 +658,7 @@ endmacro()
# 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.
#
# An example:
@@ -697,7 +702,7 @@ macro(ei_split_testsuite num_splits)
endforeach()
math(EXPR test_idx "${test_idx} + ${num_tests_per_target}")
endforeach()
# Handle the possibly remaining tests
math(EXPR test_idx "${num_splits} * ${num_tests_per_target}")
math(EXPR target_bound "${eigen_test_count} - 1")
@@ -709,10 +714,10 @@ endmacro(ei_split_testsuite num_splits)
# Defines the custom command buildsmoketests to build a number of tests
# specified in smoke_test_list.
#
#
# Test in smoke_test_list can be either test targets (e.g. packetmath) or
# subtests targets (e.g. packetmath_2). If any of the test are not available
# in the current configuration they are just skipped.
# in the current configuration they are just skipped.
#
# All tests added via this macro are labeled with the smoketest label. This
# allows running smoketests only using ctest.