Skip to content

Commit c0d639e

Browse files
authored
[SYCL] Properly apply a mask of supported queue properties in the OpenCL plugin (#6622)
"discard_events" property is passed to all backends during queue creation. OpenCL runtime itself is not aware of such property so we need to apply a mask of supported properties before calling OpenCL API for queue creation. By mistake mask was applied only for OpenCL 2.0, this PR makes it to be applied for OpenCL 1.2 as well.
1 parent 1372120 commit c0d639e

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

sycl/plugins/opencl/pi_opencl.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -413,15 +413,6 @@ pi_result piQueueCreate(pi_context context, pi_device device,
413413

414414
CHECK_ERR_SET_NULL_RET(ret_err, queue, ret_err);
415415

416-
if (platVer.find("OpenCL 1.0") != std::string::npos ||
417-
platVer.find("OpenCL 1.1") != std::string::npos ||
418-
platVer.find("OpenCL 1.2") != std::string::npos) {
419-
*queue = cast<pi_queue>(clCreateCommandQueue(
420-
cast<cl_context>(context), cast<cl_device_id>(device),
421-
cast<cl_command_queue_properties>(properties), &ret_err));
422-
return cast<pi_result>(ret_err);
423-
}
424-
425416
// Check that unexpected bits are not set.
426417
assert(!(properties &
427418
~(PI_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE |
@@ -433,6 +424,16 @@ pi_result piQueueCreate(pi_context context, pi_device device,
433424
CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_PROFILING_ENABLE |
434425
CL_QUEUE_ON_DEVICE | CL_QUEUE_ON_DEVICE_DEFAULT;
435426

427+
if (platVer.find("OpenCL 1.0") != std::string::npos ||
428+
platVer.find("OpenCL 1.1") != std::string::npos ||
429+
platVer.find("OpenCL 1.2") != std::string::npos) {
430+
*queue = cast<pi_queue>(clCreateCommandQueue(
431+
cast<cl_context>(context), cast<cl_device_id>(device),
432+
cast<cl_command_queue_properties>(properties) & SupportByOpenCL,
433+
&ret_err));
434+
return cast<pi_result>(ret_err);
435+
}
436+
436437
cl_queue_properties CreationFlagProperties[] = {
437438
CL_QUEUE_PROPERTIES,
438439
cast<cl_command_queue_properties>(properties) & SupportByOpenCL, 0};

0 commit comments

Comments
 (0)