cmake: remove caching from vulkan coopmat checks (llama/12719)

This commit is contained in:
bandoti 2025-04-02 14:56:26 -03:00 committed by Georgi Gerganov
parent 2105b110d3
commit 6e532c7187

View File

@ -23,7 +23,6 @@ if (Vulkan_FOUND)
../../include/ggml-vulkan.h ../../include/ggml-vulkan.h
) )
if(NOT DEFINED GGML_VULKAN_COOPMAT_GLSLC_SUPPORT)
# Compile a test shader to determine whether GL_KHR_cooperative_matrix is supported. # Compile a test shader to determine whether GL_KHR_cooperative_matrix is supported.
# If it's not, there will be an error to stderr. # If it's not, there will be an error to stderr.
# If it's supported, set a define to indicate that we should compile those shaders # If it's supported, set a define to indicate that we should compile those shaders
@ -33,20 +32,13 @@ if (Vulkan_FOUND)
if (${glslc_error} MATCHES ".*extension not supported: GL_KHR_cooperative_matrix.*") if (${glslc_error} MATCHES ".*extension not supported: GL_KHR_cooperative_matrix.*")
message(STATUS "GL_KHR_cooperative_matrix not supported by glslc") message(STATUS "GL_KHR_cooperative_matrix not supported by glslc")
set(GGML_VULKAN_COOPMAT_GLSLC_SUPPORT OFF CACHE INTERNAL "Whether coopmat is supported by glslc") set(GGML_VULKAN_COOPMAT_GLSLC_SUPPORT OFF)
else() else()
message(STATUS "GL_KHR_cooperative_matrix supported by glslc") message(STATUS "GL_KHR_cooperative_matrix supported by glslc")
set(GGML_VULKAN_COOPMAT_GLSLC_SUPPORT ON CACHE INTERNAL "Whether coopmat is supported by glslc") set(GGML_VULKAN_COOPMAT_GLSLC_SUPPORT ON)
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) add_compile_definitions(GGML_VULKAN_COOPMAT_GLSLC_SUPPORT)
endif() endif()
if(NOT DEFINED GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT)
# Compile a test shader to determine whether GL_NV_cooperative_matrix2 is supported. # Compile a test shader to determine whether GL_NV_cooperative_matrix2 is supported.
# If it's not, there will be an error to stderr. # If it's not, there will be an error to stderr.
# If it's supported, set a define to indicate that we should compile those shaders # If it's supported, set a define to indicate that we should compile those shaders
@ -56,16 +48,10 @@ if (Vulkan_FOUND)
if (${glslc_error} MATCHES ".*extension not supported: GL_NV_cooperative_matrix2.*") if (${glslc_error} MATCHES ".*extension not supported: GL_NV_cooperative_matrix2.*")
message(STATUS "GL_NV_cooperative_matrix2 not supported by glslc") message(STATUS "GL_NV_cooperative_matrix2 not supported by glslc")
set(GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT OFF CACHE INTERNAL "Whether coopmat2 is supported by glslc") set(GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT OFF)
else() else()
message(STATUS "GL_NV_cooperative_matrix2 supported by glslc") message(STATUS "GL_NV_cooperative_matrix2 supported by glslc")
set(GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT ON CACHE INTERNAL "Whether coopmat2 is supported by glslc") set(GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT ON)
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) add_compile_definitions(GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT)
endif() endif()