2018-07-17 00:55:40 +08:00
|
|
|
# The file split_test_helper.h was generated at first run,
|
|
|
|
# it is now included in test/
|
|
|
|
if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/split_test_helper.h)
|
|
|
|
file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/split_test_helper.h)
|
2016-03-08 06:08:56 +08:00
|
|
|
endif()
|
2010-10-13 02:23:52 +08:00
|
|
|
|
2013-03-20 15:40:13 +08:00
|
|
|
set_property(GLOBAL PROPERTY EIGEN_CURRENT_SUBPROJECT "Unsupported")
|
|
|
|
add_custom_target(BuildUnsupported)
|
|
|
|
|
2016-11-05 02:18:19 +08:00
|
|
|
include_directories(../../test ../../unsupported ../../Eigen
|
2011-03-29 21:17:49 +08:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/../../test)
|
2009-02-28 00:19:13 +08:00
|
|
|
|
2015-09-03 04:51:43 +08:00
|
|
|
find_package (Threads)
|
2016-11-05 02:18:19 +08:00
|
|
|
|
2010-06-18 17:28:30 +08:00
|
|
|
find_package(GoogleHash)
|
2021-02-24 12:16:52 +08:00
|
|
|
if(GoogleHash_FOUND)
|
2010-06-18 17:28:30 +08:00
|
|
|
add_definitions("-DEIGEN_GOOGLEHASH_SUPPORT")
|
|
|
|
include_directories(${GOOGLEHASH_INCLUDES})
|
|
|
|
ei_add_property(EIGEN_TESTED_BACKENDS "GoogleHash, ")
|
2019-11-01 00:36:27 +08:00
|
|
|
else()
|
2010-06-18 17:28:30 +08:00
|
|
|
ei_add_property(EIGEN_MISSING_BACKENDS "GoogleHash, ")
|
2019-11-01 00:36:27 +08:00
|
|
|
endif()
|
2010-06-18 17:28:30 +08:00
|
|
|
|
2018-04-14 01:10:23 +08:00
|
|
|
|
2010-10-13 02:23:52 +08:00
|
|
|
find_package(Adolc)
|
2021-02-20 06:17:10 +08:00
|
|
|
if(Adolc_FOUND)
|
2009-02-28 00:19:13 +08:00
|
|
|
include_directories(${ADOLC_INCLUDES})
|
2010-07-15 22:29:04 +08:00
|
|
|
ei_add_property(EIGEN_TESTED_BACKENDS "Adolc, ")
|
2018-04-14 01:10:23 +08:00
|
|
|
if(EIGEN_TEST_CXX11)
|
|
|
|
ei_add_test(forward_adolc "" ${ADOLC_LIBRARIES})
|
|
|
|
else()
|
|
|
|
message(STATUS "Adolc found, but tests require C++11 mode")
|
|
|
|
endif()
|
2019-11-01 00:36:27 +08:00
|
|
|
else()
|
2010-07-15 22:29:04 +08:00
|
|
|
ei_add_property(EIGEN_MISSING_BACKENDS "Adolc, ")
|
2019-11-01 00:36:27 +08:00
|
|
|
endif()
|
2009-03-19 04:06:06 +08:00
|
|
|
|
2010-08-18 21:11:01 +08:00
|
|
|
# this test seems to never have been successful on x87, so is considered to contain a FP-related bug.
|
|
|
|
# see thread: "non-linear optimization test summary"
|
2012-12-08 03:53:19 +08:00
|
|
|
ei_add_test(NonLinearOptimization)
|
|
|
|
|
2009-09-28 08:43:07 +08:00
|
|
|
ei_add_test(NumericalDiff)
|
2013-11-08 01:32:24 +08:00
|
|
|
ei_add_test(autodiff_scalar)
|
2009-04-01 22:43:37 +08:00
|
|
|
ei_add_test(autodiff)
|
2011-02-28 10:37:34 +08:00
|
|
|
|
2009-03-19 04:06:06 +08:00
|
|
|
ei_add_test(BVH)
|
2011-02-28 10:37:34 +08:00
|
|
|
|
2016-02-19 14:20:50 +08:00
|
|
|
ei_add_test(matrix_exponential)
|
2010-01-12 02:05:30 +08:00
|
|
|
ei_add_test(matrix_function)
|
2016-02-19 14:20:50 +08:00
|
|
|
ei_add_test(matrix_power)
|
2011-05-08 05:57:46 +08:00
|
|
|
ei_add_test(matrix_square_root)
|
2009-05-04 01:19:19 +08:00
|
|
|
ei_add_test(alignedvector3)
|
2014-09-01 23:35:58 +08:00
|
|
|
|
2009-05-19 12:21:04 +08:00
|
|
|
ei_add_test(FFT)
|
2009-12-02 23:03:16 +08:00
|
|
|
|
2015-09-27 21:51:24 +08:00
|
|
|
ei_add_test(EulerAngles)
|
|
|
|
|
2010-07-19 19:26:52 +08:00
|
|
|
find_package(MPFR 2.3.0)
|
2010-10-17 23:04:43 +08:00
|
|
|
find_package(GMP)
|
2018-10-19 23:20:51 +08:00
|
|
|
if(MPFR_FOUND AND EIGEN_COMPILER_SUPPORT_CPP11)
|
2011-08-19 21:08:29 +08:00
|
|
|
include_directories(${MPFR_INCLUDES} ./mpreal)
|
2010-07-15 22:29:04 +08:00
|
|
|
ei_add_property(EIGEN_TESTED_BACKENDS "MPFR C++, ")
|
2010-10-17 23:04:43 +08:00
|
|
|
set(EIGEN_MPFR_TEST_LIBRARIES ${MPFR_LIBRARIES} ${GMP_LIBRARIES})
|
2015-10-28 00:35:54 +08:00
|
|
|
ei_add_test(mpreal_support "-std=c++11" "${EIGEN_MPFR_TEST_LIBRARIES}" )
|
2010-07-15 22:29:04 +08:00
|
|
|
else()
|
|
|
|
ei_add_property(EIGEN_MISSING_BACKENDS "MPFR C++, ")
|
|
|
|
endif()
|
|
|
|
|
2010-10-28 22:44:20 +08:00
|
|
|
ei_add_test(sparse_extra "" "")
|
2010-06-18 17:28:30 +08:00
|
|
|
|
2009-06-11 10:16:32 +08:00
|
|
|
find_package(FFTW)
|
|
|
|
if(FFTW_FOUND)
|
2010-07-22 22:08:58 +08:00
|
|
|
ei_add_property(EIGEN_TESTED_BACKENDS "fftw, ")
|
2012-03-15 22:18:22 +08:00
|
|
|
include_directories( ${FFTW_INCLUDES} )
|
2011-01-28 23:54:01 +08:00
|
|
|
if(FFTWL_LIB)
|
2011-11-03 22:33:42 +08:00
|
|
|
ei_add_test(FFTW "-DEIGEN_FFTW_DEFAULT -DEIGEN_HAS_FFTWL" "${FFTW_LIBRARIES}" )
|
2011-01-28 23:54:01 +08:00
|
|
|
else()
|
2012-03-15 22:18:22 +08:00
|
|
|
ei_add_test(FFTW "-DEIGEN_FFTW_DEFAULT" "${FFTW_LIBRARIES}" )
|
2011-01-28 23:54:01 +08:00
|
|
|
endif()
|
2010-07-22 22:08:58 +08:00
|
|
|
else()
|
|
|
|
ei_add_property(EIGEN_MISSING_BACKENDS "fftw, ")
|
|
|
|
endif()
|
|
|
|
|
2020-11-13 08:07:55 +08:00
|
|
|
option(EIGEN_TEST_OPENGL "Enable OpenGL support in unit tests" OFF)
|
|
|
|
if(EIGEN_TEST_OPENGL)
|
2010-10-17 23:21:10 +08:00
|
|
|
find_package(OpenGL)
|
|
|
|
find_package(GLUT)
|
|
|
|
find_package(GLEW)
|
|
|
|
if(OPENGL_FOUND AND GLUT_FOUND AND GLEW_FOUND)
|
2014-12-04 14:18:47 +08:00
|
|
|
include_directories(${OPENGL_INCLUDE_DIR} ${GLUT_INCLUDE_DIR} ${GLEW_INCLUDE_DIRS})
|
2010-10-17 23:21:10 +08:00
|
|
|
ei_add_property(EIGEN_TESTED_BACKENDS "OpenGL, ")
|
2014-12-04 14:18:47 +08:00
|
|
|
set(EIGEN_GL_LIB ${GLUT_LIBRARIES} ${GLEW_LIBRARIES} ${OPENGL_LIBRARIES})
|
2010-10-17 23:21:10 +08:00
|
|
|
ei_add_test(openglsupport "" "${EIGEN_GL_LIB}" )
|
|
|
|
else()
|
|
|
|
ei_add_property(EIGEN_MISSING_BACKENDS "OpenGL, ")
|
|
|
|
endif()
|
2011-02-17 01:01:06 +08:00
|
|
|
else()
|
|
|
|
ei_add_property(EIGEN_MISSING_BACKENDS "OpenGL, ")
|
|
|
|
endif()
|
2009-06-11 10:16:32 +08:00
|
|
|
|
2012-04-11 15:48:01 +08:00
|
|
|
ei_add_test(polynomialsolver)
|
2010-03-25 10:15:05 +08:00
|
|
|
ei_add_test(polynomialutils)
|
2011-11-25 21:53:40 +08:00
|
|
|
ei_add_test(splines)
|
2012-03-29 21:00:55 +08:00
|
|
|
ei_add_test(gmres)
|
2018-07-02 18:54:14 +08:00
|
|
|
ei_add_test(dgmres)
|
2012-09-24 22:47:38 +08:00
|
|
|
ei_add_test(minres)
|
2021-02-27 20:09:33 +08:00
|
|
|
ei_add_test(idrs)
|
2012-12-09 01:22:23 +08:00
|
|
|
ei_add_test(levenberg_marquardt)
|
2014-09-19 04:08:49 +08:00
|
|
|
ei_add_test(kronecker_product)
|
2019-09-15 00:16:47 +08:00
|
|
|
ei_add_test(bessel_functions)
|
2016-07-08 17:13:55 +08:00
|
|
|
ei_add_test(special_functions)
|
2020-01-11 18:31:21 +08:00
|
|
|
ei_add_test(special_packetmath "-DEIGEN_FAST_MATH=1")
|
2013-11-15 05:27:06 +08:00
|
|
|
|
|
|
|
if(EIGEN_TEST_CXX11)
|
2016-10-14 19:09:55 +08:00
|
|
|
if(EIGEN_TEST_SYCL)
|
2019-11-28 18:08:54 +08:00
|
|
|
set(EIGEN_SYCL ON)
|
|
|
|
# Forward CMake options as preprocessor definitions
|
|
|
|
if(EIGEN_SYCL_USE_DEFAULT_SELECTOR)
|
|
|
|
add_definitions(-DEIGEN_SYCL_USE_DEFAULT_SELECTOR=${EIGEN_SYCL_USE_DEFAULT_SELECTOR})
|
|
|
|
endif()
|
|
|
|
if(EIGEN_SYCL_NO_LOCAL_MEM)
|
|
|
|
add_definitions(-DEIGEN_SYCL_NO_LOCAL_MEM=${EIGEN_SYCL_NO_LOCAL_MEM})
|
|
|
|
endif()
|
|
|
|
if(EIGEN_SYCL_LOCAL_MEM)
|
|
|
|
add_definitions(-DEIGEN_SYCL_LOCAL_MEM=${EIGEN_SYCL_LOCAL_MEM})
|
|
|
|
endif()
|
|
|
|
if(EIGEN_SYCL_MAX_GLOBAL_RANGE)
|
|
|
|
add_definitions(-DEIGEN_SYCL_MAX_GLOBAL_RANGE=${EIGEN_SYCL_MAX_GLOBAL_RANGE})
|
|
|
|
endif()
|
|
|
|
if(EIGEN_SYCL_LOCAL_THREAD_DIM0)
|
|
|
|
add_definitions(-DEIGEN_SYCL_LOCAL_THREAD_DIM0=${EIGEN_SYCL_LOCAL_THREAD_DIM0})
|
|
|
|
endif()
|
|
|
|
if(EIGEN_SYCL_LOCAL_THREAD_DIM1)
|
|
|
|
add_definitions(-DEIGEN_SYCL_LOCAL_THREAD_DIM1=${EIGEN_SYCL_LOCAL_THREAD_DIM1})
|
|
|
|
endif()
|
|
|
|
if(EIGEN_SYCL_REG_M)
|
|
|
|
add_definitions(-DEIGEN_SYCL_REG_M=${EIGEN_SYCL_REG_M})
|
|
|
|
endif()
|
|
|
|
if(EIGEN_SYCL_REG_N)
|
|
|
|
add_definitions(-DEIGEN_SYCL_REG_N=${EIGEN_SYCL_REG_N})
|
|
|
|
endif()
|
|
|
|
if(EIGEN_SYCL_USE_PROGRAM_CLASS)
|
|
|
|
add_definitions(-DEIGEN_SYCL_USE_PROGRAM_CLASS=${EIGEN_SYCL_USE_PROGRAM_CLASS})
|
|
|
|
endif()
|
|
|
|
if(EIGEN_SYCL_ASYNC_EXECUTION)
|
|
|
|
add_definitions(-DEIGEN_SYCL_ASYNC_EXECUTION=${EIGEN_SYCL_ASYNC_EXECUTION})
|
|
|
|
endif()
|
|
|
|
if(EIGEN_SYCL_DISABLE_SKINNY)
|
|
|
|
add_definitions(-DEIGEN_SYCL_DISABLE_SKINNY=${EIGEN_SYCL_DISABLE_SKINNY})
|
|
|
|
endif()
|
|
|
|
if(EIGEN_SYCL_DISABLE_DOUBLE_BUFFER)
|
|
|
|
add_definitions(-DEIGEN_SYCL_DISABLE_DOUBLE_BUFFER=${EIGEN_SYCL_DISABLE_DOUBLE_BUFFER})
|
|
|
|
endif()
|
|
|
|
if(EIGEN_SYCL_DISABLE_RANK1)
|
|
|
|
add_definitions(-DEIGEN_SYCL_DISABLE_RANK1=${EIGEN_SYCL_DISABLE_RANK1})
|
|
|
|
endif()
|
|
|
|
if(EIGEN_SYCL_DISABLE_SCALAR)
|
|
|
|
add_definitions(-DEIGEN_SYCL_DISABLE_SCALAR=${EIGEN_SYCL_DISABLE_SCALAR})
|
|
|
|
endif()
|
|
|
|
if(EIGEN_SYCL_DISABLE_GEMV)
|
|
|
|
add_definitions(-DEIGEN_SYCL_DISABLE_GEMV=${EIGEN_SYCL_DISABLE_GEMV})
|
|
|
|
endif()
|
|
|
|
if(EIGEN_SYCL_DISABLE_ARM_GPU_CACHE_OPTIMISATION)
|
|
|
|
add_definitions(-DEIGEN_SYCL_DISABLE_ARM_GPU_CACHE_OPTIMISATION=${EIGEN_SYCL_DISABLE_ARM_GPU_CACHE_OPTIMISATION})
|
|
|
|
endif()
|
|
|
|
|
2017-05-06 02:26:27 +08:00
|
|
|
if(EIGEN_SYCL_TRISYCL)
|
|
|
|
set(CMAKE_CXX_STANDARD 14)
|
|
|
|
set(STD_CXX_FLAG "-std=c++1z")
|
2019-11-01 00:36:27 +08:00
|
|
|
else()
|
2019-11-28 18:08:54 +08:00
|
|
|
if(MSVC)
|
|
|
|
# Set the host and device compilers C++ standard to C++14. On Windows setting this to C++11
|
|
|
|
# can cause issues with the ComputeCpp device compiler parsing Visual Studio Headers.
|
|
|
|
set(CMAKE_CXX_STANDARD 14)
|
|
|
|
list(APPEND COMPUTECPP_USER_FLAGS -DWIN32)
|
|
|
|
else()
|
|
|
|
set(CMAKE_CXX_STANDARD 11)
|
|
|
|
list(APPEND COMPUTECPP_USER_FLAGS -Wall)
|
|
|
|
endif()
|
|
|
|
# The following flags are not supported by Clang and can cause warnings
|
|
|
|
# if used with -Werror so they are removed here.
|
|
|
|
if(COMPUTECPP_USE_COMPILER_DRIVER)
|
|
|
|
set(CMAKE_CXX_COMPILER ${ComputeCpp_DEVICE_COMPILER_EXECUTABLE})
|
|
|
|
string(REPLACE "-Wlogical-op" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
|
|
|
string(REPLACE "-Wno-psabi" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
|
|
|
string(REPLACE "-ansi" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
|
|
|
endif()
|
|
|
|
list(APPEND COMPUTECPP_USER_FLAGS
|
|
|
|
-DEIGEN_NO_ASSERTION_CHECKING=1
|
|
|
|
-no-serial-memop
|
|
|
|
-Xclang
|
|
|
|
-cl-mad-enable)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
ei_add_test(cxx11_tensor_sycl ${STD_CXX_FLAG})
|
|
|
|
ei_add_test(cxx11_tensor_image_op_sycl ${STD_CXX_FLAG})
|
|
|
|
ei_add_test(cxx11_tensor_math_sycl ${STD_CXX_FLAG})
|
|
|
|
ei_add_test(cxx11_tensor_forced_eval_sycl ${STD_CXX_FLAG})
|
|
|
|
ei_add_test(cxx11_tensor_broadcast_sycl ${STD_CXX_FLAG})
|
|
|
|
ei_add_test(cxx11_tensor_device_sycl ${STD_CXX_FLAG})
|
|
|
|
ei_add_test(cxx11_tensor_reduction_sycl ${STD_CXX_FLAG})
|
|
|
|
ei_add_test(cxx11_tensor_morphing_sycl ${STD_CXX_FLAG})
|
|
|
|
ei_add_test(cxx11_tensor_shuffling_sycl ${STD_CXX_FLAG})
|
|
|
|
ei_add_test(cxx11_tensor_padding_sycl ${STD_CXX_FLAG})
|
|
|
|
ei_add_test(cxx11_tensor_builtins_sycl ${STD_CXX_FLAG})
|
|
|
|
ei_add_test(cxx11_tensor_contract_sycl ${STD_CXX_FLAG})
|
|
|
|
ei_add_test(cxx11_tensor_concatenation_sycl ${STD_CXX_FLAG})
|
|
|
|
ei_add_test(cxx11_tensor_reverse_sycl ${STD_CXX_FLAG})
|
|
|
|
ei_add_test(cxx11_tensor_convolution_sycl ${STD_CXX_FLAG})
|
|
|
|
ei_add_test(cxx11_tensor_striding_sycl ${STD_CXX_FLAG})
|
|
|
|
ei_add_test(cxx11_tensor_chipping_sycl ${STD_CXX_FLAG})
|
|
|
|
ei_add_test(cxx11_tensor_layout_swap_sycl ${STD_CXX_FLAG})
|
|
|
|
ei_add_test(cxx11_tensor_inflation_sycl ${STD_CXX_FLAG})
|
|
|
|
ei_add_test(cxx11_tensor_random_sycl ${STD_CXX_FLAG})
|
|
|
|
ei_add_test(cxx11_tensor_generator_sycl ${STD_CXX_FLAG})
|
|
|
|
ei_add_test(cxx11_tensor_patch_sycl ${STD_CXX_FLAG})
|
|
|
|
ei_add_test(cxx11_tensor_image_patch_sycl ${STD_CXX_FLAG})
|
|
|
|
ei_add_test(cxx11_tensor_volume_patch_sycl ${STD_CXX_FLAG})
|
|
|
|
ei_add_test(cxx11_tensor_argmax_sycl ${STD_CXX_FLAG})
|
|
|
|
ei_add_test(cxx11_tensor_custom_op_sycl ${STD_CXX_FLAG})
|
|
|
|
ei_add_test(cxx11_tensor_scan_sycl ${STD_CXX_FLAG})
|
|
|
|
set(EIGEN_SYCL OFF)
|
2019-11-01 00:36:27 +08:00
|
|
|
endif()
|
2016-03-05 12:18:01 +08:00
|
|
|
|
2016-04-15 07:44:10 +08:00
|
|
|
ei_add_test(cxx11_eventcount "-pthread" "${CMAKE_THREAD_LIBS_INIT}")
|
|
|
|
ei_add_test(cxx11_runqueue "-pthread" "${CMAKE_THREAD_LIBS_INIT}")
|
2016-05-11 01:49:34 +08:00
|
|
|
ei_add_test(cxx11_non_blocking_thread_pool "-pthread" "${CMAKE_THREAD_LIBS_INIT}")
|
|
|
|
|
2016-03-05 12:18:01 +08:00
|
|
|
ei_add_test(cxx11_meta)
|
2019-10-19 07:42:00 +08:00
|
|
|
ei_add_test(cxx11_maxsizevector)
|
|
|
|
ei_add_test(cxx11_tensor_argmax)
|
|
|
|
ei_add_test(cxx11_tensor_assign)
|
|
|
|
ei_add_test(cxx11_tensor_block_access)
|
|
|
|
ei_add_test(cxx11_tensor_block_eval)
|
|
|
|
ei_add_test(cxx11_tensor_block_io)
|
|
|
|
ei_add_test(cxx11_tensor_broadcasting)
|
|
|
|
ei_add_test(cxx11_tensor_casts)
|
|
|
|
ei_add_test(cxx11_tensor_chipping)
|
|
|
|
ei_add_test(cxx11_tensor_comparisons)
|
|
|
|
ei_add_test(cxx11_tensor_concatenation)
|
|
|
|
ei_add_test(cxx11_tensor_const)
|
2016-03-05 12:18:01 +08:00
|
|
|
ei_add_test(cxx11_tensor_contraction)
|
|
|
|
ei_add_test(cxx11_tensor_convolution)
|
2019-10-19 07:42:00 +08:00
|
|
|
ei_add_test(cxx11_tensor_custom_index)
|
|
|
|
ei_add_test(cxx11_tensor_custom_op)
|
|
|
|
ei_add_test(cxx11_tensor_dimension)
|
|
|
|
ei_add_test(cxx11_tensor_empty)
|
|
|
|
ei_add_test(cxx11_tensor_executor "-pthread" "${CMAKE_THREAD_LIBS_INIT}")
|
2016-03-05 12:18:01 +08:00
|
|
|
ei_add_test(cxx11_tensor_expr)
|
2019-10-19 07:42:00 +08:00
|
|
|
ei_add_test(cxx11_tensor_fft)
|
2016-03-05 12:18:01 +08:00
|
|
|
ei_add_test(cxx11_tensor_fixed_size)
|
2019-10-19 07:42:00 +08:00
|
|
|
ei_add_test(cxx11_tensor_forced_eval)
|
|
|
|
ei_add_test(cxx11_tensor_generator)
|
|
|
|
ei_add_test(cxx11_tensor_ifft)
|
|
|
|
ei_add_test(cxx11_tensor_image_patch)
|
|
|
|
ei_add_test(cxx11_tensor_index_list)
|
2016-03-05 12:18:01 +08:00
|
|
|
ei_add_test(cxx11_tensor_inflation)
|
2019-10-19 07:42:00 +08:00
|
|
|
ei_add_test(cxx11_tensor_intdiv)
|
|
|
|
ei_add_test(cxx11_tensor_io)
|
|
|
|
ei_add_test(cxx11_tensor_layout_swap)
|
|
|
|
ei_add_test(cxx11_tensor_lvalue)
|
|
|
|
ei_add_test(cxx11_tensor_map)
|
|
|
|
ei_add_test(cxx11_tensor_math)
|
|
|
|
ei_add_test(cxx11_tensor_mixed_indices)
|
2016-03-05 12:18:01 +08:00
|
|
|
ei_add_test(cxx11_tensor_morphing)
|
2019-10-19 07:42:00 +08:00
|
|
|
ei_add_test(cxx11_tensor_move)
|
|
|
|
ei_add_test(cxx11_tensor_notification "-pthread" "${CMAKE_THREAD_LIBS_INIT}")
|
|
|
|
ei_add_test(cxx11_tensor_of_complex)
|
|
|
|
ei_add_test(cxx11_tensor_of_const_values)
|
|
|
|
ei_add_test(cxx11_tensor_of_strings)
|
2016-03-05 12:18:01 +08:00
|
|
|
ei_add_test(cxx11_tensor_padding)
|
|
|
|
ei_add_test(cxx11_tensor_patch)
|
2019-10-19 07:42:00 +08:00
|
|
|
ei_add_test(cxx11_tensor_random)
|
2016-03-05 12:18:01 +08:00
|
|
|
ei_add_test(cxx11_tensor_reduction)
|
2019-10-19 07:42:00 +08:00
|
|
|
ei_add_test(cxx11_tensor_ref)
|
|
|
|
ei_add_test(cxx11_tensor_roundings)
|
|
|
|
ei_add_test(cxx11_tensor_scan)
|
2016-03-05 12:18:01 +08:00
|
|
|
ei_add_test(cxx11_tensor_shuffling)
|
2019-10-19 07:42:00 +08:00
|
|
|
ei_add_test(cxx11_tensor_simple)
|
2016-03-05 12:18:01 +08:00
|
|
|
ei_add_test(cxx11_tensor_striding)
|
2019-10-19 07:42:00 +08:00
|
|
|
ei_add_test(cxx11_tensor_sugar)
|
2019-09-10 06:18:14 +08:00
|
|
|
ei_add_test(cxx11_tensor_thread_local "-pthread" "${CMAKE_THREAD_LIBS_INIT}")
|
2015-09-03 04:51:43 +08:00
|
|
|
ei_add_test(cxx11_tensor_thread_pool "-pthread" "${CMAKE_THREAD_LIBS_INIT}")
|
2017-07-07 12:18:03 +08:00
|
|
|
ei_add_test(cxx11_tensor_trace)
|
2019-10-19 07:42:00 +08:00
|
|
|
ei_add_test(cxx11_tensor_volume_patch)
|
|
|
|
# ei_add_test(cxx11_tensor_symmetry)
|
2018-07-21 07:08:40 +08:00
|
|
|
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8" AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
|
|
|
# This test requires __uint128_t which is only available on 64bit systems
|
|
|
|
ei_add_test(cxx11_tensor_uint128)
|
|
|
|
endif()
|
2016-02-06 10:14:23 +08:00
|
|
|
|
2013-11-15 05:27:06 +08:00
|
|
|
endif()
|
2016-01-28 04:22:17 +08:00
|
|
|
|
|
|
|
# These tests needs nvcc
|
2016-01-28 16:35:37 +08:00
|
|
|
find_package(CUDA 7.0)
|
2016-04-07 00:35:23 +08:00
|
|
|
if(CUDA_FOUND AND EIGEN_TEST_CUDA)
|
2016-03-23 05:26:50 +08:00
|
|
|
# Make sure to compile without the -pedantic, -Wundef, -Wnon-virtual-dtor
|
|
|
|
# and -fno-check-new flags since they trigger thousands of compilation warnings
|
|
|
|
# in the CUDA runtime
|
2016-07-12 00:09:04 +08:00
|
|
|
# Also remove -ansi that is incompatible with std=c++11.
|
2016-03-18 22:04:54 +08:00
|
|
|
string(REPLACE "-pedantic" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
|
|
|
string(REPLACE "-Wundef" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
2016-03-23 05:26:50 +08:00
|
|
|
string(REPLACE "-Wnon-virtual-dtor" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
|
|
|
string(REPLACE "-fno-check-new" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
2016-07-12 00:09:04 +08:00
|
|
|
string(REPLACE "-ansi" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
2016-03-23 05:26:50 +08:00
|
|
|
|
2016-03-18 22:04:54 +08:00
|
|
|
message(STATUS "Flags used to compile cuda code: " ${CMAKE_CXX_FLAGS})
|
|
|
|
|
2016-01-28 04:22:17 +08:00
|
|
|
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
2016-10-04 08:09:33 +08:00
|
|
|
set(CUDA_NVCC_FLAGS "-ccbin ${CMAKE_C_COMPILER}" CACHE STRING "nvcc flags" FORCE)
|
2016-01-28 04:22:17 +08:00
|
|
|
endif()
|
2016-04-09 04:16:08 +08:00
|
|
|
if(EIGEN_TEST_CUDA_CLANG)
|
2019-06-01 05:08:34 +08:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
|
|
|
string(APPEND CMAKE_CXX_FLAGS " --cuda-path=${CUDA_TOOLKIT_ROOT_DIR}")
|
|
|
|
foreach(ARCH IN LISTS EIGEN_CUDA_COMPUTE_ARCH)
|
|
|
|
string(APPEND CMAKE_CXX_FLAGS " --cuda-gpu-arch=sm_${ARCH}")
|
|
|
|
endforeach()
|
2016-04-09 04:16:08 +08:00
|
|
|
endif()
|
|
|
|
|
2016-05-28 01:47:53 +08:00
|
|
|
set(EIGEN_CUDA_RELAXED_CONSTEXPR "--expt-relaxed-constexpr")
|
|
|
|
if (${CUDA_VERSION} STREQUAL "7.0")
|
|
|
|
set(EIGEN_CUDA_RELAXED_CONSTEXPR "--relaxed-constexpr")
|
|
|
|
endif()
|
|
|
|
|
2019-06-01 05:08:34 +08:00
|
|
|
set(NVCC_ARCH_FLAGS)
|
|
|
|
foreach(ARCH IN LISTS EIGEN_CUDA_COMPUTE_ARCH)
|
|
|
|
string(APPEND NVCC_ARCH_FLAGS " -gencode arch=compute_${ARCH},code=sm_${ARCH}")
|
|
|
|
endforeach()
|
2020-12-14 17:57:44 +08:00
|
|
|
set(CUDA_NVCC_FLAGS "${EIGEN_CUDA_RELAXED_CONSTEXPR} -Xcudafe \"--display_error_number\" ${NVCC_ARCH_FLAGS} ${CUDA_NVCC_FLAGS}")
|
2016-01-28 04:22:17 +08:00
|
|
|
cuda_include_directories("${CMAKE_CURRENT_BINARY_DIR}" "${CUDA_TOOLKIT_ROOT_DIR}/include")
|
2016-01-28 06:46:34 +08:00
|
|
|
set(EIGEN_ADD_TEST_FILENAME_EXTENSION "cu")
|
|
|
|
|
2018-06-21 04:44:58 +08:00
|
|
|
ei_add_test(cxx11_tensor_complex_gpu)
|
|
|
|
ei_add_test(cxx11_tensor_complex_cwise_ops_gpu)
|
|
|
|
ei_add_test(cxx11_tensor_reduction_gpu)
|
|
|
|
ei_add_test(cxx11_tensor_argmax_gpu)
|
|
|
|
ei_add_test(cxx11_tensor_cast_float16_gpu)
|
|
|
|
ei_add_test(cxx11_tensor_scan_gpu)
|
2016-01-28 04:22:17 +08:00
|
|
|
|
2019-06-01 05:08:34 +08:00
|
|
|
set(EIGEN_CUDA_OLDEST_COMPUTE_ARCH 9999)
|
|
|
|
foreach(ARCH IN LISTS EIGEN_CUDA_COMPUTE_ARCH)
|
|
|
|
if(${ARCH} LESS ${EIGEN_CUDA_OLDEST_COMPUTE_ARCH})
|
|
|
|
set(EIGEN_CUDA_OLDEST_COMPUTE_ARCH ${ARCH})
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
|
2016-09-13 09:49:01 +08:00
|
|
|
# Contractions require arch 3.0 or higher
|
2019-06-01 05:08:34 +08:00
|
|
|
if (${EIGEN_CUDA_OLDEST_COMPUTE_ARCH} GREATER 29)
|
2016-09-13 10:01:52 +08:00
|
|
|
ei_add_test(cxx11_tensor_device)
|
2018-06-21 04:44:58 +08:00
|
|
|
ei_add_test(cxx11_tensor_gpu)
|
|
|
|
ei_add_test(cxx11_tensor_contract_gpu)
|
|
|
|
ei_add_test(cxx11_tensor_of_float16_gpu)
|
2016-09-13 09:49:01 +08:00
|
|
|
endif()
|
|
|
|
|
2016-03-04 02:37:25 +08:00
|
|
|
# The random number generation code requires arch 3.5 or greater.
|
2019-06-01 05:08:34 +08:00
|
|
|
if (${EIGEN_CUDA_OLDEST_COMPUTE_ARCH} GREATER 34)
|
2018-06-21 04:44:58 +08:00
|
|
|
ei_add_test(cxx11_tensor_random_gpu)
|
2016-03-04 02:37:25 +08:00
|
|
|
endif()
|
|
|
|
|
2016-02-19 14:16:07 +08:00
|
|
|
|
2016-01-28 04:22:17 +08:00
|
|
|
unset(EIGEN_ADD_TEST_FILENAME_EXTENSION)
|
2016-01-28 16:35:37 +08:00
|
|
|
endif()
|
2018-06-06 22:12:58 +08:00
|
|
|
|
2018-07-21 08:37:20 +08:00
|
|
|
# Add HIP specific tests
|
2018-06-06 22:12:58 +08:00
|
|
|
if (EIGEN_TEST_HIP)
|
|
|
|
|
|
|
|
set(HIP_PATH "/opt/rocm/hip" CACHE STRING "Path to the HIP installation.")
|
|
|
|
|
|
|
|
if (EXISTS ${HIP_PATH})
|
2018-07-21 08:37:20 +08:00
|
|
|
|
|
|
|
list(APPEND CMAKE_MODULE_PATH ${HIP_PATH}/cmake)
|
2018-06-06 22:12:58 +08:00
|
|
|
|
|
|
|
find_package(HIP REQUIRED)
|
|
|
|
if (HIP_FOUND)
|
|
|
|
|
|
|
|
execute_process(COMMAND ${HIP_PATH}/bin/hipconfig --platform OUTPUT_VARIABLE HIP_PLATFORM)
|
|
|
|
|
2020-10-30 01:00:04 +08:00
|
|
|
if ((${HIP_PLATFORM} STREQUAL "hcc") OR (${HIP_PLATFORM} STREQUAL "amd"))
|
2018-06-06 22:12:58 +08:00
|
|
|
|
|
|
|
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
include_directories(${HIP_PATH}/include)
|
|
|
|
|
|
|
|
set(EIGEN_ADD_TEST_FILENAME_EXTENSION "cu")
|
2018-06-21 04:44:58 +08:00
|
|
|
#
|
|
|
|
# complex datatype is not yet supported by HIP
|
|
|
|
# so leaving out those tests for now
|
|
|
|
#
|
|
|
|
# ei_add_test(cxx11_tensor_complex_gpu)
|
|
|
|
# ei_add_test(cxx11_tensor_complex_cwise_ops_gpu)
|
|
|
|
#
|
|
|
|
ei_add_test(cxx11_tensor_reduction_gpu)
|
|
|
|
ei_add_test(cxx11_tensor_argmax_gpu)
|
|
|
|
ei_add_test(cxx11_tensor_cast_float16_gpu)
|
|
|
|
ei_add_test(cxx11_tensor_scan_gpu)
|
|
|
|
ei_add_test(cxx11_tensor_device)
|
|
|
|
|
|
|
|
ei_add_test(cxx11_tensor_gpu)
|
|
|
|
ei_add_test(cxx11_tensor_contract_gpu)
|
|
|
|
ei_add_test(cxx11_tensor_of_float16_gpu)
|
|
|
|
ei_add_test(cxx11_tensor_random_gpu)
|
2018-07-21 08:37:20 +08:00
|
|
|
|
2018-06-06 22:12:58 +08:00
|
|
|
unset(EIGEN_ADD_TEST_FILENAME_EXTENSION)
|
2018-07-21 08:37:20 +08:00
|
|
|
|
2020-10-30 01:00:04 +08:00
|
|
|
elseif ((${HIP_PLATFORM} STREQUAL "nvcc") OR (${HIP_PLATFORM} STREQUAL "nvidia"))
|
2018-06-06 22:12:58 +08:00
|
|
|
message(FATAL_ERROR "HIP_PLATFORM = nvcc is not supported within Eigen")
|
|
|
|
else ()
|
|
|
|
message(FATAL_ERROR "Unknown HIP_PLATFORM = ${HIP_PLATFORM}")
|
|
|
|
endif()
|
2018-07-21 08:37:20 +08:00
|
|
|
|
2019-11-01 00:36:27 +08:00
|
|
|
endif()
|
2018-06-06 22:12:58 +08:00
|
|
|
|
|
|
|
else ()
|
|
|
|
|
|
|
|
message(FATAL_ERROR "EIGEN_TEST_HIP is ON, but the specified HIP_PATH (${HIP_PATH}) does not exist")
|
2018-07-21 08:37:20 +08:00
|
|
|
|
2018-06-06 22:12:58 +08:00
|
|
|
endif()
|
2018-07-21 08:37:20 +08:00
|
|
|
|
2019-11-01 00:36:27 +08:00
|
|
|
endif()
|
2018-06-06 22:12:58 +08:00
|
|
|
|