[NFC] api: Fix sign-compare warnings (#1692)

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
This commit is contained in:
Sven van Haastregt
2023-04-03 16:29:51 +01:00
committed by GitHub
parent a70fa56003
commit 605228ae7f
6 changed files with 18 additions and 18 deletions

View File

@@ -60,7 +60,7 @@ int enqueue_kernel(cl_context context, const cl_queue_properties_khr *queue_prop
clCommandQueueWrapper queue = clCreateCommandQueueWithPropertiesKHR(context, deviceID, queue_prop_def, &error);
test_error(error, "clCreateCommandQueueWithPropertiesKHR failed");
for (int i = 0; i < num_elements; ++i)
for (size_t i = 0; i < num_elements; ++i)
{
buf[i] = i;
}
@@ -85,9 +85,9 @@ int enqueue_kernel(cl_context context, const cl_queue_properties_khr *queue_prop
error = clEnqueueReadBuffer(queue, streams[1], CL_TRUE, 0, num_elements, buf.data(), 0, NULL, NULL);
test_error( error, "clEnqueueReadBuffer failed." );
for (int i = 0; i < num_elements; ++i)
for (size_t i = 0; i < num_elements; ++i)
{
if (buf[i] != i)
if (static_cast<size_t>(buf[i]) != i)
{
log_error("ERROR: Incorrect vector copy result.");
return -1;
@@ -162,4 +162,4 @@ int test_queue_properties(cl_device_id deviceID, cl_context context, cl_command_
}
return 0;
}
}