]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
opencl: fix build targeting CL 2 (llama/16554)
authorlhez <redacted>
Mon, 13 Oct 2025 18:50:37 +0000 (11:50 -0700)
committerGeorgi Gerganov <redacted>
Wed, 15 Oct 2025 06:29:17 +0000 (09:29 +0300)
ggml/src/ggml-opencl/ggml-opencl.cpp

index 79d2148744f904874836245ef7d4f46184b138c9..d2759069b3e29c513f527df89fbeed162e18d36e 100644 (file)
@@ -2348,8 +2348,13 @@ static ggml_backend_opencl_context * ggml_cl2_init(ggml_backend_dev_t dev) {
         svm_caps & CL_DEVICE_SVM_ATOMICS ? "true" : "false");
 
     if (opencl_c_version.major >= 3) {
+        // Assume it is not available for 3.0, since it is optional in 3.0.
+        // If compiling against 3.0, then we can query.
+        backend_ctx->non_uniform_workgroups = false;
+#if CL_TARGET_OPENCL_VERSION >= 300
         CL_CHECK(clGetDeviceInfo(device, CL_DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT, sizeof(cl_bool),
                                  &backend_ctx->non_uniform_workgroups, 0));
+#endif
     } else {
         GGML_ASSERT(opencl_c_version.major == 2);
         // Non-uniform workgroup sizes is mandatory feature in v2.x.