mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
a few fixes (thread safety & cl_khr_command_buffer UB) (#1840)
some fixes we've been carrying in our CTS fork: * fix UB in `command_buffer_event_sync.cpp`: enqueue of two commands in two separate queues, with both using the same buffer argument, and no synchronization between the commands. * fix UB in `command_buffer_test_barrier.cpp`: missing synchronization between zeroing command and command-buffer using two separate queues * make `test_thread_dimensions.cpp` thread-safe to avoid spurious errors.
This commit is contained in:
@@ -583,7 +583,7 @@ struct CommandBufferEventSync : public BasicCommandBufferTest
|
||||
|
||||
// process secondary queue
|
||||
error =
|
||||
clEnqueueFillBuffer(queue_sec, in_mem, &pattern_pri, sizeof(cl_int),
|
||||
clEnqueueFillBuffer(queue_sec, in_mem, &pattern_sec, sizeof(cl_int),
|
||||
0, data_size(), 0, nullptr, nullptr);
|
||||
test_error(error, "clEnqueueFillBuffer failed");
|
||||
|
||||
@@ -593,8 +593,9 @@ struct CommandBufferEventSync : public BasicCommandBufferTest
|
||||
"clEnqueueCommandBufferKHR in secondary queue failed");
|
||||
|
||||
// process primary queue
|
||||
error = clEnqueueFillBuffer(queue, in_mem, &pattern_pri, sizeof(cl_int),
|
||||
0, data_size(), 0, nullptr, event_ptrs[0]);
|
||||
error =
|
||||
clEnqueueFillBuffer(queue, in_mem, &pattern_pri, sizeof(cl_int), 0,
|
||||
data_size(), 1, &test_event, event_ptrs[0]);
|
||||
test_error(error, "clEnqueueFillBuffer failed");
|
||||
|
||||
cl_event wait_list[] = { test_event,
|
||||
|
||||
@@ -93,6 +93,9 @@ struct BarrierWithWaitListKHR : public BasicCommandBufferTest
|
||||
0, data_size(), 0, nullptr, nullptr);
|
||||
test_error(error, "clEnqueueFillBufferKHR failed");
|
||||
|
||||
error = clFinish(queue);
|
||||
test_error(error, "clFinish");
|
||||
|
||||
error = clEnqueueCommandBufferKHR(
|
||||
0, nullptr, out_of_order_command_buffer, 0, nullptr, &event);
|
||||
test_error(error, "clEnqueueCommandBufferKHR failed");
|
||||
|
||||
Reference in New Issue
Block a user