clean unused variables (#2446)

Do not remove calls to `sample_image_pixel_float_offset` as it is using
the `verbose` mode.
This commit is contained in:
Romaric Jodin
2025-07-16 01:36:49 +02:00
committed by GitHub
parent 2fdefbdf34
commit d918b41657
2 changed files with 49 additions and 56 deletions

View File

@@ -878,18 +878,16 @@ int test_read_image(cl_context context, cl_command_queue queue,
numTries, numClamped, numTries, numClamped,
true, lod); true, lod);
log_error("Step by step:\n"); log_error("Step by step:\n");
FloatPixel temp = sample_image_pixel_float_offset(
sample_image_pixel_float_offset( imagePtr, imageInfo,
imagePtr, imageInfo, xOffsetValues[j],
xOffsetValues[j], yOffsetValues[j],
yOffsetValues[j], zOffsetValues[j],
zOffsetValues[j], norm_offset_x,
norm_offset_x, norm_offset_y,
norm_offset_y, norm_offset_z, imageSampler,
norm_offset_z, tempOut, 1 /*verbose*/,
imageSampler, tempOut, &hasDenormals, lod);
1 /*verbose*/,
&hasDenormals, lod);
log_error( log_error(
"\tulps: %2.2f (max " "\tulps: %2.2f (max "
"allowed: %2.2f)\n\n", "allowed: %2.2f)\n\n",
@@ -931,9 +929,6 @@ int test_read_image(cl_context context, cl_command_queue queue,
// Validate float results // Validate float results
float *resultPtr = (float *)(char *)resultValues; float *resultPtr = (float *)(char *)resultValues;
float expected[4], error = 0.0f; float expected[4], error = 0.0f;
float maxErr = get_max_relative_error(
imageInfo->format, imageSampler, image_type_3D,
CL_FILTER_LINEAR == imageSampler->filter_mode);
for (size_t z = 0, j = 0; z < depth_lod; z++) for (size_t z = 0, j = 0; z < depth_lod; z++)
{ {
@@ -1242,26 +1237,25 @@ int test_read_image(cl_context context, cl_command_queue queue,
j, numTries, numClamped, j, numTries, numClamped,
true, lod); true, lod);
log_error("Step by step:\n"); log_error("Step by step:\n");
FloatPixel temp = sample_image_pixel_float_offset(
sample_image_pixel_float_offset( imagePtr, imageInfo,
imagePtr, imageInfo, xOffsetValues[j],
xOffsetValues[j], (num_dimensions > 1)
(num_dimensions > 1) ? yOffsetValues[j]
? yOffsetValues[j] : 0.0f,
: 0.0f, image_type_3D
image_type_3D ? zOffsetValues[j]
? zOffsetValues[j] : 0.0f,
: 0.0f, norm_offset_x,
norm_offset_x, (num_dimensions > 1)
(num_dimensions > 1) ? norm_offset_y
? norm_offset_y : 0.0f,
: 0.0f, image_type_3D
image_type_3D ? norm_offset_z
? norm_offset_z : 0.0f,
: 0.0f, imageSampler, tempOut,
imageSampler, tempOut, 1 /*verbose*/,
1 /*verbose*/, &hasDenormals, lod);
&hasDenormals, lod);
log_error( log_error(
"\tulps: %2.2f, %2.2f, " "\tulps: %2.2f, %2.2f, "
"%2.2f, %2.2f (max " "%2.2f, %2.2f (max "
@@ -1632,26 +1626,25 @@ int test_read_image(cl_context context, cl_command_queue queue,
j, numTries, numClamped, j, numTries, numClamped,
true, lod); true, lod);
log_error("Step by step:\n"); log_error("Step by step:\n");
FloatPixel temp = sample_image_pixel_float_offset(
sample_image_pixel_float_offset( imagePtr, imageInfo,
imagePtr, imageInfo, xOffsetValues[j],
xOffsetValues[j], (num_dimensions > 1)
(num_dimensions > 1) ? yOffsetValues[j]
? yOffsetValues[j] : 0.0f,
: 0.0f, image_type_3D
image_type_3D ? zOffsetValues[j]
? zOffsetValues[j] : 0.0f,
: 0.0f, norm_offset_x,
norm_offset_x, (num_dimensions > 1)
(num_dimensions > 1) ? norm_offset_y
? norm_offset_y : 0.0f,
: 0.0f, image_type_3D
image_type_3D ? norm_offset_z
? norm_offset_z : 0.0f,
: 0.0f, imageSampler, tempOut,
imageSampler, tempOut, 1 /*verbose*/,
1 /*verbose*/, &hasDenormals, lod);
&hasDenormals, lod);
log_error( log_error(
"\tulps: %2.2f, %2.2f, " "\tulps: %2.2f, %2.2f, "
"%2.2f, %2.2f (max " "%2.2f, %2.2f (max "

View File

@@ -945,7 +945,7 @@ int validate_image_2D_sRGB_results(void *imageValues, void *resultValues, double
// Validate float results // Validate float results
float *resultPtr = (float *)(char *)resultValues; float *resultPtr = (float *)(char *)resultValues;
float expected[4], error=0.0f; float expected[4], error=0.0f;
float maxErr = get_max_relative_error( imageInfo->format, imageSampler, 0 /*not 3D*/, CL_FILTER_LINEAR == imageSampler->filter_mode );
for( size_t y = 0, j = 0; y < height_lod; y++ ) for( size_t y = 0, j = 0; y < height_lod; y++ )
{ {
for( size_t x = 0; x < width_lod; x++, j++ ) for( size_t x = 0; x < width_lod; x++, j++ )