]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
cmake: improve Vulkan cooperative matrix support checks (#2966)
authorSandro Hanea <redacted>
Mon, 31 Mar 2025 10:44:36 +0000 (12:44 +0200)
committerGitHub <redacted>
Mon, 31 Mar 2025 10:44:36 +0000 (13:44 +0300)
Co-authored-by: Sandro Hanea <redacted>
ggml/src/ggml-vulkan/CMakeLists.txt

index 8ef28e2d5131497795fc1e2f5447cf99b3a747f4..251e0f2d99feb23c4d3a84d8b43f4714ed2ddef2 100644 (file)
@@ -36,9 +36,14 @@ if (Vulkan_FOUND)
             set(GGML_VULKAN_COOPMAT_GLSLC_SUPPORT OFF CACHE INTERNAL "Whether coopmat is supported by glslc")
         else()
             message(STATUS "GL_KHR_cooperative_matrix supported by glslc")
-            add_compile_definitions(GGML_VULKAN_COOPMAT_GLSLC_SUPPORT)
             set(GGML_VULKAN_COOPMAT_GLSLC_SUPPORT ON CACHE INTERNAL "Whether coopmat is supported by glslc")
         endif()
+    else()
+        message(STATUS "GL_KHR_cooperative_matrix support already defined: ${GGML_VULKAN_COOPMAT_GLSLC_SUPPORT}")
+    endif()
+
+    if(GGML_VULKAN_COOPMAT_GLSLC_SUPPORT)
+        add_compile_definitions(GGML_VULKAN_COOPMAT_GLSLC_SUPPORT)
     endif()
 
     if(NOT DEFINED GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT)
@@ -54,9 +59,15 @@ if (Vulkan_FOUND)
             set(GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT OFF CACHE INTERNAL "Whether coopmat2 is supported by glslc")
         else()
             message(STATUS "GL_NV_cooperative_matrix2 supported by glslc")
-            add_compile_definitions(GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT)
+            
             set(GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT ON CACHE INTERNAL "Whether coopmat2 is supported by glslc")
         endif()
+    else()
+        message(STATUS "GL_NV_cooperative_matrix2 support already defined: ${GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT}")
+    endif()
+
+    if(GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT)
+        add_compile_definitions(GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT)
     endif()
 
     target_link_libraries(ggml-vulkan PRIVATE Vulkan::Vulkan)