|
@@ -44,8 +44,13 @@ if (CUDAToolkit_FOUND)
|
|
|
# Replace any 12x-real architectures with 12x{a}-real. FP4 ptx instructions are not available in just 12x
|
|
# Replace any 12x-real architectures with 12x{a}-real. FP4 ptx instructions are not available in just 12x
|
|
|
if (GGML_NATIVE)
|
|
if (GGML_NATIVE)
|
|
|
set(PROCESSED_ARCHITECTURES "")
|
|
set(PROCESSED_ARCHITECTURES "")
|
|
|
- foreach(ARCH ${CMAKE_CUDA_ARCHITECTURES_NATIVE})
|
|
|
|
|
- if(ARCH MATCHES "^12[0-9]$")
|
|
|
|
|
|
|
+ if (CMAKE_CUDA_ARCHITECTURES_NATIVE)
|
|
|
|
|
+ set(ARCH_LIST ${CMAKE_CUDA_ARCHITECTURES_NATIVE})
|
|
|
|
|
+ else()
|
|
|
|
|
+ set(ARCH_LIST ${CMAKE_CUDA_ARCHITECTURES})
|
|
|
|
|
+ endif()
|
|
|
|
|
+ foreach(ARCH ${ARCH_LIST})
|
|
|
|
|
+ if (ARCH MATCHES "^12[0-9](-real|-virtual)?$")
|
|
|
string(REGEX REPLACE "^(12[0-9]).*$" "\\1" BASE_ARCH ${ARCH})
|
|
string(REGEX REPLACE "^(12[0-9]).*$" "\\1" BASE_ARCH ${ARCH})
|
|
|
message(STATUS "Replacing ${ARCH} with ${BASE_ARCH}a-real")
|
|
message(STATUS "Replacing ${ARCH} with ${BASE_ARCH}a-real")
|
|
|
list(APPEND PROCESSED_ARCHITECTURES "${BASE_ARCH}a-real")
|
|
list(APPEND PROCESSED_ARCHITECTURES "${BASE_ARCH}a-real")
|