Remove unused code in kernel_read_write (#1050)

These declarations either aren't used or aren't needed, as testBase.h
already declares them.

Some definitions got moved to test_common.h, as these are duplicated
across few files. There's further opportunity to improve code reuse
via test_common.h, but that's for future patch.

Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
This commit is contained in:
Radek Szymanski
2020-11-20 15:06:40 +01:00
committed by GitHub
parent bf3d3fef75
commit 956d9a05e6
13 changed files with 13 additions and 113 deletions

View File

@@ -13,22 +13,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
#include "../harness/compat.h"
#include <stdio.h>
#include <string.h>
#if !defined(_WIN32)
#include <unistd.h>
#include <sys/time.h>
#endif
#include "../testBase.h"
#include "../harness/compat.h"
#include "../harness/fpcontrol.h"
#include "../harness/parseParameters.h"
#include <vector>
#if defined(__PPC__)
// Global varaiable used to hold the FPU control register state. The FPSCR register can not
// be used because not all Power implementations retain or observed the NI (non-IEEE
@@ -58,8 +50,6 @@ bool gEnablePitch = false;
int gtestTypesToRun = 0;
static int testTypesToRun;
#define MAX_ALLOWED_STD_DEVIATION_IN_MB 8.0
static void printUsage( const char *execName );
extern int test_image_set( cl_device_id device, cl_context context, cl_command_queue queue, test_format_set_fn formatTestFn, cl_mem_object_type imageType );

View File

@@ -2,6 +2,15 @@
#include "../testBase.h"
#define ABS_ERROR(result, expected) (fabs(expected - result))
#define CLAMP(_val, _min, _max) \
((_val) < (_min) ? (_min) : (_val) > (_max) ? (_max) : (_val))
#define MAX_ERR 0.005f
#define MAX_TRIES 1
#define MAX_CLAMPED 1
extern cl_sampler create_sampler(cl_context context, image_sampler_data *sdata, bool test_mipmaps, cl_int *error);
extern bool gExtraValidateInfo;
extern bool gDisableOffsets;
extern bool gUseKernelSamplers;

View File

@@ -22,21 +22,12 @@
#include <setjmp.h>
#endif
#define MAX_ERR 0.005f
#define MAX_HALF_LINEAR_ERR 0.3f
extern bool gDebugTrace, gExtraValidateInfo, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestImage2DFromBuffer, gTestMipmaps;
extern bool gUseKernelSamplers;
extern cl_filter_mode gFilterModeToUse;
extern cl_addressing_mode gAddressModeToUse;
extern bool gTestImage2DFromBuffer;
extern uint64_t gRoundingStartValue;
extern cl_mem_flags gMemFlagsToUse;
extern int gtestTypesToRun;
extern bool gDeviceLt20;
#define MAX_TRIES 1
#define MAX_CLAMPED 1
// Utility function to clamp down image sizes for certain tests to avoid
// using too much memory.
static size_t reduceImageSizeRange(size_t maxDimSize) {
@@ -290,8 +281,6 @@ template <class T> int determine_validation_error( void *imagePtr, image_descrip
return 0;
}
#define CLAMP( _val, _min, _max ) ((_val) < (_min) ? (_min) : (_val) > (_max) ? (_max) : (_val))
static void InitFloatCoords( image_descriptor *imageInfo, image_sampler_data *imageSampler, float *xOffsets, float *yOffsets, float xfract, float yfract, int normalized_coords, MTdata d )
{
size_t i = 0;
@@ -404,9 +393,6 @@ static void InitFloatCoords( image_descriptor *imageInfo, image_sampler_data *im
}
}
}
#ifndef MAX
#define MAX( _a, _b ) ((_a) > (_b) ? (_a) : (_b))
#endif
int validate_image_2D_depth_results(void *imageValues, void *resultValues, double formatAbsoluteError, float *xOffsetValues, float *yOffsetValues,
ExplicitType outputType, int &numTries, int &numClamped, image_sampler_data *imageSampler, image_descriptor *imageInfo, size_t lod, char *imagePtr)

View File

@@ -18,16 +18,9 @@
extern cl_filter_mode gFilterModeToUse;
extern cl_addressing_mode gAddressModeToUse;
extern int gTypesToTest;
extern int gNormalizedModeToUse;
extern cl_channel_type gChannelTypeToUse;
extern cl_channel_order gChannelOrderToUse;
extern bool gDebugTrace;
extern bool gTestMipmaps;
extern int gTypesToTest;
extern int gtestTypesToRun;
extern bool gDeviceLt20;
extern int test_read_image_set_1D(cl_device_id device, cl_context context,
cl_command_queue queue,

View File

@@ -23,21 +23,11 @@
#include <setjmp.h>
#endif
#define MAX_ERR 0.005f
#define MAX_HALF_LINEAR_ERR 0.3f
extern bool gDebugTrace, gExtraValidateInfo, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestMipmaps;
extern bool gUseKernelSamplers;
extern cl_filter_mode gFilterModeToUse;
extern cl_addressing_mode gAddressModeToUse;
extern uint64_t gRoundingStartValue;
extern cl_mem_flags gMemFlagsToUse;
extern int gtestTypesToRun;
extern bool gDeviceLt20;
#define MAX_TRIES 1
#define MAX_CLAMPED 1
const char *read1DKernelSourcePattern =
"__kernel void sample_kernel( read_only image1d_t input,%s __global float *xOffsets, __global %s4 *results %s)\n"
"{\n"
@@ -184,8 +174,6 @@ template <class T> int determine_validation_error_1D( void *imagePtr, image_desc
return 0;
}
#define CLAMP( _val, _min, _max ) ((_val) < (_min) ? (_min) : (_val) > (_max) ? (_max) : (_val))
static void InitFloatCoords( image_descriptor *imageInfo, image_sampler_data *imageSampler, float *xOffsets, float xfract, int normalized_coords, MTdata d, int lod)
{
size_t i = 0;
@@ -228,11 +216,6 @@ static void InitFloatCoords( image_descriptor *imageInfo, image_sampler_data *im
}
}
#ifndef MAX
#define MAX( _a, _b ) ((_a) > (_b) ? (_a) : (_b))
#endif
int test_read_image_1D( cl_context context, cl_command_queue queue, cl_kernel kernel,
image_descriptor *imageInfo, image_sampler_data *imageSampler,
bool useFloatCoords, ExplicitType outputType, MTdata d )

View File

@@ -22,21 +22,11 @@
#include <setjmp.h>
#endif
#define MAX_ERR 0.005f
#define MAX_HALF_LINEAR_ERR 0.3f
extern bool gDebugTrace, gExtraValidateInfo, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestMipmaps;
extern bool gUseKernelSamplers;
extern cl_filter_mode gFilterModeToUse;
extern cl_addressing_mode gAddressModeToUse;
extern uint64_t gRoundingStartValue;
extern cl_mem_flags gMemFlagsToUse;
extern int gtestTypesToRun;
extern bool gDeviceLt20;
#define MAX_TRIES 1
#define MAX_CLAMPED 1
const char *read1DArrayKernelSourcePattern =
"__kernel void sample_kernel( read_only image1d_array_t input,%s __global float *xOffsets, __global float *yOffsets, __global %s4 *results %s)\n"
"{\n"
@@ -218,8 +208,6 @@ template <class T> int determine_validation_error_1D_arr( void *imagePtr, image_
return 0;
}
#define CLAMP( _val, _min, _max ) ((_val) < (_min) ? (_min) : (_val) > (_max) ? (_max) : (_val))
static void InitFloatCoords( image_descriptor *imageInfo, image_sampler_data *imageSampler, float *xOffsets, float *yOffsets, float xfract, float yfract, int normalized_coords, MTdata d , int lod)
{
size_t i = 0;
@@ -277,11 +265,6 @@ static void InitFloatCoords( image_descriptor *imageInfo, image_sampler_data *im
}
}
#ifndef MAX
#define MAX( _a, _b ) ((_a) > (_b) ? (_a) : (_b))
#endif
int test_read_image_1D_array( cl_context context, cl_command_queue queue, cl_kernel kernel,
image_descriptor *imageInfo, image_sampler_data *imageSampler,
bool useFloatCoords, ExplicitType outputType, MTdata d )

View File

@@ -16,18 +16,9 @@
#include "test_common.h"
#include <float.h>
#define MAX_ERR 0.005f
#define MAX_HALF_LINEAR_ERR 0.3f
extern bool gDebugTrace, gExtraValidateInfo, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestMipmaps;
extern bool gUseKernelSamplers;
extern cl_filter_mode gFilterModeToUse;
extern cl_addressing_mode gAddressModeToUse;
extern cl_mem_flags gMemFlagsToUse;
extern int gtestTypesToRun;
extern bool gDeviceLt20;
#define MAX_TRIES 1
#define MAX_CLAMPED 1
// Utility function to clamp down image sizes for certain tests to avoid
// using too much memory.
@@ -230,8 +221,6 @@ template <class T> int determine_validation_error_offset_2D_array( void *imagePt
return 0;
}
#define CLAMP( _val, _min, _max ) ((_val) < (_min) ? (_min) : (_val) > (_max) ? (_max) : (_val))
static void InitFloatCoords( image_descriptor *imageInfo, image_sampler_data *imageSampler, float *xOffsets, float *yOffsets, float *zOffsets, float xfract, float yfract, float zfract, int normalized_coords, MTdata d , int lod)
{
size_t i = 0;
@@ -308,10 +297,6 @@ static void InitFloatCoords( image_descriptor *imageInfo, image_sampler_data *im
}
}
#ifndef MAX
#define MAX(_a, _b) ((_a) > (_b) ? (_a) : (_b))
#endif
int test_read_image_2D_array( cl_context context, cl_command_queue queue, cl_kernel kernel,
image_descriptor *imageInfo, image_sampler_data *imageSampler,
bool useFloatCoords, ExplicitType outputType, MTdata d )

View File

@@ -16,21 +16,10 @@
#include "test_common.h"
#include <float.h>
#define MAX_ERR 0.005f
#define MAX_HALF_LINEAR_ERR 0.3f
extern bool gDebugTrace, gExtraValidateInfo, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestMipmaps;
extern bool gUseKernelSamplers;
extern cl_filter_mode gFilterModeToUse;
extern cl_addressing_mode gAddressModeToUse;
extern cl_mem_flags gMemFlagsToUse;
extern int gtestTypesToRun;
extern bool gDeviceLt20;
#define MAX_TRIES 1
#define MAX_CLAMPED 1
// Utility function to clamp down image sizes for certain tests to avoid
// using too much memory.
static size_t reduceImageSizeRange(size_t maxDimSize, RandomSeed& seed) {
@@ -214,8 +203,6 @@ template <class T> int determine_validation_error_offset( void *imagePtr, image_
return 0;
}
#define CLAMP( _val, _min, _max ) ((_val) < (_min) ? (_min) : (_val) > (_max) ? (_max) : (_val))
static void InitFloatCoords( image_descriptor *imageInfo, image_sampler_data *imageSampler, float *xOffsets, float *yOffsets, float *zOffsets, float xfract, float yfract, float zfract, int normalized_coords, MTdata d , int lod)
{
size_t i = 0;
@@ -309,10 +296,6 @@ static void InitFloatCoords( image_descriptor *imageInfo, image_sampler_data *im
}
}
#ifndef MAX
#define MAX(_a, _b) ((_a) > (_b) ? (_a) : (_b))
#endif
int test_read_image_3D( cl_context context, cl_command_queue queue, cl_kernel kernel,
image_descriptor *imageInfo, image_sampler_data *imageSampler,
bool useFloatCoords, ExplicitType outputType, MTdata d )

View File

@@ -19,10 +19,7 @@
#include <sys/mman.h>
#endif
extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestMipmaps;
extern cl_filter_mode gFilterModeToSkip;
extern cl_mem_flags gMemFlagsToUse;
extern int gtestTypesToRun;
extern bool gDeviceLt20;

View File

@@ -19,8 +19,6 @@
#include <sys/mman.h>
#endif
extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestMipmaps;
extern cl_filter_mode gFilterModeToSkip;
extern cl_mem_flags gMemFlagsToUse;
extern int gtestTypesToRun;
extern bool gDeviceLt20;

View File

@@ -19,10 +19,7 @@
#include <sys/mman.h>
#endif
extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestMipmaps;
extern cl_filter_mode gFilterModeToSkip;
extern cl_mem_flags gMemFlagsToUse;
extern int gtestTypesToRun;
extern bool gDeviceLt20;

View File

@@ -19,10 +19,7 @@
#include <sys/mman.h>
#endif
extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestMipmaps;
extern cl_filter_mode gFilterModeToSkip;
extern cl_mem_flags gMemFlagsToUse;
extern int gtestTypesToRun;
extern bool gDeviceLt20;

View File

@@ -19,8 +19,7 @@
#include <sys/mman.h>
#endif
extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestImage2DFromBuffer, gTestMipmaps;
extern cl_filter_mode gFilterModeToSkip;
extern bool gTestImage2DFromBuffer;
extern cl_mem_flags gMemFlagsToUse;
extern int gtestTypesToRun;
extern bool gDeviceLt20;