Skip to content

Commit a772448

Browse files
sandrohaneaSandro Hanea
authored andcommitted
cmake: improve Vulkan cooperative matrix support checks (whisper/2966)
Co-authored-by: Sandro Hanea <[email protected]>
1 parent 1a85949 commit a772448

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

ggml/src/ggml-vulkan/CMakeLists.txt

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,14 @@ if (Vulkan_FOUND)
3636
set(GGML_VULKAN_COOPMAT_GLSLC_SUPPORT OFF CACHE INTERNAL "Whether coopmat is supported by glslc")
3737
else()
3838
message(STATUS "GL_KHR_cooperative_matrix supported by glslc")
39-
add_compile_definitions(GGML_VULKAN_COOPMAT_GLSLC_SUPPORT)
4039
set(GGML_VULKAN_COOPMAT_GLSLC_SUPPORT ON CACHE INTERNAL "Whether coopmat is supported by glslc")
4140
endif()
41+
else()
42+
message(STATUS "GL_KHR_cooperative_matrix support already defined: ${GGML_VULKAN_COOPMAT_GLSLC_SUPPORT}")
43+
endif()
44+
45+
if(GGML_VULKAN_COOPMAT_GLSLC_SUPPORT)
46+
add_compile_definitions(GGML_VULKAN_COOPMAT_GLSLC_SUPPORT)
4247
endif()
4348

4449
if(NOT DEFINED GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT)
@@ -54,9 +59,15 @@ if (Vulkan_FOUND)
5459
set(GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT OFF CACHE INTERNAL "Whether coopmat2 is supported by glslc")
5560
else()
5661
message(STATUS "GL_NV_cooperative_matrix2 supported by glslc")
57-
add_compile_definitions(GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT)
62+
5863
set(GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT ON CACHE INTERNAL "Whether coopmat2 is supported by glslc")
5964
endif()
65+
else()
66+
message(STATUS "GL_NV_cooperative_matrix2 support already defined: ${GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT}")
67+
endif()
68+
69+
if(GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT)
70+
add_compile_definitions(GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT)
6071
endif()
6172

6273
target_link_libraries(ggml-vulkan PRIVATE Vulkan::Vulkan)

0 commit comments

Comments
 (0)