Update cmake configuration from master

This commit is contained in:
C. Antonio Sanchez
2025-02-16 11:22:08 -08:00
parent 052d91349a
commit f1922b6dac
17 changed files with 984 additions and 777 deletions

View File

@@ -286,7 +286,6 @@ ei_add_test(special_numbers)
ei_add_test(rvalue_types)
ei_add_test(dense_storage)
ei_add_test(ctorleak)
ei_add_test(mpl2only)
ei_add_test(inplace_decomposition)
ei_add_test(half_float)
ei_add_test(bfloat16_float)
@@ -311,7 +310,7 @@ else()
endif()
endif()
ei_add_test(fastmath " ${EIGEN_FASTMATH_FLAGS} ")
ei_add_test(fastmath "${EIGEN_FASTMATH_FLAGS}")
# # ei_add_test(denseLM)
@@ -396,6 +395,16 @@ if(CUDA_FOUND AND EIGEN_TEST_CUDA)
else()
set(CUDA_PROPAGATE_HOST_FLAGS OFF)
set(NVCC_ARCH_FLAGS)
# 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()
foreach(ARCH IN LISTS EIGEN_CUDA_COMPUTE_ARCH)
string(APPEND NVCC_ARCH_FLAGS " -gencode arch=compute_${ARCH},code=sm_${ARCH}")
endforeach()
@@ -416,34 +425,44 @@ endif()
option(EIGEN_TEST_HIP "Add HIP support." OFF)
if (EIGEN_TEST_HIP)
set(HIP_PATH "/opt/rocm/hip" CACHE STRING "Path to the HIP installation.")
if (EXISTS ${HIP_PATH})
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)
find_package(HIP REQUIRED)
if (HIP_FOUND)
execute_process(COMMAND ${HIP_PATH}/bin/hipconfig --platform OUTPUT_VARIABLE HIP_PLATFORM)
if ((${HIP_PLATFORM} STREQUAL "hcc") OR (${HIP_PLATFORM} STREQUAL "amd"))
include_directories(${HIP_PATH}/include)
set(EIGEN_ADD_TEST_FILENAME_EXTENSION "cu")
ei_add_test(gpu_basic)
unset(EIGEN_ADD_TEST_FILENAME_EXTENSION)
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}")
endif()
endif()
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 the specified HIP_PATH (${HIP_PATH}) does not exist")
message(FATAL_ERROR "EIGEN_TEST_HIP is ON, but could not find the ROCm installation under ${ROCM_PATH}")
endif()
find_package(HIP REQUIRED)
if (HIP_FOUND)
execute_process(COMMAND ${HIP_PATH}/bin/hipconfig --platform OUTPUT_VARIABLE HIP_PLATFORM)
if ((${HIP_PLATFORM} STREQUAL "hcc") OR (${HIP_PLATFORM} STREQUAL "amd"))
include_directories(${HIP_PATH}/include)
set(EIGEN_ADD_TEST_FILENAME_EXTENSION "cu")
ei_add_test(gpu_basic)
unset(EIGEN_ADD_TEST_FILENAME_EXTENSION)
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}")
endif()
endif()
endif()
if(EIGEN_TEST_SYCL)
set(EIGEN_SYCL ON)
include(SyclConfigureTesting)
ei_add_test(sycl_basic)
set(EIGEN_SYCL OFF)
endif()
cmake_dependent_option(EIGEN_TEST_BUILD_DOCUMENTATION "Test building the doxygen documentation" OFF "EIGEN_BUILD_DOC" OFF)