@@ -23,49 +23,35 @@ if (Vulkan_FOUND)
23
23
../../include/ggml-vulkan.h
24
24
)
25
25
26
- if (NOT DEFINED GGML_VULKAN_COOPMAT_GLSLC_SUPPORT )
27
- # Compile a test shader to determine whether GL_KHR_cooperative_matrix is supported.
28
- # If it's not, there will be an error to stderr.
29
- # If it's supported, set a define to indicate that we should compile those shaders
30
- execute_process (COMMAND ${Vulkan_GLSLC_EXECUTABLE} -o - -fshader-stage=compute --target-env=vulkan1.3 "${CMAKE_CURRENT_SOURCE_DIR} /vulkan-shaders/test_coopmat_support.comp"
31
- OUTPUT_VARIABLE glslc_output
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 ()
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 )
44
32
45
- if (GGML_VULKAN_COOPMAT_GLSLC_SUPPORT )
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 )
46
39
add_compile_definitions (GGML_VULKAN_COOPMAT_GLSLC_SUPPORT )
47
40
endif ()
48
41
49
- if (NOT DEFINED GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT )
50
- # Compile a test shader to determine whether GL_NV_cooperative_matrix2 is supported.
51
- # If it's not, there will be an error to stderr.
52
- # If it's supported, set a define to indicate that we should compile those shaders
53
- execute_process (COMMAND ${Vulkan_GLSLC_EXECUTABLE} -o - -fshader-stage=compute --target-env=vulkan1.3 "${CMAKE_CURRENT_SOURCE_DIR} /vulkan-shaders/test_coopmat2_support.comp"
54
- OUTPUT_VARIABLE glslc_output
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 ()
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 )
67
48
68
- if (GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT )
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 )
69
55
add_compile_definitions (GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT )
70
56
endif ()
71
57
0 commit comments