mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2025-10-27 08:21:30 +00:00
opencl: fix build targeting CL 2 (#16554)
This commit is contained in:
@@ -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");
|
svm_caps & CL_DEVICE_SVM_ATOMICS ? "true" : "false");
|
||||||
|
|
||||||
if (opencl_c_version.major >= 3) {
|
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),
|
CL_CHECK(clGetDeviceInfo(device, CL_DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT, sizeof(cl_bool),
|
||||||
&backend_ctx->non_uniform_workgroups, 0));
|
&backend_ctx->non_uniform_workgroups, 0));
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
GGML_ASSERT(opencl_c_version.major == 2);
|
GGML_ASSERT(opencl_c_version.major == 2);
|
||||||
// Non-uniform workgroup sizes is mandatory feature in v2.x.
|
// Non-uniform workgroup sizes is mandatory feature in v2.x.
|
||||||
|
|||||||
Reference in New Issue
Block a user