Explorar el Código

cmake: improve Vulkan cooperative matrix support checks (whisper/2966)

Co-authored-by: Sandro Hanea <me@sandro.rocks>
Sandro Hanea hace 9 meses
padre
commit
a7724480fd
Se han modificado 1 ficheros con 13 adiciones y 2 borrados
  1. 13 2
      ggml/src/ggml-vulkan/CMakeLists.txt

+ 13 - 2
ggml/src/ggml-vulkan/CMakeLists.txt

@@ -36,9 +36,14 @@ if (Vulkan_FOUND)
             set(GGML_VULKAN_COOPMAT_GLSLC_SUPPORT OFF CACHE INTERNAL "Whether coopmat is supported by glslc")
             set(GGML_VULKAN_COOPMAT_GLSLC_SUPPORT OFF CACHE INTERNAL "Whether coopmat is supported by glslc")
         else()
         else()
             message(STATUS "GL_KHR_cooperative_matrix supported by glslc")
             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")
             set(GGML_VULKAN_COOPMAT_GLSLC_SUPPORT ON CACHE INTERNAL "Whether coopmat is supported by glslc")
         endif()
         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()
     endif()
 
 
     if(NOT DEFINED GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT)
     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")
             set(GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT OFF CACHE INTERNAL "Whether coopmat2 is supported by glslc")
         else()
         else()
             message(STATUS "GL_NV_cooperative_matrix2 supported by glslc")
             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")
             set(GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT ON CACHE INTERNAL "Whether coopmat2 is supported by glslc")
         endif()
         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()
     endif()
 
 
     target_link_libraries(ggml-vulkan PRIVATE Vulkan::Vulkan)
     target_link_libraries(ggml-vulkan PRIVATE Vulkan::Vulkan)