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)
|
2013-07-31 22:16:08 +08:00
|
|
|
endif()
|
2011-03-28 23:39:05 +08:00
|
|
|
|
2014-03-13 04:33:45 +08:00
|
|
|
# check if we have a Fortran compiler
|
2020-10-12 19:24:08 +08:00
|
|
|
include(CheckLanguage)
|
|
|
|
check_language(Fortran)
|
|
|
|
if(CMAKE_Fortran_COMPILER)
|
|
|
|
enable_language(Fortran)
|
|
|
|
set(EIGEN_Fortran_COMPILER_WORKS ON)
|
|
|
|
else()
|
|
|
|
set(EIGEN_Fortran_COMPILER_WORKS OFF)
|
2014-03-13 04:33:45 +08:00
|
|
|
# search for a default Lapack library to complete Eigen's one
|
2017-04-14 16:22:12 +08:00
|
|
|
find_package(LAPACK QUIET)
|
2014-03-13 04:33:45 +08:00
|
|
|
endif()
|
|
|
|
|
2018-05-23 03:04:32 +08:00
|
|
|
# TODO do the same for EXTERNAL_LAPACK
|
|
|
|
option(EIGEN_TEST_EXTERNAL_BLAS "Use external BLAS library for testsuite" OFF)
|
|
|
|
if(EIGEN_TEST_EXTERNAL_BLAS)
|
|
|
|
find_package(BLAS REQUIRED)
|
|
|
|
message(STATUS "BLAS_COMPILER_FLAGS: ${BLAS_COMPILER_FLAGS}")
|
|
|
|
add_definitions("-DEIGEN_USE_BLAS") # is adding ${BLAS_COMPILER_FLAGS} necessary?
|
|
|
|
list(APPEND EXTERNAL_LIBS "${BLAS_LIBRARIES}")
|
2019-11-01 00:36:27 +08:00
|
|
|
endif()
|
2018-05-23 03:04:32 +08:00
|
|
|
|
2011-11-12 21:11:27 +08:00
|
|
|
# configure blas/lapack (use Eigen's ones)
|
2014-03-13 04:33:45 +08:00
|
|
|
set(EIGEN_BLAS_LIBRARIES eigen_blas)
|
|
|
|
set(EIGEN_LAPACK_LIBRARIES eigen_lapack)
|
2011-11-12 21:11:27 +08:00
|
|
|
|
2012-06-08 00:31:09 +08:00
|
|
|
set(EIGEN_TEST_MATRIX_DIR "" CACHE STRING "Enable testing of realword sparse matrices contained in the specified path")
|
|
|
|
if(EIGEN_TEST_MATRIX_DIR)
|
2012-03-29 20:32:54 +08:00
|
|
|
if(NOT WIN32)
|
2012-06-08 00:31:09 +08:00
|
|
|
message(STATUS "Test realworld sparse matrices: ${EIGEN_TEST_MATRIX_DIR}")
|
|
|
|
add_definitions( -DTEST_REAL_CASES="${EIGEN_TEST_MATRIX_DIR}" )
|
2019-11-01 00:36:27 +08:00
|
|
|
else()
|
2012-06-08 00:31:09 +08:00
|
|
|
message(STATUS "REAL CASES CAN NOT BE CURRENTLY TESTED ON WIN32")
|
2019-11-01 00:36:27 +08:00
|
|
|
endif()
|
|
|
|
endif()
|
2012-03-29 20:32:54 +08:00
|
|
|
|
2011-11-12 21:11:27 +08:00
|
|
|
set(SPARSE_LIBS " ")
|
|
|
|
|
2021-02-24 12:16:52 +08:00
|
|
|
find_package(CHOLMOD)
|
2022-09-03 00:43:14 +08:00
|
|
|
if(CHOLMOD_FOUND AND EIGEN_BUILD_BLAS AND EIGEN_BUILD_LAPACK)
|
2011-11-12 21:11:27 +08:00
|
|
|
add_definitions("-DEIGEN_CHOLMOD_SUPPORT")
|
|
|
|
include_directories(${CHOLMOD_INCLUDES})
|
2014-03-13 04:33:45 +08:00
|
|
|
set(SPARSE_LIBS ${SPARSE_LIBS} ${CHOLMOD_LIBRARIES} ${EIGEN_BLAS_LIBRARIES} ${EIGEN_LAPACK_LIBRARIES})
|
|
|
|
set(CHOLMOD_ALL_LIBS ${CHOLMOD_LIBRARIES} ${EIGEN_BLAS_LIBRARIES} ${EIGEN_LAPACK_LIBRARIES})
|
2021-02-24 12:16:52 +08:00
|
|
|
ei_add_property(EIGEN_TESTED_BACKENDS "CHOLMOD, ")
|
2023-12-12 05:03:09 +08:00
|
|
|
|
2022-09-03 00:43:14 +08:00
|
|
|
ei_add_test(cholmod_support "" "${CHOLMOD_ALL_LIBS}")
|
2011-11-12 21:11:27 +08:00
|
|
|
else()
|
2021-02-24 12:16:52 +08:00
|
|
|
ei_add_property(EIGEN_MISSING_BACKENDS "CHOLMOD, ")
|
2011-11-12 21:11:27 +08:00
|
|
|
endif()
|
|
|
|
|
2021-02-24 12:16:52 +08:00
|
|
|
find_package(UMFPACK)
|
2022-09-03 00:43:14 +08:00
|
|
|
if(UMFPACK_FOUND AND EIGEN_BUILD_BLAS)
|
2011-11-12 21:11:27 +08:00
|
|
|
add_definitions("-DEIGEN_UMFPACK_SUPPORT")
|
|
|
|
include_directories(${UMFPACK_INCLUDES})
|
2014-03-13 04:33:45 +08:00
|
|
|
set(SPARSE_LIBS ${SPARSE_LIBS} ${UMFPACK_LIBRARIES} ${EIGEN_BLAS_LIBRARIES})
|
|
|
|
set(UMFPACK_ALL_LIBS ${UMFPACK_LIBRARIES} ${EIGEN_BLAS_LIBRARIES})
|
2021-02-24 12:16:52 +08:00
|
|
|
ei_add_property(EIGEN_TESTED_BACKENDS "UMFPACK, ")
|
2023-12-12 05:03:09 +08:00
|
|
|
|
2022-09-03 00:43:14 +08:00
|
|
|
ei_add_test(umfpack_support "" "${UMFPACK_ALL_LIBS}")
|
2011-11-12 21:11:27 +08:00
|
|
|
else()
|
2021-02-24 12:16:52 +08:00
|
|
|
ei_add_property(EIGEN_MISSING_BACKENDS "UMFPACK, ")
|
2011-11-12 21:11:27 +08:00
|
|
|
endif()
|
|
|
|
|
2017-10-05 10:01:23 +08:00
|
|
|
find_package(KLU)
|
2022-09-03 00:43:14 +08:00
|
|
|
if(KLU_FOUND AND EIGEN_BUILD_BLAS)
|
2017-10-05 10:01:23 +08:00
|
|
|
add_definitions("-DEIGEN_KLU_SUPPORT")
|
|
|
|
include_directories(${KLU_INCLUDES})
|
|
|
|
set(SPARSE_LIBS ${SPARSE_LIBS} ${KLU_LIBRARIES} ${EIGEN_BLAS_LIBRARIES})
|
|
|
|
set(KLU_ALL_LIBS ${KLU_LIBRARIES} ${EIGEN_BLAS_LIBRARIES})
|
|
|
|
ei_add_property(EIGEN_TESTED_BACKENDS "KLU, ")
|
2023-12-12 05:03:09 +08:00
|
|
|
|
2022-09-03 00:43:14 +08:00
|
|
|
ei_add_test(klu_support "" "${KLU_ALL_LIBS}")
|
2017-10-05 10:01:23 +08:00
|
|
|
else()
|
|
|
|
ei_add_property(EIGEN_MISSING_BACKENDS "KLU, ")
|
|
|
|
endif()
|
|
|
|
|
2015-11-30 21:48:11 +08:00
|
|
|
find_package(SuperLU 4.0)
|
2022-09-03 00:43:14 +08:00
|
|
|
if(SuperLU_FOUND AND EIGEN_BUILD_BLAS)
|
2011-11-12 21:11:27 +08:00
|
|
|
add_definitions("-DEIGEN_SUPERLU_SUPPORT")
|
|
|
|
include_directories(${SUPERLU_INCLUDES})
|
2014-03-13 04:33:45 +08:00
|
|
|
set(SPARSE_LIBS ${SPARSE_LIBS} ${SUPERLU_LIBRARIES} ${EIGEN_BLAS_LIBRARIES})
|
|
|
|
set(SUPERLU_ALL_LIBS ${SUPERLU_LIBRARIES} ${EIGEN_BLAS_LIBRARIES})
|
2011-11-12 21:11:27 +08:00
|
|
|
ei_add_property(EIGEN_TESTED_BACKENDS "SuperLU, ")
|
2023-12-12 05:03:09 +08:00
|
|
|
|
2022-09-03 00:43:14 +08:00
|
|
|
ei_add_test(superlu_support "" "${SUPERLU_ALL_LIBS}")
|
2011-11-12 21:11:27 +08:00
|
|
|
else()
|
|
|
|
ei_add_property(EIGEN_MISSING_BACKENDS "SuperLU, ")
|
|
|
|
endif()
|
|
|
|
|
2012-03-09 01:59:08 +08:00
|
|
|
|
2018-05-30 02:49:25 +08:00
|
|
|
find_package(PASTIX QUIET COMPONENTS METIS SEQ)
|
2017-04-14 16:22:12 +08:00
|
|
|
# check that the PASTIX found is a version without MPI
|
|
|
|
find_path(PASTIX_pastix_nompi.h_INCLUDE_DIRS
|
|
|
|
NAMES pastix_nompi.h
|
|
|
|
HINTS ${PASTIX_INCLUDE_DIRS}
|
|
|
|
)
|
|
|
|
if (NOT PASTIX_pastix_nompi.h_INCLUDE_DIRS)
|
|
|
|
message(STATUS "A version of Pastix has been found but pastix_nompi.h does not exist in the include directory."
|
|
|
|
" Because Eigen tests require a version without MPI, we disable the Pastix backend.")
|
|
|
|
endif()
|
|
|
|
if(PASTIX_FOUND AND PASTIX_pastix_nompi.h_INCLUDE_DIRS)
|
2012-03-09 01:59:08 +08:00
|
|
|
add_definitions("-DEIGEN_PASTIX_SUPPORT")
|
2017-04-14 16:22:12 +08:00
|
|
|
include_directories(${PASTIX_INCLUDE_DIRS_DEP})
|
2012-03-09 01:59:08 +08:00
|
|
|
if(SCOTCH_FOUND)
|
2017-04-14 16:22:12 +08:00
|
|
|
include_directories(${SCOTCH_INCLUDE_DIRS})
|
2012-03-09 01:59:08 +08:00
|
|
|
set(PASTIX_LIBRARIES ${PASTIX_LIBRARIES} ${SCOTCH_LIBRARIES})
|
|
|
|
elseif(METIS_FOUND)
|
2017-04-14 16:22:12 +08:00
|
|
|
include_directories(${METIS_INCLUDE_DIRS})
|
2012-03-09 01:59:08 +08:00
|
|
|
set(PASTIX_LIBRARIES ${PASTIX_LIBRARIES} ${METIS_LIBRARIES})
|
2019-11-01 00:36:27 +08:00
|
|
|
else()
|
2012-03-09 01:59:08 +08:00
|
|
|
ei_add_property(EIGEN_MISSING_BACKENDS "PaStiX, ")
|
2019-11-01 00:36:27 +08:00
|
|
|
endif()
|
2017-04-14 16:22:12 +08:00
|
|
|
set(SPARSE_LIBS ${SPARSE_LIBS} ${PASTIX_LIBRARIES_DEP} ${ORDERING_LIBRARIES})
|
|
|
|
set(PASTIX_ALL_LIBS ${PASTIX_LIBRARIES_DEP})
|
2012-03-09 01:59:08 +08:00
|
|
|
ei_add_property(EIGEN_TESTED_BACKENDS "PaStiX, ")
|
|
|
|
else()
|
|
|
|
ei_add_property(EIGEN_MISSING_BACKENDS "PaStiX, ")
|
|
|
|
endif()
|
|
|
|
|
2013-01-21 22:36:18 +08:00
|
|
|
if(METIS_FOUND)
|
|
|
|
add_definitions("-DEIGEN_METIS_SUPPORT")
|
2017-04-14 16:22:12 +08:00
|
|
|
include_directories(${METIS_INCLUDE_DIRS})
|
2013-01-21 22:36:18 +08:00
|
|
|
ei_add_property(EIGEN_TESTED_BACKENDS "METIS, ")
|
|
|
|
else()
|
|
|
|
ei_add_property(EIGEN_MISSING_BACKENDS "METIS, ")
|
|
|
|
endif()
|
|
|
|
|
2012-11-12 22:20:37 +08:00
|
|
|
find_package(SPQR)
|
2022-09-03 00:43:14 +08:00
|
|
|
if(SPQR_FOUND AND CHOLMOD_FOUND AND EIGEN_BUILD_BLAS AND EIGEN_BUILD_LAPACK AND (EIGEN_Fortran_COMPILER_WORKS OR LAPACK_FOUND) )
|
2014-03-13 04:33:45 +08:00
|
|
|
add_definitions("-DEIGEN_SPQR_SUPPORT")
|
|
|
|
include_directories(${SPQR_INCLUDES})
|
|
|
|
set(SPQR_ALL_LIBS ${SPQR_LIBRARIES} ${CHOLMOD_LIBRARIES} ${EIGEN_LAPACK_LIBRARIES} ${EIGEN_BLAS_LIBRARIES} ${LAPACK_LIBRARIES})
|
|
|
|
set(SPARSE_LIBS ${SPARSE_LIBS} ${SPQR_ALL_LIBS})
|
|
|
|
ei_add_property(EIGEN_TESTED_BACKENDS "SPQR, ")
|
|
|
|
else()
|
|
|
|
ei_add_property(EIGEN_MISSING_BACKENDS "SPQR, ")
|
2012-11-12 22:20:37 +08:00
|
|
|
endif()
|
|
|
|
|
2022-03-08 08:09:18 +08:00
|
|
|
find_package(Accelerate)
|
|
|
|
if(Accelerate_FOUND)
|
|
|
|
add_definitions("-DEIGEN_ACCELERATE_SUPPORT")
|
|
|
|
include_directories(${Accelerate_INCLUDES})
|
|
|
|
set(SPARSE_LIBS ${SPARSE_LIBS} ${Accelerate_LIBRARIES})
|
|
|
|
set(Accelerate_ALL_LIBS ${Accelerate_LIBRARIES})
|
|
|
|
ei_add_property(EIGEN_TESTED_BACKENDS "Accelerate, ")
|
|
|
|
else()
|
|
|
|
ei_add_property(EIGEN_MISSING_BACKENDS "Accelerate, ")
|
|
|
|
endif()
|
|
|
|
|
2009-01-23 17:50:16 +08:00
|
|
|
option(EIGEN_TEST_NOQT "Disable Qt support in unit tests" OFF)
|
|
|
|
if(NOT EIGEN_TEST_NOQT)
|
|
|
|
find_package(Qt4)
|
2011-01-14 21:30:06 +08:00
|
|
|
if(QT4_FOUND)
|
|
|
|
include(${QT_USE_FILE})
|
|
|
|
ei_add_property(EIGEN_TESTED_BACKENDS "Qt4 support, ")
|
|
|
|
else()
|
|
|
|
ei_add_property(EIGEN_MISSING_BACKENDS "Qt4 support, ")
|
|
|
|
endif()
|
2019-11-01 00:36:27 +08:00
|
|
|
endif()
|
2009-01-23 21:17:57 +08:00
|
|
|
|
2008-10-20 18:43:11 +08:00
|
|
|
if(TEST_LIB)
|
|
|
|
add_definitions("-DEIGEN_EXTERN_INSTANTIATIONS=1")
|
2019-11-01 00:36:27 +08:00
|
|
|
endif()
|
2008-10-20 18:43:11 +08:00
|
|
|
|
2013-03-20 15:40:13 +08:00
|
|
|
set_property(GLOBAL PROPERTY EIGEN_CURRENT_SUBPROJECT "Official")
|
|
|
|
add_custom_target(BuildOfficial)
|
|
|
|
|
2023-12-12 05:03:09 +08:00
|
|
|
ei_add_test(clz)
|
2015-03-19 22:10:36 +08:00
|
|
|
ei_add_test(rand)
|
2008-10-20 18:43:11 +08:00
|
|
|
ei_add_test(meta)
|
2023-05-06 00:23:34 +08:00
|
|
|
ei_add_test(maxsizevector)
|
2017-06-09 17:53:49 +08:00
|
|
|
ei_add_test(numext)
|
2008-10-20 18:43:11 +08:00
|
|
|
ei_add_test(sizeof)
|
|
|
|
ei_add_test(dynalloc)
|
|
|
|
ei_add_test(nomalloc)
|
2010-01-03 01:38:16 +08:00
|
|
|
ei_add_test(first_aligned)
|
2019-02-20 21:43:05 +08:00
|
|
|
ei_add_test(type_alias)
|
2014-03-13 03:23:44 +08:00
|
|
|
ei_add_test(nullary)
|
2008-12-23 03:17:44 +08:00
|
|
|
ei_add_test(mixingtypes)
|
2023-11-22 00:09:12 +08:00
|
|
|
ei_add_test(float_conversion)
|
2019-11-25 23:23:55 +08:00
|
|
|
ei_add_test(io)
|
2016-05-12 01:22:15 +08:00
|
|
|
ei_add_test(packetmath "-DEIGEN_FAST_MATH=1")
|
2009-01-08 06:20:03 +08:00
|
|
|
ei_add_test(vectorization_logic)
|
2008-10-20 18:43:11 +08:00
|
|
|
ei_add_test(basicstuff)
|
2022-12-21 02:06:03 +08:00
|
|
|
ei_add_test(constexpr)
|
2017-02-17 21:10:57 +08:00
|
|
|
ei_add_test(constructor)
|
2008-10-20 18:43:11 +08:00
|
|
|
ei_add_test(linearstructure)
|
2010-04-29 06:51:38 +08:00
|
|
|
ei_add_test(integer_types)
|
2009-11-20 22:39:38 +08:00
|
|
|
ei_add_test(unalignedcount)
|
2020-10-09 23:49:07 +08:00
|
|
|
if(NOT EIGEN_TEST_NO_EXCEPTIONS AND NOT EIGEN_TEST_OPENMP)
|
2014-07-22 19:16:44 +08:00
|
|
|
ei_add_test(exceptions)
|
|
|
|
endif()
|
2009-02-12 23:18:59 +08:00
|
|
|
ei_add_test(redux)
|
2009-09-17 02:18:30 +08:00
|
|
|
ei_add_test(visitor)
|
2010-02-26 22:03:13 +08:00
|
|
|
ei_add_test(block)
|
2010-04-23 02:11:18 +08:00
|
|
|
ei_add_test(corners)
|
2017-01-24 17:55:12 +08:00
|
|
|
ei_add_test(symbolic_index)
|
2017-01-06 18:59:08 +08:00
|
|
|
ei_add_test(indexed_view)
|
2017-01-29 21:57:45 +08:00
|
|
|
ei_add_test(reshape)
|
2014-03-13 03:23:44 +08:00
|
|
|
ei_add_test(swap)
|
|
|
|
ei_add_test(resize)
|
|
|
|
ei_add_test(conservative_resize)
|
2008-10-20 18:43:11 +08:00
|
|
|
ei_add_test(product_small)
|
2009-11-12 05:11:33 +08:00
|
|
|
ei_add_test(product_large)
|
|
|
|
ei_add_test(product_extra)
|
2009-06-29 03:27:37 +08:00
|
|
|
ei_add_test(diagonalmatrices)
|
2022-09-09 04:44:40 +08:00
|
|
|
ei_add_test(skew_symmetric_matrix3)
|
2008-10-20 18:43:11 +08:00
|
|
|
ei_add_test(adjoint)
|
2010-02-26 22:03:13 +08:00
|
|
|
ei_add_test(diagonal)
|
2008-10-20 18:43:11 +08:00
|
|
|
ei_add_test(miscmatrices)
|
|
|
|
ei_add_test(commainitializer)
|
|
|
|
ei_add_test(smallvectors)
|
2013-07-11 05:26:35 +08:00
|
|
|
ei_add_test(mapped_matrix)
|
2010-02-27 09:12:51 +08:00
|
|
|
ei_add_test(mapstride)
|
2024-03-12 03:08:30 +08:00
|
|
|
ei_add_test(unaryview)
|
2011-02-03 23:05:45 +08:00
|
|
|
ei_add_test(mapstaticmethods)
|
2018-09-21 00:07:32 +08:00
|
|
|
ei_add_test(array_cwise)
|
2024-03-28 12:26:55 +08:00
|
|
|
ei_add_test(matrix_cwise)
|
2010-01-19 05:54:20 +08:00
|
|
|
ei_add_test(array_for_matrix)
|
2009-03-05 18:25:22 +08:00
|
|
|
ei_add_test(array_replicate)
|
|
|
|
ei_add_test(array_reverse)
|
2013-02-26 22:10:00 +08:00
|
|
|
ei_add_test(ref)
|
2015-06-10 16:09:04 +08:00
|
|
|
ei_add_test(is_same_dense)
|
2008-10-20 18:43:11 +08:00
|
|
|
ei_add_test(triangular)
|
2010-05-19 22:35:34 +08:00
|
|
|
ei_add_test(selfadjoint)
|
2009-11-12 05:11:33 +08:00
|
|
|
ei_add_test(product_selfadjoint)
|
|
|
|
ei_add_test(product_symm)
|
|
|
|
ei_add_test(product_syrk)
|
|
|
|
ei_add_test(product_trmv)
|
|
|
|
ei_add_test(product_trmm)
|
2009-12-23 18:48:53 +08:00
|
|
|
ei_add_test(product_trsolve)
|
2010-11-11 01:58:55 +08:00
|
|
|
ei_add_test(product_mmtr)
|
2009-11-12 05:11:33 +08:00
|
|
|
ei_add_test(product_notemporary)
|
2023-11-14 03:34:23 +08:00
|
|
|
ei_add_test(product_threaded "-pthread" "${CMAKE_THREAD_LIBS_INIT}")
|
2015-07-23 23:47:00 +08:00
|
|
|
ei_add_test(stable_norm)
|
2014-03-13 03:23:44 +08:00
|
|
|
ei_add_test(permutationmatrices)
|
2009-07-15 05:27:37 +08:00
|
|
|
ei_add_test(bandmatrix)
|
2011-12-02 01:17:19 +08:00
|
|
|
ei_add_test(cholesky)
|
2009-11-12 05:11:33 +08:00
|
|
|
ei_add_test(lu)
|
2008-10-20 18:43:11 +08:00
|
|
|
ei_add_test(determinant)
|
2009-11-12 05:11:33 +08:00
|
|
|
ei_add_test(inverse)
|
2008-10-20 18:43:11 +08:00
|
|
|
ei_add_test(qr)
|
2009-08-24 06:04:33 +08:00
|
|
|
ei_add_test(qr_colpivoting)
|
|
|
|
ei_add_test(qr_fullpivoting)
|
2010-01-15 11:30:58 +08:00
|
|
|
ei_add_test(upperbidiagonalization)
|
2010-04-02 21:32:20 +08:00
|
|
|
ei_add_test(hessenberg)
|
|
|
|
ei_add_test(schur_real)
|
|
|
|
ei_add_test(schur_complex)
|
2011-12-02 01:17:19 +08:00
|
|
|
ei_add_test(eigensolver_selfadjoint)
|
|
|
|
ei_add_test(eigensolver_generic)
|
2009-09-01 22:20:56 +08:00
|
|
|
ei_add_test(eigensolver_complex)
|
2012-07-27 02:15:17 +08:00
|
|
|
ei_add_test(real_qz)
|
|
|
|
ei_add_test(eigensolver_generalized_real)
|
2010-10-12 21:12:36 +08:00
|
|
|
ei_add_test(jacobi)
|
2009-11-12 05:11:33 +08:00
|
|
|
ei_add_test(jacobisvd)
|
2014-10-29 18:29:33 +08:00
|
|
|
ei_add_test(bdcsvd)
|
2009-08-03 22:06:57 +08:00
|
|
|
ei_add_test(householder)
|
2014-07-31 19:43:19 +08:00
|
|
|
ei_add_test(geo_orthomethods)
|
|
|
|
ei_add_test(geo_quaternion)
|
|
|
|
ei_add_test(geo_eulerangles)
|
|
|
|
ei_add_test(geo_parametrizedline)
|
|
|
|
ei_add_test(geo_alignedbox)
|
2014-07-31 22:24:29 +08:00
|
|
|
ei_add_test(geo_hyperplane)
|
|
|
|
ei_add_test(geo_transformations)
|
|
|
|
ei_add_test(geo_homogeneous)
|
2014-07-31 19:43:19 +08:00
|
|
|
ei_add_test(stdvector)
|
|
|
|
ei_add_test(stdvector_overload)
|
|
|
|
ei_add_test(stdlist)
|
2016-02-04 01:07:25 +08:00
|
|
|
ei_add_test(stdlist_overload)
|
2014-07-31 19:43:19 +08:00
|
|
|
ei_add_test(stddeque)
|
2016-02-04 01:07:25 +08:00
|
|
|
ei_add_test(stddeque_overload)
|
2014-07-31 19:43:19 +08:00
|
|
|
ei_add_test(sparse_basic)
|
2015-03-19 22:11:05 +08:00
|
|
|
ei_add_test(sparse_block)
|
2014-07-31 19:43:19 +08:00
|
|
|
ei_add_test(sparse_vector)
|
|
|
|
ei_add_test(sparse_product)
|
2015-02-08 05:04:18 +08:00
|
|
|
ei_add_test(sparse_ref)
|
2014-07-31 19:43:19 +08:00
|
|
|
ei_add_test(sparse_solvers)
|
|
|
|
ei_add_test(sparse_permutations)
|
|
|
|
ei_add_test(simplicial_cholesky)
|
|
|
|
ei_add_test(conjugate_gradient)
|
2015-10-08 17:32:46 +08:00
|
|
|
ei_add_test(incomplete_cholesky)
|
2014-07-31 19:43:19 +08:00
|
|
|
ei_add_test(bicgstab)
|
2015-03-04 16:34:27 +08:00
|
|
|
ei_add_test(lscg)
|
2014-07-31 19:43:19 +08:00
|
|
|
ei_add_test(sparselu)
|
|
|
|
ei_add_test(sparseqr)
|
2014-03-13 03:23:44 +08:00
|
|
|
ei_add_test(umeyama)
|
2010-02-09 21:07:37 +08:00
|
|
|
ei_add_test(nesting_ops "${CMAKE_CXX_FLAGS_DEBUG}")
|
2019-01-18 01:27:25 +08:00
|
|
|
ei_add_test(nestbyvalue)
|
2011-02-01 20:46:02 +08:00
|
|
|
ei_add_test(zerosized)
|
2011-03-10 22:44:59 +08:00
|
|
|
ei_add_test(dontalign)
|
2012-06-22 15:39:35 +08:00
|
|
|
ei_add_test(evaluators)
|
2014-07-22 19:16:44 +08:00
|
|
|
if(NOT EIGEN_TEST_NO_EXCEPTIONS)
|
|
|
|
ei_add_test(sizeoverflow)
|
|
|
|
endif()
|
2009-11-23 23:13:21 +08:00
|
|
|
ei_add_test(prec_inverse_4x4)
|
2011-11-19 00:10:27 +08:00
|
|
|
ei_add_test(vectorwiseop)
|
2013-04-16 21:10:40 +08:00
|
|
|
ei_add_test(special_numbers)
|
2013-08-03 01:59:43 +08:00
|
|
|
ei_add_test(rvalue_types)
|
2013-08-11 01:13:46 +08:00
|
|
|
ei_add_test(dense_storage)
|
2015-04-16 19:25:20 +08:00
|
|
|
ei_add_test(ctorleak)
|
2016-07-04 21:13:35 +08:00
|
|
|
ei_add_test(inplace_decomposition)
|
2016-07-22 20:34:19 +08:00
|
|
|
ei_add_test(half_float)
|
2020-06-21 03:16:24 +08:00
|
|
|
ei_add_test(bfloat16_float)
|
2016-07-25 20:25:56 +08:00
|
|
|
ei_add_test(array_of_string)
|
2018-06-08 23:11:45 +08:00
|
|
|
ei_add_test(num_dimensions)
|
2018-10-02 05:21:37 +08:00
|
|
|
ei_add_test(stl_iterators)
|
2020-05-20 03:24:11 +08:00
|
|
|
ei_add_test(blasutil)
|
2021-08-24 00:00:05 +08:00
|
|
|
ei_add_test(random_matrix)
|
2021-08-26 02:02:42 +08:00
|
|
|
ei_add_test(initializer_list_construction)
|
|
|
|
ei_add_test(diagonal_matrix_variadic_ctor)
|
2021-08-27 05:35:12 +08:00
|
|
|
ei_add_test(serializer)
|
2021-08-27 04:05:23 +08:00
|
|
|
ei_add_test(tuple_test)
|
2023-05-06 00:23:34 +08:00
|
|
|
ei_add_test(threads_eventcount "-pthread" "${CMAKE_THREAD_LIBS_INIT}")
|
|
|
|
ei_add_test(threads_runqueue "-pthread" "${CMAKE_THREAD_LIBS_INIT}")
|
|
|
|
ei_add_test(threads_non_blocking_thread_pool "-pthread" "${CMAKE_THREAD_LIBS_INIT}")
|
2016-05-18 20:03:03 +08:00
|
|
|
add_executable(bug1213 bug1213.cpp bug1213_main.cpp)
|
|
|
|
|
2015-10-27 23:44:45 +08:00
|
|
|
check_cxx_compiler_flag("-ffast-math" COMPILER_SUPPORT_FASTMATH)
|
|
|
|
if(COMPILER_SUPPORT_FASTMATH)
|
|
|
|
set(EIGEN_FASTMATH_FLAGS "-ffast-math")
|
|
|
|
else()
|
|
|
|
check_cxx_compiler_flag("/fp:fast" COMPILER_SUPPORT_FPFAST)
|
|
|
|
if(COMPILER_SUPPORT_FPFAST)
|
|
|
|
set(EIGEN_FASTMATH_FLAGS "/fp:fast")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2021-12-10 07:09:56 +08:00
|
|
|
ei_add_test(fastmath "${EIGEN_FASTMATH_FLAGS}")
|
2015-10-27 23:44:45 +08:00
|
|
|
|
2014-03-13 03:23:44 +08:00
|
|
|
# # ei_add_test(denseLM)
|
2012-03-09 01:59:08 +08:00
|
|
|
|
2013-03-20 15:40:13 +08:00
|
|
|
if(QT4_FOUND)
|
|
|
|
ei_add_test(qtvector "" "${QT_QTCORE_LIBRARY}")
|
2019-11-01 00:36:27 +08:00
|
|
|
endif()
|
2013-03-20 15:40:13 +08:00
|
|
|
|
2011-12-11 02:32:17 +08:00
|
|
|
if(PARDISO_FOUND)
|
|
|
|
ei_add_test(pardiso_support "" "${PARDISO_ALL_LIBS}")
|
|
|
|
endif()
|
2011-11-12 21:11:27 +08:00
|
|
|
|
2012-03-09 01:59:08 +08:00
|
|
|
if(PASTIX_FOUND AND (SCOTCH_FOUND OR METIS_FOUND))
|
|
|
|
ei_add_test(pastix_support "" "${PASTIX_ALL_LIBS}")
|
|
|
|
endif()
|
|
|
|
|
2022-09-03 00:43:14 +08:00
|
|
|
if(SPQR_FOUND AND CHOLMOD_FOUND AND EIGEN_BUILD_BLAS AND EIGEN_BUILD_LAPACK)
|
2012-11-12 22:20:37 +08:00
|
|
|
ei_add_test(spqr_support "" "${SPQR_ALL_LIBS}")
|
|
|
|
endif()
|
|
|
|
|
2013-01-21 22:36:18 +08:00
|
|
|
if(METIS_FOUND)
|
|
|
|
ei_add_test(metis_support "" "${METIS_LIBRARIES}")
|
|
|
|
endif()
|
2012-12-07 22:48:21 +08:00
|
|
|
|
2022-03-08 08:09:18 +08:00
|
|
|
if(Accelerate_FOUND)
|
|
|
|
ei_add_test(accelerate_support "" "${Accelerate_ALL_LIBS}")
|
|
|
|
endif()
|
|
|
|
|
2010-04-29 20:04:42 +08:00
|
|
|
string(TOLOWER "${CMAKE_CXX_COMPILER}" cmake_cxx_compiler_tolower)
|
|
|
|
if(cmake_cxx_compiler_tolower MATCHES "qcc")
|
|
|
|
set(CXX_IS_QCC "ON")
|
|
|
|
endif()
|
|
|
|
|
2009-02-28 00:19:13 +08:00
|
|
|
ei_add_property(EIGEN_TESTING_SUMMARY "CXX: ${CMAKE_CXX_COMPILER}\n")
|
2010-04-29 20:04:42 +08:00
|
|
|
if(CMAKE_COMPILER_IS_GNUCXX AND NOT CXX_IS_QCC)
|
2009-01-12 21:40:02 +08:00
|
|
|
execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version COMMAND head -n 1 OUTPUT_VARIABLE EIGEN_CXX_VERSION_STRING OUTPUT_STRIP_TRAILING_WHITESPACE)
|
2009-02-28 00:19:13 +08:00
|
|
|
ei_add_property(EIGEN_TESTING_SUMMARY "CXX_VERSION: ${EIGEN_CXX_VERSION_STRING}\n")
|
2010-04-29 20:04:42 +08:00
|
|
|
endif()
|
2009-02-28 00:19:13 +08:00
|
|
|
ei_add_property(EIGEN_TESTING_SUMMARY "CXX_FLAGS: ${CMAKE_CXX_FLAGS}\n")
|
2020-07-01 01:18:54 +08:00
|
|
|
if (EIGEN_TEST_CUSTOM_CXX_FLAGS)
|
|
|
|
ei_add_property(EIGEN_TESTING_SUMMARY "Custom CXX flags: ${EIGEN_TEST_CUSTOM_CXX_FLAGS}\n")
|
|
|
|
endif()
|
2009-02-28 00:19:13 +08:00
|
|
|
ei_add_property(EIGEN_TESTING_SUMMARY "Sparse lib flags: ${SPARSE_LIBS}\n")
|
2011-01-19 23:10:54 +08:00
|
|
|
|
|
|
|
option(EIGEN_TEST_EIGEN2 "Run whole Eigen2 test suite against EIGEN2_SUPPORT" OFF)
|
2014-07-09 22:54:15 +08:00
|
|
|
mark_as_advanced(EIGEN_TEST_EIGEN2)
|
2011-01-19 23:10:54 +08:00
|
|
|
if(EIGEN_TEST_EIGEN2)
|
2014-07-01 22:58:11 +08:00
|
|
|
message(WARNING "The Eigen2 test suite has been removed")
|
2011-01-19 23:10:54 +08:00
|
|
|
endif()
|
2013-11-05 22:41:45 +08:00
|
|
|
|
2016-07-20 21:20:14 +08:00
|
|
|
# boost MP unit test
|
2019-01-17 18:54:37 +08:00
|
|
|
find_package(Boost 1.53.0)
|
2016-07-20 21:20:14 +08:00
|
|
|
if(Boost_FOUND)
|
|
|
|
include_directories(${Boost_INCLUDE_DIRS})
|
|
|
|
ei_add_test(boostmultiprec "" "${Boost_LIBRARIES}")
|
|
|
|
ei_add_property(EIGEN_TESTED_BACKENDS "Boost.Multiprecision, ")
|
|
|
|
else()
|
|
|
|
ei_add_property(EIGEN_MISSING_BACKENDS "Boost.Multiprecision, ")
|
|
|
|
endif()
|
|
|
|
|
2013-11-05 22:41:45 +08:00
|
|
|
|
2016-04-07 00:35:23 +08:00
|
|
|
# CUDA unit tests
|
|
|
|
option(EIGEN_TEST_CUDA "Enable CUDA support in unit tests" OFF)
|
2016-04-09 04:16:08 +08:00
|
|
|
option(EIGEN_TEST_CUDA_CLANG "Use clang instead of nvcc to compile the CUDA tests" OFF)
|
|
|
|
|
|
|
|
if(EIGEN_TEST_CUDA_CLANG AND NOT CMAKE_CXX_COMPILER MATCHES "clang")
|
|
|
|
message(WARNING "EIGEN_TEST_CUDA_CLANG is set, but CMAKE_CXX_COMPILER does not appear to be clang.")
|
|
|
|
endif()
|
|
|
|
|
2021-09-25 05:43:59 +08:00
|
|
|
find_package(CUDA 9.0)
|
|
|
|
if(CUDA_FOUND AND EIGEN_TEST_CUDA)
|
|
|
|
# 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
|
|
|
|
string(REPLACE "-pedantic" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
|
|
|
string(REPLACE "-Wundef" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
|
|
|
string(REPLACE "-Wnon-virtual-dtor" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
2023-12-12 05:03:09 +08:00
|
|
|
string(REPLACE "-fno-check-new" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
2016-04-09 04:16:08 +08:00
|
|
|
|
|
|
|
if(EIGEN_TEST_CUDA_CLANG)
|
2019-06-01 05:08:34 +08:00
|
|
|
string(APPEND CMAKE_CXX_FLAGS " --cuda-path=${CUDA_TOOLKIT_ROOT_DIR}")
|
|
|
|
foreach(GPU IN LISTS EIGEN_CUDA_COMPUTE_ARCH)
|
|
|
|
string(APPEND CMAKE_CXX_FLAGS " --cuda-gpu-arch=sm_${GPU}")
|
|
|
|
endforeach()
|
2021-09-25 11:15:55 +08:00
|
|
|
string(APPEND CMAKE_CXX_FLAGS " ${EIGEN_CUDA_CXX_FLAGS}")
|
2020-12-23 14:49:06 +08:00
|
|
|
else()
|
2021-09-25 05:43:59 +08:00
|
|
|
set(CUDA_PROPAGATE_HOST_FLAGS OFF)
|
|
|
|
set(NVCC_ARCH_FLAGS)
|
2021-09-25 11:48:01 +08:00
|
|
|
# Define an -arch=sm_<arch>, otherwise if GPU does not exactly match one of
|
|
|
|
# those in the arch list for -gencode, the kernels will fail to run with
|
|
|
|
# cudaErrorNoKernelImageForDevice
|
|
|
|
# This can happen with newer cards (e.g. sm_75) and compiling with older
|
|
|
|
# versions of nvcc (e.g. 9.2) that do not support their specific arch.
|
|
|
|
list(LENGTH EIGEN_CUDA_COMPUTE_ARCH EIGEN_CUDA_COMPUTE_ARCH_SIZE)
|
|
|
|
if(EIGEN_CUDA_COMPUTE_ARCH_SIZE)
|
|
|
|
list(GET EIGEN_CUDA_COMPUTE_ARCH 0 EIGEN_CUDA_COMPUTE_DEFAULT)
|
|
|
|
set(NVCC_ARCH_FLAGS " -arch=sm_${EIGEN_CUDA_COMPUTE_DEFAULT}")
|
|
|
|
endif()
|
2021-09-25 05:43:59 +08:00
|
|
|
foreach(ARCH IN LISTS EIGEN_CUDA_COMPUTE_ARCH)
|
|
|
|
string(APPEND NVCC_ARCH_FLAGS " -gencode arch=compute_${ARCH},code=sm_${ARCH}")
|
2020-12-23 14:49:06 +08:00
|
|
|
endforeach()
|
2021-09-25 11:15:55 +08:00
|
|
|
set(CUDA_NVCC_FLAGS "--expt-relaxed-constexpr -Xcudafe \"--display_error_number\" ${NVCC_ARCH_FLAGS} ${CUDA_NVCC_FLAGS} ${EIGEN_CUDA_CXX_FLAGS}")
|
2021-09-25 05:43:59 +08:00
|
|
|
cuda_include_directories("${CMAKE_CURRENT_BINARY_DIR}" "${CUDA_TOOLKIT_ROOT_DIR}/include")
|
2016-04-09 04:16:08 +08:00
|
|
|
endif()
|
2023-12-12 05:03:09 +08:00
|
|
|
|
2013-11-05 22:41:45 +08:00
|
|
|
set(EIGEN_ADD_TEST_FILENAME_EXTENSION "cu")
|
2023-12-12 05:03:09 +08:00
|
|
|
|
New GPU test utilities.
This introduces new functions:
```
// returns kernel(args...) running on the CPU.
Eigen::run_on_cpu(Kernel kernel, Args&&... args);
// returns kernel(args...) running on the GPU.
Eigen::run_on_gpu(Kernel kernel, Args&&... args);
Eigen::run_on_gpu_with_hint(size_t buffer_capacity_hint, Kernel kernel, Args&&... args);
// returns kernel(args...) running on the GPU if using
// a GPU compiler, or CPU otherwise.
Eigen::run(Kernel kernel, Args&&... args);
Eigen::run_with_hint(size_t buffer_capacity_hint, Kernel kernel, Args&&... args);
```
Running on the GPU is accomplished by:
- Serializing the kernel inputs on the CPU
- Transferring the inputs to the GPU
- Passing the kernel and serialized inputs to a GPU kernel
- Deserializing the inputs on the GPU
- Running `kernel(inputs...)` on the GPU
- Serializing all output parameters and the return value
- Transferring the serialized outputs back to the CPU
- Deserializing the outputs and return value on the CPU
- Returning the deserialized return value
All inputs must be serializable (currently POD types, `Eigen::Matrix`
and `Eigen::Array`). The kernel must also be POD (though usually
contains no actual data).
Tested on CUDA 9.1, 10.2, 11.3, with g++-6, g++-8, g++-10 respectively.
This MR depends on !622, !623, !624.
2021-08-27 05:48:09 +08:00
|
|
|
ei_add_test(gpu_example)
|
2018-07-11 22:39:54 +08:00
|
|
|
ei_add_test(gpu_basic)
|
2023-12-12 05:03:09 +08:00
|
|
|
|
2013-11-05 22:41:45 +08:00
|
|
|
unset(EIGEN_ADD_TEST_FILENAME_EXTENSION)
|
|
|
|
|
2019-11-01 00:36:27 +08:00
|
|
|
endif()
|
2013-11-05 22:41:45 +08:00
|
|
|
|
2014-09-23 16:25:12 +08:00
|
|
|
|
2018-06-06 22:12:58 +08:00
|
|
|
# HIP unit tests
|
|
|
|
option(EIGEN_TEST_HIP "Add HIP support." OFF)
|
|
|
|
if (EIGEN_TEST_HIP)
|
|
|
|
|
2023-10-17 04:56:35 +08:00
|
|
|
set(ROCM_PATH "/opt/rocm" CACHE STRING "Path to the ROCm installation.")
|
|
|
|
|
|
|
|
if (EXISTS ${ROCM_PATH}/hip)
|
|
|
|
set(HIP_PATH ${ROCM_PATH}/hip)
|
|
|
|
list(APPEND CMAKE_MODULE_PATH ${HIP_PATH}/cmake)
|
|
|
|
elseif (EXISTS ${ROCM_PATH}/lib/cmake/hip)
|
|
|
|
set(HIP_PATH ${ROCM_PATH})
|
|
|
|
list(APPEND CMAKE_MODULE_PATH ${HIP_PATH}/lib/cmake/hip)
|
|
|
|
else ()
|
|
|
|
message(FATAL_ERROR "EIGEN_TEST_HIP is ON, but could not find the ROCm installation under ${ROCM_PATH}")
|
|
|
|
endif()
|
2018-06-06 22:12:58 +08:00
|
|
|
|
2023-10-17 04:56:35 +08:00
|
|
|
find_package(HIP REQUIRED)
|
|
|
|
if (HIP_FOUND)
|
|
|
|
execute_process(COMMAND ${HIP_PATH}/bin/hipconfig --platform OUTPUT_VARIABLE HIP_PLATFORM)
|
2018-06-06 22:12:58 +08:00
|
|
|
|
2023-10-17 04:56:35 +08:00
|
|
|
if ((${HIP_PLATFORM} STREQUAL "hcc") OR (${HIP_PLATFORM} STREQUAL "amd"))
|
2018-06-06 22:12:58 +08:00
|
|
|
|
2023-10-17 04:56:35 +08:00
|
|
|
include_directories(${HIP_PATH}/include)
|
2018-06-06 22:12:58 +08:00
|
|
|
|
2023-10-17 04:56:35 +08:00
|
|
|
set(EIGEN_ADD_TEST_FILENAME_EXTENSION "cu")
|
|
|
|
ei_add_test(gpu_basic)
|
|
|
|
ei_add_test(gpu_example)
|
|
|
|
unset(EIGEN_ADD_TEST_FILENAME_EXTENSION)
|
2018-06-06 22:12:58 +08:00
|
|
|
|
2023-10-17 04:56:35 +08:00
|
|
|
elseif ((${HIP_PLATFORM} STREQUAL "nvcc") OR (${HIP_PLATFORM} STREQUAL "nvidia"))
|
|
|
|
message(FATAL_ERROR "HIP_PLATFORM = nvcc is not supported within Eigen")
|
|
|
|
else ()
|
|
|
|
message(FATAL_ERROR "Unknown HIP_PLATFORM = ${HIP_PLATFORM}")
|
2023-12-12 05:03:09 +08:00
|
|
|
endif()
|
2018-06-06 22:12:58 +08:00
|
|
|
endif()
|
2019-11-01 00:36:27 +08:00
|
|
|
endif()
|
2018-06-06 22:12:58 +08:00
|
|
|
|
2023-07-28 23:45:08 +08:00
|
|
|
if(EIGEN_TEST_SYCL)
|
|
|
|
set(EIGEN_SYCL ON)
|
|
|
|
include(SyclConfigureTesting)
|
|
|
|
|
|
|
|
ei_add_test(sycl_basic)
|
|
|
|
set(EIGEN_SYCL OFF)
|
|
|
|
endif()
|
|
|
|
|
2020-11-18 07:08:23 +08:00
|
|
|
cmake_dependent_option(EIGEN_TEST_BUILD_DOCUMENTATION "Test building the doxygen documentation" OFF "EIGEN_BUILD_DOC" OFF)
|
2019-11-01 00:36:37 +08:00
|
|
|
if(EIGEN_TEST_BUILD_DOCUMENTATION)
|
2015-03-27 23:36:59 +08:00
|
|
|
add_dependencies(buildtests doc)
|
2019-11-01 00:36:37 +08:00
|
|
|
endif()
|
2021-04-01 06:09:00 +08:00
|
|
|
|
|
|
|
# Register all smoke tests
|
|
|
|
include("EigenSmokeTestList")
|
|
|
|
ei_add_smoke_tests("${ei_smoke_test_list}")
|