Skip to content

Commit 65908bd

Browse files
author
Henry Linjamäki
committed
OpenCL: query non-uniform WG sizes only on OpenCL 3.0+
1 parent 15bbce9 commit 65908bd

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,8 +1408,14 @@ static ggml_backend_opencl_context * ggml_cl2_init(ggml_backend_dev_t dev) {
14081408
GGML_LOG_INFO("ggml_opencl: SVM atomics support: %s\n",
14091409
svm_caps & CL_DEVICE_SVM_ATOMICS ? "true" : "false");
14101410

1411-
CL_CHECK(clGetDeviceInfo(device, CL_DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT, sizeof(cl_bool),
1412-
&backend_ctx->non_uniform_workgroups, 0));
1411+
if (opencl_c_version.major >= 3) {
1412+
CL_CHECK(clGetDeviceInfo(device, CL_DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT, sizeof(cl_bool),
1413+
&backend_ctx->non_uniform_workgroups, 0));
1414+
} else {
1415+
GGML_ASSERT(opencl_c_version.major == 2);
1416+
// Non-uniform workgroup sizes is mandatory feature in v2.x.
1417+
backend_ctx->non_uniform_workgroups = true;
1418+
}
14131419

14141420
// Print out configurations
14151421
#ifdef GGML_OPENCL_SOA_Q

0 commit comments

Comments
 (0)