Fix more Wformat warnings related to size_t (#2166)

Printing of a `size_t` requires the `%zu` specifier.

This fixes occurrences where the previous wrong specifier appears to
work in a typical 64-bit build, but causes a Wformat warning in 32-bit
builds.

---------

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
This commit is contained in:
Sven van Haastregt
2024-12-10 18:13:58 +01:00
committed by GitHub
parent d99b302f90
commit 56d383b2e9
17 changed files with 386 additions and 144 deletions

View File

@@ -86,7 +86,7 @@ int determine_validation_error_offset(
{
if (printAsFloat)
{
log_error("Sample %ld: coord {%f(%a),%f(%a),%f(%a)} did "
log_error("Sample %zu: coord {%f(%a),%f(%a),%f(%a)} did "
"not validate! Expected (%g,%g,%g,%g), got "
"(%g,%g,%g,%g), error of %g\n",
j, x, x, y, y, z, z, (float)expected[0],
@@ -98,7 +98,7 @@ int determine_validation_error_offset(
else
{
log_error(
"Sample %ld: coord {%f(%a),%f(%a),%f(%a)} did not "
"Sample %zu: coord {%f(%a),%f(%a),%f(%a)} did not "
"validate! Expected (%x,%x,%x,%x), got (%x,%x,%x,%x)\n",
j, x, x, y, y, z, z, (int)expected[0], (int)expected[1],
(int)expected[2], (int)expected[3], (int)resultPtr[0],
@@ -134,7 +134,7 @@ int determine_validation_error_offset(
{
if (printAsFloat)
{
log_error("Sample %ld: coord {%f(%a),%f(%a),%f(%a)} did "
log_error("Sample %zu: coord {%f(%a),%f(%a),%f(%a)} did "
"not validate! Expected (%g,%g,%g,%g), got "
"(%g,%g,%g,%g), error of %g\n",
j, x, x, y, y, z, z, (float)expected[0],
@@ -146,7 +146,7 @@ int determine_validation_error_offset(
else
{
log_error(
"Sample %ld: coord {%f(%a),%f(%a),%f(%a)} did not "
"Sample %zu: coord {%f(%a),%f(%a),%f(%a)} did not "
"validate! Expected (%x,%x,%x,%x), got (%x,%x,%x,%x)\n",
j, x, x, y, y, z, z, (int)expected[0], (int)expected[1],
(int)expected[2], (int)expected[3], (int)resultPtr[0],
@@ -164,7 +164,7 @@ int determine_validation_error_offset(
{
if (printAsFloat)
{
log_error("Sample %ld: coord {%f(%a),%f(%a),%f(%a)} did not "
log_error("Sample %zu: coord {%f(%a),%f(%a),%f(%a)} did not "
"validate!\n\tExpected (%g,%g,%g,%g),\n\t got "
"(%g,%g,%g,%g), error of %g\n",
j, x, x, y, y, z, z, (float)expected[0],
@@ -175,7 +175,7 @@ int determine_validation_error_offset(
}
else
{
log_error("Sample %ld: coord {%f(%a),%f(%a),%f(%a)} did not "
log_error("Sample %zu: coord {%f(%a),%f(%a),%f(%a)} did not "
"validate!\n\tExpected (%x,%x,%x,%x),\n\t got "
"(%x,%x,%x,%x)\n",
j, x, x, y, y, z, z, (int)expected[0], (int)expected[1],

View File

@@ -97,7 +97,9 @@ template <class T> int determine_validation_error( void *imagePtr, image_descrip
{
if( (--numClamped) == 0 )
{
log_error( "ERROR: TEST FAILED: Read is erroneously clamping coordinates for image size %ld x %ld!\n", imageInfo->width, imageInfo->height );
log_error("ERROR: TEST FAILED: Read is erroneously clamping "
"coordinates for image size %zu x %zu!\n",
imageInfo->width, imageInfo->height);
if (imageInfo->format->image_channel_order == CL_DEPTH)
{
if( printAsFloat )
@@ -139,7 +141,9 @@ template <class T> int determine_validation_error( void *imagePtr, image_descrip
{
if( (--numClamped) == 0 )
{
log_error( "ERROR: TEST FAILED: Clamping is erroneously returning border color for image size %ld x %ld!\n", imageInfo->width, imageInfo->height );
log_error("ERROR: TEST FAILED: Clamping is erroneously "
"returning border color for image size %zu x %zu!\n",
imageInfo->width, imageInfo->height);
if (imageInfo->format->image_channel_order == CL_DEPTH)
{
if( printAsFloat )
@@ -203,7 +207,8 @@ template <class T> int determine_validation_error( void *imagePtr, image_descrip
(int)resultPtr[ 0 ], (int)resultPtr[ 1 ], (int)resultPtr[ 2 ], (int)resultPtr[ 3 ] );
}
}
log_error( "img size %ld,%ld (pitch %ld)", imageInfo->width, imageInfo->height, imageInfo->rowPitch );
log_error("img size %zu,%zu (pitch %zu)", imageInfo->width,
imageInfo->height, imageInfo->rowPitch);
if( clamped )
{
log_error( " which would clamp to %d,%d\n", clampedX, clampedY );

View File

@@ -207,8 +207,11 @@ int test_write_image_1D( cl_device_id device, cl_context context, cl_command_que
}
if( error != CL_SUCCESS )
{
log_error( "ERROR: Unable to create 1D image of size %ld pitch %ld (%s, %s)\n", imageInfo->width,
imageInfo->rowPitch, IGetErrorString( error ), mem_flag_names[mem_flag_index] );
log_error("ERROR: Unable to create 1D image of size %zu pitch "
"%zu (%s, %s)\n",
imageInfo->width, imageInfo->rowPitch,
IGetErrorString(error),
mem_flag_names[mem_flag_index]);
return error;
}
@@ -234,8 +237,11 @@ int test_write_image_1D( cl_device_id device, cl_context context, cl_command_que
imageInfo->format, &image_desc, NULL, &error);
if( error != CL_SUCCESS )
{
log_error( "ERROR: Unable to create %d level 1D image of size %ld (%s, %s)\n", imageInfo->num_mip_levels, imageInfo->width,
IGetErrorString( error ), mem_flag_names[mem_flag_index] );
log_error("ERROR: Unable to create %d level 1D image of "
"size %zu (%s, %s)\n",
imageInfo->num_mip_levels, imageInfo->width,
IGetErrorString(error),
mem_flag_names[mem_flag_index]);
return error;
}
}
@@ -246,8 +252,11 @@ int test_write_image_1D( cl_device_id device, cl_context context, cl_command_que
imageValues, NULL, &error );
if( error != CL_SUCCESS )
{
log_error( "ERROR: Unable to create 1D image of size %ld pitch %ld (%s, %s)\n", imageInfo->width,
imageInfo->rowPitch, IGetErrorString( error ), mem_flag_names[mem_flag_index] );
log_error("ERROR: Unable to create 1D image of size %zu "
"pitch %zu (%s, %s)\n",
imageInfo->width, imageInfo->rowPitch,
IGetErrorString(error),
mem_flag_names[mem_flag_index]);
return error;
}
}
@@ -368,7 +377,9 @@ int test_write_image_1D( cl_device_id device, cl_context context, cl_command_que
{
unsigned int *e = (unsigned int *)resultBuffer;
unsigned int *a = (unsigned int *)resultPtr;
log_error( "ERROR: Sample %ld did not validate! (%s)\n", i, mem_flag_names[ mem_flag_index ] );
log_error(
"ERROR: Sample %zu did not validate! (%s)\n", i,
mem_flag_names[mem_flag_index]);
log_error( " Expected: %a %a %a %a\n", expected[ 0 ], expected[ 1 ], expected[ 2 ], expected[ 3 ] );
log_error( " Expected: %08x %08x %08x %08x\n", e[ 0 ], e[ 1 ], e[ 2 ], e[ 3 ] );
log_error( " Actual: %a %a %a %a\n", actual[ 0 ], actual[ 1 ], actual[ 2 ], actual[ 3 ] );
@@ -385,7 +396,9 @@ int test_write_image_1D( cl_device_id device, cl_context context, cl_command_que
if( !validate_half_write_results( e, a, imageInfo ) )
{
totalErrors++;
log_error( "ERROR: Sample %ld did not validate! (%s)\n", i, mem_flag_names[ mem_flag_index ] );
log_error(
"ERROR: Sample %zu did not validate! (%s)\n", i,
mem_flag_names[mem_flag_index]);
log_error( " Expected: 0x%04x 0x%04x 0x%04x 0x%04x\n", e[ 0 ], e[ 1 ], e[ 2 ], e[ 3 ] );
log_error( " Actual: 0x%04x 0x%04x 0x%04x 0x%04x\n", a[ 0 ], a[ 1 ], a[ 2 ], a[ 3 ] );
if( inputType == kFloat )
@@ -435,7 +448,12 @@ int test_write_image_1D( cl_device_id device, cl_context context, cl_command_que
deviceResults[ 4 ] == 5 && deviceResults[ 5 ] == 5 && deviceResults[ 6 ] == 6 && deviceResults[ 7 ] == 6 )
deviceRounding = "round to even";
log_error( "ERROR: Rounding mode sample (%ld) did not validate, probably due to the device's rounding mode being wrong (%s)\n", i, mem_flag_names[mem_flag_index] );
log_error(
"ERROR: Rounding mode sample (%zu) did "
"not validate, probably due to the "
"device's rounding mode being wrong "
"(%s)\n",
i, mem_flag_names[mem_flag_index]);
log_error( " Actual values rounded by device: %x %x %x %x %x %x %x %x\n", deviceResults[ 0 ], deviceResults[ 1 ], deviceResults[ 2 ], deviceResults[ 3 ],
deviceResults[ 4 ], deviceResults[ 5 ], deviceResults[ 6 ], deviceResults[ 7 ] );
log_error( " Rounding mode of device appears to be %s\n", deviceRounding );

View File

@@ -218,8 +218,11 @@ int test_write_image_1D_array( cl_device_id device, cl_context context, cl_comma
}
if( error != CL_SUCCESS )
{
log_error( "ERROR: Unable to create 1D image array of size %ld x %ld pitch %ld (%s, %s)\n", imageInfo->width, imageInfo->arraySize,
imageInfo->rowPitch, IGetErrorString( error ), mem_flag_names[mem_flag_index] );
log_error("ERROR: Unable to create 1D image array of size %zu "
"x %zu pitch %zu (%s, %s)\n",
imageInfo->width, imageInfo->arraySize,
imageInfo->rowPitch, IGetErrorString(error),
mem_flag_names[mem_flag_index]);
return error;
}
@@ -245,8 +248,11 @@ int test_write_image_1D_array( cl_device_id device, cl_context context, cl_comma
imageInfo->format, &image_desc, NULL, &error);
if( error != CL_SUCCESS )
{
log_error( "ERROR: Unable to create %d level 1D image array of size %ld x %ld (%s, %s)\n", imageInfo->num_mip_levels, imageInfo->width, imageInfo->arraySize,
IGetErrorString( error ), mem_flag_names[mem_flag_index] );
log_error("ERROR: Unable to create %d level 1D image array "
"of size %zu x %zu (%s, %s)\n",
imageInfo->num_mip_levels, imageInfo->width,
imageInfo->arraySize, IGetErrorString(error),
mem_flag_names[mem_flag_index]);
return error;
}
}
@@ -257,8 +263,11 @@ int test_write_image_1D_array( cl_device_id device, cl_context context, cl_comma
imageValues, &error );
if( error != CL_SUCCESS )
{
log_error( "ERROR: Unable to create 1D image array of size %ld x %ld pitch %ld (%s, %s)\n", imageInfo->width, imageInfo->arraySize,
imageInfo->rowPitch, IGetErrorString( error ), mem_flag_names[mem_flag_index] );
log_error("ERROR: Unable to create 1D image array of size "
"%zu x %zu pitch %zu (%s, %s)\n",
imageInfo->width, imageInfo->arraySize,
imageInfo->rowPitch, IGetErrorString(error),
mem_flag_names[mem_flag_index]);
return error;
}
}
@@ -388,7 +397,9 @@ int test_write_image_1D_array( cl_device_id device, cl_context context, cl_comma
{
unsigned int *e = (unsigned int *)resultBuffer;
unsigned int *a = (unsigned int *)resultPtr;
log_error( "ERROR: Sample %ld (%ld,%ld) did not validate! (%s)\n", i, x, y, mem_flag_names[ mem_flag_index ] );
log_error("ERROR: Sample %zu (%zu,%zu) did not "
"validate! (%s)\n",
i, x, y, mem_flag_names[mem_flag_index]);
log_error( " Expected: %a %a %a %a\n", expected[ 0 ], expected[ 1 ], expected[ 2 ], expected[ 3 ] );
log_error( " Expected: %08x %08x %08x %08x\n", e[ 0 ], e[ 1 ], e[ 2 ], e[ 3 ] );
log_error( " Actual: %a %a %a %a\n", actual[ 0 ], actual[ 1 ], actual[ 2 ], actual[ 3 ] );
@@ -405,7 +416,9 @@ int test_write_image_1D_array( cl_device_id device, cl_context context, cl_comma
if( !validate_half_write_results( e, a, imageInfo ) )
{
totalErrors++;
log_error( "ERROR: Sample %ld (%ld,%ld) did not validate! (%s)\n", i, x, y, mem_flag_names[ mem_flag_index ] );
log_error("ERROR: Sample %zu (%zu,%zu) did not "
"validate! (%s)\n",
i, x, y, mem_flag_names[mem_flag_index]);
log_error( " Expected: 0x%04x 0x%04x 0x%04x 0x%04x\n", e[ 0 ], e[ 1 ], e[ 2 ], e[ 3 ] );
log_error( " Actual: 0x%04x 0x%04x 0x%04x 0x%04x\n", a[ 0 ], a[ 1 ], a[ 2 ], a[ 3 ] );
if( inputType == kFloat )
@@ -456,7 +469,12 @@ int test_write_image_1D_array( cl_device_id device, cl_context context, cl_comma
deviceResults[ 4 ] == 5 && deviceResults[ 5 ] == 5 && deviceResults[ 6 ] == 6 && deviceResults[ 7 ] == 6 )
deviceRounding = "round to even";
log_error( "ERROR: Rounding mode sample (%ld) did not validate, probably due to the device's rounding mode being wrong (%s)\n", i, mem_flag_names[mem_flag_index] );
log_error(
"ERROR: Rounding mode sample (%zu) did "
"not validate, probably due to the "
"device's rounding mode being wrong "
"(%s)\n",
i, mem_flag_names[mem_flag_index]);
log_error( " Actual values rounded by device: %x %x %x %x %x %x %x %x\n", deviceResults[ 0 ], deviceResults[ 1 ], deviceResults[ 2 ], deviceResults[ 3 ],
deviceResults[ 4 ], deviceResults[ 5 ], deviceResults[ 6 ], deviceResults[ 7 ] );
log_error( " Rounding mode of device appears to be %s\n", deviceRounding );

View File

@@ -245,7 +245,11 @@ int test_write_image_2D_array( cl_device_id device, cl_context context, cl_comma
if( error != CL_SUCCESS )
{
log_error( "ERROR: Unable to create 2D image array of size %ld x %ld x %ld pitch %ld (%s)\n", imageInfo->width, imageInfo->height, imageInfo->arraySize, imageInfo->rowPitch, IGetErrorString( error ) );
log_error("ERROR: Unable to create 2D image array of size %zu "
"x %zu x %zu pitch %zu (%s)\n",
imageInfo->width, imageInfo->height,
imageInfo->arraySize, imageInfo->rowPitch,
IGetErrorString(error));
return error;
}
@@ -269,8 +273,12 @@ int test_write_image_2D_array( cl_device_id device, cl_context context, cl_comma
imageInfo->format, &image_desc, NULL, &error);
if( error != CL_SUCCESS )
{
log_error( "ERROR: Unable to create %d level 2D image array of size %ld x %ld x %ld (%s, %s)\n", imageInfo->num_mip_levels, imageInfo->width, imageInfo->height, imageInfo->arraySize,
IGetErrorString( error ), mem_flag_names[mem_flag_index] );
log_error("ERROR: Unable to create %d level 2D image array "
"of size %zu x %zu x %zu (%s, %s)\n",
imageInfo->num_mip_levels, imageInfo->width,
imageInfo->height, imageInfo->arraySize,
IGetErrorString(error),
mem_flag_names[mem_flag_index]);
return error;
}
}
@@ -280,7 +288,11 @@ int test_write_image_2D_array( cl_device_id device, cl_context context, cl_comma
imageInfo->width, imageInfo->height, imageInfo->arraySize, 0, 0, imageValues, &error );
if( error != CL_SUCCESS )
{
log_error( "ERROR: Unable to create 2D image array of size %ld x %ld x %ld pitch %ld (%s)\n", imageInfo->width, imageInfo->height, imageInfo->arraySize, imageInfo->rowPitch, IGetErrorString( error ) );
log_error("ERROR: Unable to create 2D image array of size "
"%zu x %zu x %zu pitch %zu (%s)\n",
imageInfo->width, imageInfo->height,
imageInfo->arraySize, imageInfo->rowPitch,
IGetErrorString(error));
return error;
}
}
@@ -413,7 +425,10 @@ int test_write_image_2D_array( cl_device_id device, cl_context context, cl_comma
{
unsigned int *e = (unsigned int *)resultBuffer;
unsigned int *a = (unsigned int *)resultPtr;
log_error( "ERROR: Sample %ld (%ld,%ld,%ld) did not validate! (%s)\n", i, x, y, z, mem_flag_names[ mem_flag_index ] );
log_error("ERROR: Sample %zu (%zu,%zu,%zu) did "
"not validate! (%s)\n",
i, x, y, z,
mem_flag_names[mem_flag_index]);
log_error( " Expected: %a %a %a %a\n", expected[ 0 ], expected[ 1 ], expected[ 2 ], expected[ 3 ] );
log_error( " Expected: %08x %08x %08x %08x\n", e[ 0 ], e[ 1 ], e[ 2 ], e[ 3 ] );
log_error( " Actual: %a %a %a %a\n", actual[ 0 ], actual[ 1 ], actual[ 2 ], actual[ 3 ] );
@@ -430,7 +445,10 @@ int test_write_image_2D_array( cl_device_id device, cl_context context, cl_comma
if( !validate_half_write_results( e, a, imageInfo ) )
{
totalErrors++;
log_error( "ERROR: Sample %ld (%ld,%ld,%ld) did not validate! (%s)\n", i, x, y, z, mem_flag_names[ mem_flag_index ] );
log_error("ERROR: Sample %zu (%zu,%zu,%zu) did "
"not validate! (%s)\n",
i, x, y, z,
mem_flag_names[mem_flag_index]);
unsigned short *e = (unsigned short *)resultBuffer;
unsigned short *a = (unsigned short *)resultPtr;
log_error( " Expected: 0x%04x 0x%04x 0x%04x 0x%04x\n", e[ 0 ], e[ 1 ], e[ 2 ], e[ 3 ] );
@@ -484,7 +502,12 @@ int test_write_image_2D_array( cl_device_id device, cl_context context, cl_comma
deviceResults[ 4 ] == 5 && deviceResults[ 5 ] == 5 && deviceResults[ 6 ] == 6 && deviceResults[ 7 ] == 6 )
deviceRounding = "round to even";
log_error( "ERROR: Rounding mode sample (%ld) did not validate, probably due to the device's rounding mode being wrong (%s)\n", i, mem_flag_names[mem_flag_index] );
log_error(
"ERROR: Rounding mode sample (%zu) "
"did not validate, probably due to "
"the device's rounding mode being "
"wrong (%s)\n",
i, mem_flag_names[mem_flag_index]);
log_error( " Actual values rounded by device: %d %d %d %d %d %d %d %d\n", deviceResults[ 0 ], deviceResults[ 1 ], deviceResults[ 2 ], deviceResults[ 3 ],
deviceResults[ 4 ], deviceResults[ 5 ], deviceResults[ 6 ], deviceResults[ 7 ] );
log_error( " Rounding mode of device appears to be %s\n", deviceRounding );
@@ -804,8 +827,11 @@ int test_write_image_2D_array_set(cl_device_id device, cl_context context,
} while( size > maxAllocSize || buffSize > maxAllocSize || ( size * 3 ) > memSize );
if( gDebugTrace )
log_info( " at size %ld,%ld,%ld (pitch %ld, slice %ld) out of %ld,%ld,%ld\n", imageInfo.width, imageInfo.height, imageInfo.arraySize,
imageInfo.rowPitch, imageInfo.slicePitch, maxWidth, maxHeight, maxArraySize );
log_info(" at size %zu,%zu,%zu (pitch %zu, slice %zu) out of "
"%zu,%zu,%zu\n",
imageInfo.width, imageInfo.height, imageInfo.arraySize,
imageInfo.rowPitch, imageInfo.slicePitch, maxWidth,
maxHeight, maxArraySize);
int retCode = test_write_image_2D_array( device, context, queue, kernel, &imageInfo, inputType, d );
if( retCode )

View File

@@ -249,7 +249,10 @@ int test_write_image_3D( cl_device_id device, cl_context context, cl_command_que
if( error != CL_SUCCESS )
{
log_error( "ERROR: Unable to create 3D image of size %ld x %ld x %ld pitch %ld (%s)\n", imageInfo->width, imageInfo->height, imageInfo->depth, imageInfo->rowPitch, IGetErrorString( error ) );
log_error("ERROR: Unable to create 3D image of size %zu x %zu "
"x %zu pitch %zu (%s)\n",
imageInfo->width, imageInfo->height, imageInfo->depth,
imageInfo->rowPitch, IGetErrorString(error));
return error;
}
@@ -273,8 +276,12 @@ int test_write_image_3D( cl_device_id device, cl_context context, cl_command_que
imageInfo->format, &image_desc, NULL, &error);
if( error != CL_SUCCESS )
{
log_error( "ERROR: Unable to create %d level mipmapped 3D image of size %ld x %ld *%ld (%s, %s)\n", imageInfo->num_mip_levels, imageInfo->width, imageInfo->height, imageInfo->depth,
IGetErrorString( error ), mem_flag_names[mem_flag_index] );
log_error("ERROR: Unable to create %d level mipmapped 3D "
"image of size %zu x %zu *%zu (%s, %s)\n",
imageInfo->num_mip_levels, imageInfo->width,
imageInfo->height, imageInfo->depth,
IGetErrorString(error),
mem_flag_names[mem_flag_index]);
return error;
}
}
@@ -284,7 +291,11 @@ int test_write_image_3D( cl_device_id device, cl_context context, cl_command_que
imageInfo->width, imageInfo->height, imageInfo->depth, 0, 0, imageValues, &error );
if( error != CL_SUCCESS )
{
log_error( "ERROR: Unable to create 3D image of size %ld x %ld x %ld pitch %ld (%s)\n", imageInfo->width, imageInfo->height, imageInfo->depth, imageInfo->rowPitch, IGetErrorString( error ) );
log_error("ERROR: Unable to create 3D image of size %zu x "
"%zu x %zu pitch %zu (%s)\n",
imageInfo->width, imageInfo->height,
imageInfo->depth, imageInfo->rowPitch,
IGetErrorString(error));
return error;
}
}
@@ -420,7 +431,10 @@ int test_write_image_3D( cl_device_id device, cl_context context, cl_command_que
{
unsigned int *e = (unsigned int *)resultBuffer;
unsigned int *a = (unsigned int *)resultPtr;
log_error( "ERROR: Sample %ld (%ld,%ld,%ld) did not validate! (%s)\n", i, x, y, z, mem_flag_names[ mem_flag_index ] );
log_error("ERROR: Sample %zu (%zu,%zu,%zu) did "
"not validate! (%s)\n",
i, x, y, z,
mem_flag_names[mem_flag_index]);
log_error( " Expected: %a %a %a %a\n", expected[ 0 ], expected[ 1 ], expected[ 2 ], expected[ 3 ] );
log_error( " Expected: %08x %08x %08x %08x\n", e[ 0 ], e[ 1 ], e[ 2 ], e[ 3 ] );
log_error( " Actual: %a %a %a %a\n", actual[ 0 ], actual[ 1 ], actual[ 2 ], actual[ 3 ] );
@@ -437,7 +451,10 @@ int test_write_image_3D( cl_device_id device, cl_context context, cl_command_que
if( !validate_half_write_results( e, a, imageInfo ) )
{
totalErrors++;
log_error( "ERROR: Sample %ld (%ld,%ld,%ld) did not validate! (%s)\n", i, x, y, z, mem_flag_names[ mem_flag_index ] );
log_error("ERROR: Sample %zu (%zu,%zu,%zu) did "
"not validate! (%s)\n",
i, x, y, z,
mem_flag_names[mem_flag_index]);
unsigned short *e = (unsigned short *)resultBuffer;
unsigned short *a = (unsigned short *)resultPtr;
log_error( " Expected: 0x%04x 0x%04x 0x%04x 0x%04x\n", e[ 0 ], e[ 1 ], e[ 2 ], e[ 3 ] );
@@ -491,7 +508,12 @@ int test_write_image_3D( cl_device_id device, cl_context context, cl_command_que
deviceResults[ 4 ] == 5 && deviceResults[ 5 ] == 5 && deviceResults[ 6 ] == 6 && deviceResults[ 7 ] == 6 )
deviceRounding = "round to even";
log_error( "ERROR: Rounding mode sample (%ld) did not validate, probably due to the device's rounding mode being wrong (%s)\n", i, mem_flag_names[mem_flag_index] );
log_error(
"ERROR: Rounding mode sample (%zu) "
"did not validate, probably due to "
"the device's rounding mode being "
"wrong (%s)\n",
i, mem_flag_names[mem_flag_index]);
log_error( " Actual values rounded by device: %d %d %d %d %d %d %d %d\n", deviceResults[ 0 ], deviceResults[ 1 ], deviceResults[ 2 ], deviceResults[ 3 ],
deviceResults[ 4 ], deviceResults[ 5 ], deviceResults[ 6 ], deviceResults[ 7 ] );
log_error( " Rounding mode of device appears to be %s\n", deviceRounding );
@@ -798,8 +820,11 @@ int test_write_image_3D_set(cl_device_id device, cl_context context,
} while( size > maxAllocSize || ( size * 3 ) > memSize );
if( gDebugTrace )
log_info( " at size %ld,%ld,%ld (pitch %ld, slice %ld) out of %ld,%ld,%ld\n", imageInfo.width, imageInfo.height, imageInfo.depth,
imageInfo.rowPitch, imageInfo.slicePitch, maxWidth, maxHeight, maxDepth );
log_info(" at size %zu,%zu,%zu (pitch %zu, slice %zu) out of "
"%zu,%zu,%zu\n",
imageInfo.width, imageInfo.height, imageInfo.depth,
imageInfo.rowPitch, imageInfo.slicePitch, maxWidth,
maxHeight, maxDepth);
int retCode = test_write_image_3D( device, context, queue, kernel, &imageInfo, inputType, d );
if( retCode )

View File

@@ -261,8 +261,11 @@ int test_write_image( cl_device_id device, cl_context context, cl_command_queue
}
}
log_error( "ERROR: Unable to create 2D image of size %ld x %ld pitch %ld (%s, %s)\n", imageInfo->width, imageInfo->height,
imageInfo->rowPitch, IGetErrorString( error ), mem_flag_names[mem_flag_index] );
log_error("ERROR: Unable to create 2D image of size %zu x %zu "
"pitch %zu (%s, %s)\n",
imageInfo->width, imageInfo->height,
imageInfo->rowPitch, IGetErrorString(error),
mem_flag_names[mem_flag_index]);
return error;
}
@@ -285,8 +288,11 @@ int test_write_image( cl_device_id device, cl_context context, cl_command_queue
imageInfo->format, &image_desc, NULL, &error);
if( error != CL_SUCCESS )
{
log_error( "ERROR: Unable to create %d level 2D image of size %ld x %ld (%s, %s)\n", imageInfo->num_mip_levels, imageInfo->width, imageInfo->height,
IGetErrorString( error ), mem_flag_names[mem_flag_index] );
log_error("ERROR: Unable to create %d level 2D image of "
"size %zu x %zu (%s, %s)\n",
imageInfo->num_mip_levels, imageInfo->width,
imageInfo->height, IGetErrorString(error),
mem_flag_names[mem_flag_index]);
return error;
}
}
@@ -320,8 +326,11 @@ int test_write_image( cl_device_id device, cl_context context, cl_command_queue
}
}
log_error( "ERROR: Unable to create 2D image of size %ld x %ld pitch %ld (%s, %s)\n", imageInfo->width, imageInfo->height,
imageInfo->rowPitch, IGetErrorString( error ), mem_flag_names[mem_flag_index] );
log_error("ERROR: Unable to create 2D image of size %zu x %zu "
"pitch %zu (%s, %s)\n",
imageInfo->width, imageInfo->height,
imageInfo->rowPitch, IGetErrorString(error),
mem_flag_names[mem_flag_index]);
return error;
}
image = unprotImage;
@@ -450,7 +459,9 @@ int test_write_image( cl_device_id device, cl_context context, cl_command_queue
{
unsigned int *e = (unsigned int *)resultBuffer;
unsigned int *a = (unsigned int *)resultPtr;
log_error( "ERROR: Sample %ld (%ld,%ld) did not validate! (%s)\n", i, x, y, mem_flag_names[ mem_flag_index ] );
log_error("ERROR: Sample %zu (%zu,%zu) did not "
"validate! (%s)\n",
i, x, y, mem_flag_names[mem_flag_index]);
log_error( " Expected: %a %a %a %a\n", expected[ 0 ], expected[ 1 ], expected[ 2 ], expected[ 3 ] );
log_error( " Expected: %08x %08x %08x %08x\n", e[ 0 ], e[ 1 ], e[ 2 ], e[ 3 ] );
log_error( " Actual: %a %a %a %a\n", actual[ 0 ], actual[ 1 ], actual[ 2 ], actual[ 3 ] );
@@ -467,7 +478,9 @@ int test_write_image( cl_device_id device, cl_context context, cl_command_queue
if( !validate_half_write_results( e, a, imageInfo ) )
{
totalErrors++;
log_error( "ERROR: Sample %ld (%ld,%ld) did not validate! (%s)\n", i, x, y, mem_flag_names[ mem_flag_index ] );
log_error("ERROR: Sample %zu (%zu,%zu) did not "
"validate! (%s)\n",
i, x, y, mem_flag_names[mem_flag_index]);
log_error( " Expected: 0x%04x 0x%04x 0x%04x 0x%04x\n", e[ 0 ], e[ 1 ], e[ 2 ], e[ 3 ] );
log_error( " Actual: 0x%04x 0x%04x 0x%04x 0x%04x\n", a[ 0 ], a[ 1 ], a[ 2 ], a[ 3 ] );
if( inputType == kFloat )
@@ -518,7 +531,12 @@ int test_write_image( cl_device_id device, cl_context context, cl_command_queue
deviceResults[ 4 ] == 5 && deviceResults[ 5 ] == 5 && deviceResults[ 6 ] == 6 && deviceResults[ 7 ] == 6 )
deviceRounding = "round to even";
log_error( "ERROR: Rounding mode sample (%ld) did not validate, probably due to the device's rounding mode being wrong (%s)\n", i, mem_flag_names[mem_flag_index] );
log_error(
"ERROR: Rounding mode sample (%zu) did "
"not validate, probably due to the "
"device's rounding mode being wrong "
"(%s)\n",
i, mem_flag_names[mem_flag_index]);
log_error( " Actual values rounded by device: %x %x %x %x %x %x %x %x\n", deviceResults[ 0 ], deviceResults[ 1 ], deviceResults[ 2 ], deviceResults[ 3 ],
deviceResults[ 4 ], deviceResults[ 5 ], deviceResults[ 6 ], deviceResults[ 7 ] );
log_error( " Rounding mode of device appears to be %s\n", deviceRounding );