Skip to content

Commit

Permalink
device_execution: fix CL_QUEUE_* in error messages (KhronosGroup#1896)
Browse files Browse the repository at this point in the history
When reporting errors from `clCreateCommandQueueWithProperties`,
report the correct property names.  In particular:

`CL_QUEUE_DEVICE` should be `CL_QUEUE_ON_DEVICE`.
`CL_QUEUE_DEFAULT` should be `CL_QUEUE_ON_DEVICE_DEFAULT`.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
  • Loading branch information
svenvh committed Mar 12, 2024
1 parent ffb0265 commit d8ad10d
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 16 deletions.
6 changes: 4 additions & 2 deletions test_conformance/device_execution/device_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static int check_device_queues(cl_device_id device, cl_context context, cl_uint
for(i = 0; i < num_queues; ++i)
{
queue[i] = clCreateCommandQueueWithProperties(context, device, properties, &err_ret);
test_error(err_ret, "clCreateCommandQueueWithProperties(CL_QUEUE_DEVICE) failed");
test_error(err_ret, "clCreateCommandQueueWithProperties failed");
}

// Validate all queues
Expand Down Expand Up @@ -128,7 +128,9 @@ int test_device_queue(cl_device_id device, cl_context context, cl_command_queue
if(max_queues > MAX_QUEUES) max_queues = MAX_QUEUES;

dev_queue = clCreateCommandQueueWithProperties(context, device, queue_prop_def, &err_ret);
test_error(err_ret, "clCreateCommandQueueWithProperties(CL_QUEUE_DEVICE|CL_QUEUE_DEFAULT) failed");
test_error(err_ret,
"clCreateCommandQueueWithProperties(CL_QUEUE_ON_DEVICE | "
"CL_QUEUE_ON_DEVICE_DEFAULT) failed");

err_ret = check_device_queue(device, context, dev_queue, preffered_size);
if(check_error(err_ret, "Default device queue validation failed")) res = -1;
Expand Down
4 changes: 3 additions & 1 deletion test_conformance/device_execution/enqueue_block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,9 @@ int test_enqueue_block(cl_device_id device, cl_context context, cl_command_queue
};

dev_queue = clCreateCommandQueueWithProperties(context, device, queue_prop_def, &err_ret);
test_error(err_ret, "clCreateCommandQueueWithProperties(CL_QUEUE_DEVICE|CL_QUEUE_DEFAULT) failed");
test_error(err_ret,
"clCreateCommandQueueWithProperties(CL_QUEUE_ON_DEVICE | "
"CL_QUEUE_ON_DEVICE_DEFAULT) failed");

size_t global_size = MAX_GWS;
size_t local_size = (max_local_size > global_size/16) ? global_size/16 : max_local_size;
Expand Down
4 changes: 3 additions & 1 deletion test_conformance/device_execution/enqueue_flags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,9 @@ int test_enqueue_flags(cl_device_id device, cl_context context, cl_command_queue
};

dev_queue = clCreateCommandQueueWithProperties(context, device, queue_prop_def, &err_ret);
test_error(err_ret, "clCreateCommandQueueWithProperties(CL_QUEUE_DEVICE|CL_QUEUE_DEFAULT) failed");
test_error(err_ret,
"clCreateCommandQueueWithProperties(CL_QUEUE_ON_DEVICE | "
"CL_QUEUE_ON_DEVICE_DEFAULT) failed");

size_t global_size = MAX_GWS;
size_t local_size = (max_local_size > global_size/16) ? global_size/16 : max_local_size;
Expand Down
8 changes: 6 additions & 2 deletions test_conformance/device_execution/enqueue_multi_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ int test_enqueue_multi_queue(cl_device_id device, cl_context context, cl_command
};

dev_queue = clCreateCommandQueueWithProperties(context, device, queue_prop_def, &err_ret);
test_error(err_ret, "clCreateCommandQueueWithProperties(CL_QUEUE_DEVICE|CL_QUEUE_DEFAULT) failed");
test_error(err_ret,
"clCreateCommandQueueWithProperties(CL_QUEUE_ON_DEVICE | "
"CL_QUEUE_ON_DEVICE_DEFAULT) failed");

if(max_queues > 1)
{
Expand All @@ -141,7 +143,9 @@ int test_enqueue_multi_queue(cl_device_id device, cl_context context, cl_command
for(i = 0; i < n; ++i)
{
queues[i] = clCreateCommandQueueWithProperties(context, device, queue_prop, &err_ret);
test_error(err_ret, "clCreateCommandQueueWithProperties(CL_QUEUE_DEVICE) failed");
test_error(err_ret,
"clCreateCommandQueueWithProperties(CL_QUEUE_ON_DEVICE) "
"failed");
q[i] = queues[i];
}

Expand Down
4 changes: 3 additions & 1 deletion test_conformance/device_execution/enqueue_ndrange.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,9 @@ int test_enqueue_ndrange(cl_device_id device, cl_context context, cl_command_que
};

dev_queue = clCreateCommandQueueWithProperties(context, device, queue_prop_def, &err_ret);
test_error(err_ret, "clCreateCommandQueueWithProperties(CL_QUEUE_DEVICE|CL_QUEUE_DEFAULT) failed");
test_error(err_ret,
"clCreateCommandQueueWithProperties(CL_QUEUE_ON_DEVICE | "
"CL_QUEUE_ON_DEVICE_DEFAULT) failed");

max_local_size = (max_local_size > MAX_GWS)? MAX_GWS: max_local_size;
if(gWimpyMode)
Expand Down
10 changes: 5 additions & 5 deletions test_conformance/device_execution/enqueue_profiling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,18 @@ int test_enqueue_profiling(cl_device_id device, cl_context context,
dev_queue = clCreateCommandQueueWithProperties(
context, device, dev_queue_prop_def, &err_ret);
test_error(err_ret,
"clCreateCommandQueueWithProperties(CL_QUEUE_DEVICE|CL_QUEUE_"
"DEFAULT) failed");
"clCreateCommandQueueWithProperties(CL_QUEUE_ON_DEVICE | "
"CL_QUEUE_ON_DEVICE_DEFAULT) failed");

cl_queue_properties host_queue_prop_def[] = { CL_QUEUE_PROPERTIES,
CL_QUEUE_PROFILING_ENABLE,
0 };

host_queue = clCreateCommandQueueWithProperties(
context, device, host_queue_prop_def, &err_ret);
test_error(err_ret,
"clCreateCommandQueueWithProperties(CL_QUEUE_DEVICE|CL_QUEUE_"
"DEFAULT) failed");
test_error(
err_ret,
"clCreateCommandQueueWithProperties(CL_QUEUE_PROFILING_ENABLE) failed");

cl_int status;
size_t size = 1;
Expand Down
4 changes: 3 additions & 1 deletion test_conformance/device_execution/enqueue_wg_size.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1659,7 +1659,9 @@ int test_enqueue_wg_size(cl_device_id device, cl_context context, cl_command_que
};

dev_queue = clCreateCommandQueueWithProperties(context, device, queue_prop_def, &err_ret);
test_error(err_ret, "clCreateCommandQueueWithProperties(CL_QUEUE_DEVICE|CL_QUEUE_DEFAULT) failed");
test_error(err_ret,
"clCreateCommandQueueWithProperties(CL_QUEUE_ON_DEVICE | "
"CL_QUEUE_ON_DEVICE_DEFAULT) failed");


size_t failCnt = 0;
Expand Down
4 changes: 3 additions & 1 deletion test_conformance/device_execution/host_multi_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ int test_host_multi_queue(cl_device_id device, cl_context context, cl_command_qu
};

dev_queue = clCreateCommandQueueWithProperties(context, device, queue_prop_def, &err_ret);
test_error(err_ret, "clCreateCommandQueueWithProperties(CL_QUEUE_DEVICE|CL_QUEUE_DEFAULT) failed");
test_error(err_ret,
"clCreateCommandQueueWithProperties(CL_QUEUE_ON_DEVICE | "
"CL_QUEUE_ON_DEVICE_DEFAULT) failed");

cl_uint n = num_kernels_multi_queue_block; // Number of host queues
std::vector<clCommandQueueWrapper> queues(n);
Expand Down
4 changes: 3 additions & 1 deletion test_conformance/device_execution/host_queue_order.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ int test_host_queue_order(cl_device_id device, cl_context context, cl_command_qu
};

dev_queue = clCreateCommandQueueWithProperties(context, device, queue_prop_def, &err_ret);
test_error(err_ret, "clCreateCommandQueueWithProperties(CL_QUEUE_DEVICE|CL_QUEUE_DEFAULT) failed");
test_error(err_ret,
"clCreateCommandQueueWithProperties(CL_QUEUE_ON_DEVICE | "
"CL_QUEUE_ON_DEVICE_DEFAULT) failed");

cl_int status;
size_t size = 1;
Expand Down
4 changes: 3 additions & 1 deletion test_conformance/device_execution/nested_blocks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,9 @@ int test_enqueue_nested_blocks(cl_device_id device, cl_context context, cl_comma
};

dev_queue = clCreateCommandQueueWithProperties(context, device, queue_prop_def, &err_ret);
test_error(err_ret, "clCreateCommandQueueWithProperties(CL_QUEUE_DEVICE|CL_QUEUE_DEFAULT) failed");
test_error(err_ret,
"clCreateCommandQueueWithProperties(CL_QUEUE_ON_DEVICE | "
"CL_QUEUE_ON_DEVICE_DEFAULT) failed");

kernel_arg args[] =
{
Expand Down

0 comments on commit d8ad10d

Please sign in to comment.