ggml-cuda: use CMAKE_CUDA_ARCHITECTURES if set when GGML_NATIVE=ON (#18413)
This commit is contained in:
parent
08566977a7
commit
4fd59e8427
|
|
@ -37,14 +37,13 @@ if (CUDAToolkit_FOUND)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
message(STATUS "Using CUDA architectures: ${CMAKE_CUDA_ARCHITECTURES}")
|
|
||||||
|
|
||||||
enable_language(CUDA)
|
enable_language(CUDA)
|
||||||
|
|
||||||
# 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 "")
|
||||||
if (CMAKE_CUDA_ARCHITECTURES_NATIVE)
|
if (NOT DEFINED CMAKE_CUDA_ARCHITECTURES AND CMAKE_CUDA_ARCHITECTURES_NATIVE)
|
||||||
set(ARCH_LIST ${CMAKE_CUDA_ARCHITECTURES_NATIVE})
|
set(ARCH_LIST ${CMAKE_CUDA_ARCHITECTURES_NATIVE})
|
||||||
else()
|
else()
|
||||||
set(ARCH_LIST ${CMAKE_CUDA_ARCHITECTURES})
|
set(ARCH_LIST ${CMAKE_CUDA_ARCHITECTURES})
|
||||||
|
|
@ -66,6 +65,7 @@ if (CUDAToolkit_FOUND)
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
|
message(STATUS "Using CUDA architectures: ${CMAKE_CUDA_ARCHITECTURES}")
|
||||||
|
|
||||||
file(GLOB GGML_HEADERS_CUDA "*.cuh")
|
file(GLOB GGML_HEADERS_CUDA "*.cuh")
|
||||||
list(APPEND GGML_HEADERS_CUDA "../../include/ggml-cuda.h")
|
list(APPEND GGML_HEADERS_CUDA "../../include/ggml-cuda.h")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue