Skip to content

Commit 5016b72

Browse files
authored
opencl: fix build targeting CL 2 (ggml-org#16554)
1 parent 7049736 commit 5016b72

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ggml/src/ggml-opencl/ggml-opencl.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2348,8 +2348,13 @@ static ggml_backend_opencl_context * ggml_cl2_init(ggml_backend_dev_t dev) {
23482348
svm_caps & CL_DEVICE_SVM_ATOMICS ? "true" : "false");
23492349

23502350
if (opencl_c_version.major >= 3) {
2351+
// Assume it is not available for 3.0, since it is optional in 3.0.
2352+
// If compiling against 3.0, then we can query.
2353+
backend_ctx->non_uniform_workgroups = false;
2354+
#if CL_TARGET_OPENCL_VERSION >= 300
23512355
CL_CHECK(clGetDeviceInfo(device, CL_DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT, sizeof(cl_bool),
23522356
&backend_ctx->non_uniform_workgroups, 0));
2357+
#endif
23532358
} else {
23542359
GGML_ASSERT(opencl_c_version.major == 2);
23552360
// Non-uniform workgroup sizes is mandatory feature in v2.x.

0 commit comments

Comments
 (0)