Skip to content

Commit

Permalink
Fixed missing code generation for older archs
Browse files Browse the repository at this point in the history
  • Loading branch information
acpopescu committed Mar 30, 2023
1 parent 8fce35b commit a3325ca
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions CMakelists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}")
Expand Down

0 comments on commit a3325ca

Please sign in to comment.