Skip to content

Commit 573284f

Browse files
committed
Perform Vulkan extensions checks in a more sensible order
1 parent 2c293ed commit 573284f

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

ggml/src/ggml-vulkan/CMakeLists.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,32 @@ if (Vulkan_FOUND)
88
../../include/ggml-vulkan.h
99
)
1010

11-
# Compile a test shader to determine whether GL_NV_cooperative_matrix2 is supported.
11+
# Compile a test shader to determine whether GL_KHR_cooperative_matrix is supported.
1212
# If it's not, there will be an error to stderr.
1313
# If it's supported, set a define to indicate that we should compile those shaders
14-
execute_process(COMMAND ${Vulkan_GLSLC_EXECUTABLE} -o - -fshader-stage=compute --target-env=vulkan1.3 "${CMAKE_CURRENT_SOURCE_DIR}/vulkan-shaders/test_coopmat2_support.comp"
14+
execute_process(COMMAND ${Vulkan_GLSLC_EXECUTABLE} -o - -fshader-stage=compute --target-env=vulkan1.3 "${CMAKE_CURRENT_SOURCE_DIR}/vulkan-shaders/test_coopmat_support.comp"
1515
OUTPUT_VARIABLE glslc_output
1616
ERROR_VARIABLE glslc_error)
1717

18-
if (${glslc_error} MATCHES ".*extension not supported: GL_NV_cooperative_matrix2.*")
19-
message(STATUS "GL_NV_cooperative_matrix2 not supported by glslc")
18+
if (${glslc_error} MATCHES ".*extension not supported: GL_KHR_cooperative_matrix.*")
19+
message(STATUS "GL_KHR_cooperative_matrix not supported by glslc")
2020
else()
21-
message(STATUS "GL_NV_cooperative_matrix2 supported by glslc")
22-
add_compile_definitions(GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT)
21+
message(STATUS "GL_KHR_cooperative_matrix supported by glslc")
22+
add_compile_definitions(GGML_VULKAN_COOPMAT_GLSLC_SUPPORT)
2323
endif()
2424

25-
# Compile a test shader to determine whether GL_KHR_cooperative_matrix is supported.
25+
# Compile a test shader to determine whether GL_NV_cooperative_matrix2 is supported.
2626
# If it's not, there will be an error to stderr.
2727
# If it's supported, set a define to indicate that we should compile those shaders
28-
execute_process(COMMAND ${Vulkan_GLSLC_EXECUTABLE} -o - -fshader-stage=compute --target-env=vulkan1.3 "${CMAKE_CURRENT_SOURCE_DIR}/vulkan-shaders/test_coopmat_support.comp"
28+
execute_process(COMMAND ${Vulkan_GLSLC_EXECUTABLE} -o - -fshader-stage=compute --target-env=vulkan1.3 "${CMAKE_CURRENT_SOURCE_DIR}/vulkan-shaders/test_coopmat2_support.comp"
2929
OUTPUT_VARIABLE glslc_output
3030
ERROR_VARIABLE glslc_error)
3131

32-
if (${glslc_error} MATCHES ".*extension not supported: GL_KHR_cooperative_matrix.*")
33-
message(STATUS "GL_KHR_cooperative_matrix not supported by glslc")
32+
if (${glslc_error} MATCHES ".*extension not supported: GL_NV_cooperative_matrix2.*")
33+
message(STATUS "GL_NV_cooperative_matrix2 not supported by glslc")
3434
else()
35-
message(STATUS "GL_KHR_cooperative_matrix supported by glslc")
36-
add_compile_definitions(GGML_VULKAN_COOPMAT_GLSLC_SUPPORT)
35+
message(STATUS "GL_NV_cooperative_matrix2 supported by glslc")
36+
add_compile_definitions(GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT)
3737
endif()
3838

3939
target_link_libraries(ggml-vulkan PRIVATE Vulkan::Vulkan)

0 commit comments

Comments
 (0)