From a3325ca5acccfb1532564b77b73e6144724bb336 Mon Sep 17 00:00:00 2001 From: Adrian Popescu Date: Thu, 30 Mar 2023 10:29:17 -0400 Subject: [PATCH] Fixed missing code generation for older archs --- CMakelists.txt | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/CMakelists.txt b/CMakelists.txt index 0edd4c032..d348131e6 100644 --- a/CMakelists.txt +++ b/CMakelists.txt @@ -20,11 +20,15 @@ endif() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:fast") if( MAKE_CUDA_BUILD ) + + set(COMPUTE_CAPABILITY_NOCUBLAST 50 52 60 61 70 72) + set(COMPUTE_CAPABILITY_KEPLER 35 37) + set(COMPUTE_CAPABILITY_ADA_HOPPER 89 90) + # Later versions of CUDA support the new architectures set(CC_CUDA10x 75) set(CC_CUDA110 75 80) set(CC_CUDA11x 75 80 86) - set(CC_CUDA12x 89 90) option(NO_CUBLASLT "Don't use CUBLAST" OFF) set(CUDA_TARGET_ARCH_FEATURE_LEVEL "11.x" CACHE STRING @@ -45,15 +49,28 @@ if( MAKE_CUDA_BUILD ) if(${CUDA_TARGET_ARCH_FEATURE_LEVEL} STREQUAL "11.0") set(CMAKE_CUDA_ARCHITECTURES ${CC_CUDA110}) + if(NO_CUBLASLT) + list(APPEND CMAKE_CUDA_ARCHITECTURES ${COMPUTE_CAPABILITY_NOCUBLAST} ${COMPUTE_CAPABILITY_KEPLER}) + endif() + elseif(${CUDA_VERSION_TARGET_FEATURE_MAJOR} STREQUAL "11") set(CMAKE_CUDA_ARCHITECTURES ${CC_CUDA11x}) + if(NO_CUBLASLT) + list(APPEND CMAKE_CUDA_ARCHITECTURES ${COMPUTE_CAPABILITY_NOCUBLAST} ${COMPUTE_CAPABILITY_KEPLER}) + endif() elseif(${CUDA_VERSION_TARGET_FEATURE_MAJOR} STREQUAL "12") - set(CMAKE_CUDA_ARCHITECTURES ${CC_CUDA12x}) + set(CMAKE_CUDA_ARCHITECTURES ${CC_CUDA11x}) + if(NO_CUBLASLT) + list(APPEND CMAKE_CUDA_ARCHITECTURES ${COMPUTE_CAPABILITY_NOCUBLAST} ${COMPUTE_CAPABILITY_ADA_HOPPER}) + endif() else() set(CMAKE_CUDA_ARCHITECTURES ${CC_CUDA10x}) + list(APPEND CMAKE_CUDA_ARCHITECTURES ${COMPUTE_CAPABILITY_NOCUBLAST} ${COMPUTE_CAPABILITY_KEPLER}) set(NO_CUBLASLT ON) endif() + + message(CONFIGURE_LOG " CUDA Targeting feature level ${CUDA_TARGET_ARCH_FEATURE_LEVEL}, with architectures ${CMAKE_CUDA_ARCHITECTURES}") set (LIBBITSANDBYTESNAME "libbitsandbytes_cuda${CUDA_VERSION_DLLNAME}")