diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 2612e7abd43d..3579f32cda2d 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -182,22 +182,19 @@ set(CUDF_CUDA_FLAGS "") set(CUDF_CXX_DEFINITIONS "") set(CUDF_CUDA_DEFINITIONS "") +if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0.0) + set(DEFAULT_CUDF_LTO_ARCHITECTURE 75) +else() + set(DEFAULT_CUDF_LTO_ARCHITECTURE 70) +endif() + # LTO IR can only be linked for targets greater than or equal to its architecture. An explicit # override must therefore not exceed the architecture of any target GPU on which it will be linked. set(CUDF_LTO_ARCHITECTURE - "" - CACHE STRING "LTO fragment architecture; empty selects the minimum supported by the toolkit" + "${DEFAULT_CUDF_LTO_ARCHITECTURE}" + CACHE STRING "LTO fragment architecture" ) -if(CUDF_LTO_ARCHITECTURE STREQUAL "") - foreach(architecture IN LISTS CMAKE_CUDA_ARCHITECTURES_ALL) - string(REGEX MATCH "^[0-9]+" architecture "${architecture}") - if(architecture AND (NOT CUDF_LTO_ARCHITECTURE OR architecture LESS CUDF_LTO_ARCHITECTURE)) - set(CUDF_LTO_ARCHITECTURE "${architecture}") - endif() - endforeach() -endif() - if(NOT CUDF_LTO_ARCHITECTURE MATCHES "^[0-9]+$") message(FATAL_ERROR "CUDF_LTO_ARCHITECTURE must be a numeric architecture") endif() diff --git a/cpp/cmake/Modules/AddFragment.cmake b/cpp/cmake/Modules/AddFragment.cmake index 55c31ad6496a..a68b52830819 100644 --- a/cpp/cmake/Modules/AddFragment.cmake +++ b/cpp/cmake/Modules/AddFragment.cmake @@ -67,7 +67,7 @@ macro(add_fragment) CUDA_STANDARD 20 CUDA_STANDARD_REQUIRED ON CUDA_VISIBILITY_PRESET hidden - CUDA_ARCHITECTURES ${CUDF_LTO_ARCHITECTURE} + CUDA_ARCHITECTURES ${CUDF_LTO_ARCHITECTURE}-real ) target_link_libraries( ${OBJECT_ID}