Fix some Wunused-but-set warnings (#1666)

To the best of my understanding, these occurrences of the
`-Wunused-but-set` warnings do not reveal any underlying issues, so we
can safely remove these variables.  There are more occurrences of this
warning in other places (not touched by this commit) that require
further analysis.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
This commit is contained in:
Sven van Haastregt
2023-03-30 09:34:00 +01:00
committed by GitHub
parent 8e74722a0a
commit a70fa56003
12 changed files with 3 additions and 42 deletions

View File

@@ -768,7 +768,6 @@ int test_buffer_read_async( cl_device_id deviceID, cl_context context, cl_comman
size_t global_work_size[3];
cl_int err;
int i;
size_t lastIndex;
size_t ptrSizes[5];
int src_flag_id;
int total_errors = 0;
@@ -849,11 +848,11 @@ int test_buffer_read_async( cl_device_id deviceID, cl_context context, cl_comman
return -1;
}
lastIndex = ( num_elements * ( 1 << i ) - 1 ) * ptrSizes[0];
err = clEnqueueReadBuffer(queue, buffer, false, 0,
ptrSizes[i] * num_elements, outptr[i], 0,
NULL, &event);
#ifdef CHECK_FOR_NON_WAIT
size_t lastIndex = (num_elements * (1 << i) - 1) * ptrSizes[0];
if ( ((uchar *)outptr[i])[lastIndex] ){
log_error( " clEnqueueReadBuffer() possibly returned only after inappropriately waiting for execution to be finished\n" );
log_error( " Function was run asynchornously, but last value in array was set in code line following clEnqueueReadBuffer()\n" );
@@ -904,7 +903,6 @@ int test_buffer_read_array_barrier( cl_device_id deviceID, cl_context context, c
size_t global_work_size[3];
cl_int err;
int i;
size_t lastIndex;
size_t ptrSizes[5];
int src_flag_id;
int total_errors = 0;
@@ -984,11 +982,11 @@ int test_buffer_read_array_barrier( cl_device_id deviceID, cl_context context, c
return -1;
}
lastIndex = ( num_elements * ( 1 << i ) - 1 ) * ptrSizes[0];
err = clEnqueueReadBuffer(queue, buffer, false, 0,
ptrSizes[i] * num_elements,
(void *)(outptr[i]), 0, NULL, &event);
#ifdef CHECK_FOR_NON_WAIT
size_t lastIndex = (num_elements * (1 << i) - 1) * ptrSizes[0];
if ( ((uchar *)outptr[i])[lastIndex] ){
log_error( " clEnqueueReadBuffer() possibly returned only after inappropriately waiting for execution to be finished\n" );
log_error( " Function was run asynchornously, but last value in array was set in code line following clEnqueueReadBuffer()\n" );