Skip to content

Commit

Permalink
Fix handling of "invalid property" when creating OpenCL command queue (
Browse files Browse the repository at this point in the history
…ggerganov#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.
  • Loading branch information
mthuurne authored May 23, 2023
1 parent 2e6cd4b commit 7d87381
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ggml-opencl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)));

Expand Down

0 comments on commit 7d87381

Please sign in to comment.