Spaces:
Running
Running
bandoti
commited on
Commit
·
fac18c1
1
Parent(s):
e7bebe6
cmake: remove caching from vulkan coopmat checks (llama/12719)
Browse files
ggml/src/ggml-vulkan/CMakeLists.txt
CHANGED
|
@@ -23,49 +23,35 @@ if (Vulkan_FOUND)
|
|
| 23 |
../../include/ggml-vulkan.h
|
| 24 |
)
|
| 25 |
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
ERROR_VARIABLE glslc_error)
|
| 33 |
-
|
| 34 |
-
if (${glslc_error} MATCHES ".*extension not supported: GL_KHR_cooperative_matrix.*")
|
| 35 |
-
message(STATUS "GL_KHR_cooperative_matrix not supported by glslc")
|
| 36 |
-
set(GGML_VULKAN_COOPMAT_GLSLC_SUPPORT OFF CACHE INTERNAL "Whether coopmat is supported by glslc")
|
| 37 |
-
else()
|
| 38 |
-
message(STATUS "GL_KHR_cooperative_matrix supported by glslc")
|
| 39 |
-
set(GGML_VULKAN_COOPMAT_GLSLC_SUPPORT ON CACHE INTERNAL "Whether coopmat is supported by glslc")
|
| 40 |
-
endif()
|
| 41 |
-
else()
|
| 42 |
-
message(STATUS "GL_KHR_cooperative_matrix support already defined: ${GGML_VULKAN_COOPMAT_GLSLC_SUPPORT}")
|
| 43 |
-
endif()
|
| 44 |
|
| 45 |
-
if(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
add_compile_definitions(GGML_VULKAN_COOPMAT_GLSLC_SUPPORT)
|
| 47 |
endif()
|
| 48 |
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
ERROR_VARIABLE glslc_error)
|
| 56 |
-
|
| 57 |
-
if (${glslc_error} MATCHES ".*extension not supported: GL_NV_cooperative_matrix2.*")
|
| 58 |
-
message(STATUS "GL_NV_cooperative_matrix2 not supported by glslc")
|
| 59 |
-
set(GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT OFF CACHE INTERNAL "Whether coopmat2 is supported by glslc")
|
| 60 |
-
else()
|
| 61 |
-
message(STATUS "GL_NV_cooperative_matrix2 supported by glslc")
|
| 62 |
-
set(GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT ON CACHE INTERNAL "Whether coopmat2 is supported by glslc")
|
| 63 |
-
endif()
|
| 64 |
-
else()
|
| 65 |
-
message(STATUS "GL_NV_cooperative_matrix2 support already defined: ${GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT}")
|
| 66 |
-
endif()
|
| 67 |
|
| 68 |
-
if(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
add_compile_definitions(GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT)
|
| 70 |
endif()
|
| 71 |
|
|
|
|
| 23 |
../../include/ggml-vulkan.h
|
| 24 |
)
|
| 25 |
|
| 26 |
+
# Compile a test shader to determine whether GL_KHR_cooperative_matrix is supported.
|
| 27 |
+
# If it's not, there will be an error to stderr.
|
| 28 |
+
# If it's supported, set a define to indicate that we should compile those shaders
|
| 29 |
+
execute_process(COMMAND ${Vulkan_GLSLC_EXECUTABLE} -o - -fshader-stage=compute --target-env=vulkan1.3 "${CMAKE_CURRENT_SOURCE_DIR}/vulkan-shaders/test_coopmat_support.comp"
|
| 30 |
+
OUTPUT_VARIABLE glslc_output
|
| 31 |
+
ERROR_VARIABLE glslc_error)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
+
if (${glslc_error} MATCHES ".*extension not supported: GL_KHR_cooperative_matrix.*")
|
| 34 |
+
message(STATUS "GL_KHR_cooperative_matrix not supported by glslc")
|
| 35 |
+
set(GGML_VULKAN_COOPMAT_GLSLC_SUPPORT OFF)
|
| 36 |
+
else()
|
| 37 |
+
message(STATUS "GL_KHR_cooperative_matrix supported by glslc")
|
| 38 |
+
set(GGML_VULKAN_COOPMAT_GLSLC_SUPPORT ON)
|
| 39 |
add_compile_definitions(GGML_VULKAN_COOPMAT_GLSLC_SUPPORT)
|
| 40 |
endif()
|
| 41 |
|
| 42 |
+
# Compile a test shader to determine whether GL_NV_cooperative_matrix2 is supported.
|
| 43 |
+
# If it's not, there will be an error to stderr.
|
| 44 |
+
# If it's supported, set a define to indicate that we should compile those shaders
|
| 45 |
+
execute_process(COMMAND ${Vulkan_GLSLC_EXECUTABLE} -o - -fshader-stage=compute --target-env=vulkan1.3 "${CMAKE_CURRENT_SOURCE_DIR}/vulkan-shaders/test_coopmat2_support.comp"
|
| 46 |
+
OUTPUT_VARIABLE glslc_output
|
| 47 |
+
ERROR_VARIABLE glslc_error)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
|
| 49 |
+
if (${glslc_error} MATCHES ".*extension not supported: GL_NV_cooperative_matrix2.*")
|
| 50 |
+
message(STATUS "GL_NV_cooperative_matrix2 not supported by glslc")
|
| 51 |
+
set(GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT OFF)
|
| 52 |
+
else()
|
| 53 |
+
message(STATUS "GL_NV_cooperative_matrix2 supported by glslc")
|
| 54 |
+
set(GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT ON)
|
| 55 |
add_compile_definitions(GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT)
|
| 56 |
endif()
|
| 57 |
|