ggml-cuda: fix regex for arch list (#18371)
* ggml-cuda: fix regex for arch list * make regex exact
This commit is contained in:
parent
83b3b1c271
commit
85c40c9b02
|
|
@ -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
|
||||
if (GGML_NATIVE)
|
||||
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})
|
||||
message(STATUS "Replacing ${ARCH} with ${BASE_ARCH}a-real")
|
||||
list(APPEND PROCESSED_ARCHITECTURES "${BASE_ARCH}a-real")
|
||||
|
|
|
|||
Loading…
Reference in New Issue