From: Maarten ter Huurne Date: Tue, 23 May 2023 16:01:15 +0000 (+0200) Subject: Fix handling of "invalid property" when creating OpenCL command queue (#1565) X-Git-Tag: gguf-v0.4.0~721 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=7d873811f31d4d8c909015c946a862c0089cda7d;p=pkg%2Fggml%2Fsources%2Fllama.cpp Fix handling of "invalid property" when creating OpenCL command queue (#1565) The `clCreateCommandQueue()` function will return the code `CL_INVALID_QUEUE_PROPERTIES` when passed unsupported properties, not `CL_INVALID_PROPERTY` as the original code was checking for. --- diff --git a/ggml-opencl.cpp b/ggml-opencl.cpp index fb007dd2..667f55e7 100644 --- a/ggml-opencl.cpp +++ b/ggml-opencl.cpp @@ -488,7 +488,7 @@ void ggml_cl_init(void) { CL_CHECK((context = clCreateContext(properties, 1, &device, NULL, NULL, &err), err)); CL_CHECK((queue = clCreateCommandQueue(context, device, CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE, &err), - (err != CL_INVALID_PROPERTY && err != CL_INVALID_VALUE ? err : + (err != CL_INVALID_QUEUE_PROPERTIES && err != CL_INVALID_VALUE ? err : (queue = clCreateCommandQueue(context, device, 0, &err), err) )));