diff --git a/test_conformance/images/clCopyImage/main.cpp b/test_conformance/images/clCopyImage/main.cpp index 04a8f51d..f64119e9 100644 --- a/test_conformance/images/clCopyImage/main.cpp +++ b/test_conformance/images/clCopyImage/main.cpp @@ -13,23 +13,16 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../harness/compat.h" #include #include - -#if !defined(_WIN32) -#include -#include -#endif - #include "../testBase.h" +#include "../harness/compat.h" #include "../harness/testHarness.h" bool gDebugTrace; bool gTestSmallImages; bool gTestMaxImages; -bool gUseRamp; bool gEnablePitch; bool gTestMipmaps; int gTypesToTest; @@ -38,8 +31,6 @@ cl_channel_order gChannelOrderToUse = (cl_channel_order)-1; extern int test_image_set( cl_device_id device, cl_context context, cl_command_queue queue, MethodsToTest testMethod ); -#define MAX_ALLOWED_STD_DEVIATION_IN_MB 8.0 - static void printUsage( const char *execName ); int test_1D(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) @@ -135,8 +126,6 @@ int main(int argc, const char *argv[]) gTestSmallImages = true; else if( strcmp( argv[i], "max_images" ) == 0 ) gTestMaxImages = true; - else if( strcmp( argv[i], "use_ramps" ) == 0 ) - gUseRamp = true; else if( strcmp( argv[i], "use_pitches" ) == 0 ) gEnablePitch = true; @@ -182,7 +171,6 @@ static void printUsage( const char *execName ) log_info( "\tmax_images - Runs every format through a set of size combinations with the max values, max values - 1, and max values / 128\n" ); log_info( "\trandomize - Use random seed\n" ); log_info( "\tuse_pitches - Enables row and slice pitches\n" ); - log_info( "\tuse_ramp - Instead of random data, uses images filled with ramps (and 0xff on any padding pixels) to ease debugging\n" ); log_info( "\n" ); log_info( "Test names:\n" ); for( int i = 0; i < test_num; i++ ) diff --git a/test_conformance/images/clCopyImage/test_copy_1D.cpp b/test_conformance/images/clCopyImage/test_copy_1D.cpp index ab223202..2c996c72 100644 --- a/test_conformance/images/clCopyImage/test_copy_1D.cpp +++ b/test_conformance/images/clCopyImage/test_copy_1D.cpp @@ -15,14 +15,6 @@ // #include "../testBase.h" -#define MAX_ERR 0.005f -#define MAX_HALF_LINEAR_ERR 0.3f - -extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestMipmaps; -extern cl_filter_mode gFilterModeToUse; -extern cl_addressing_mode gAddressModeToUse; -extern uint64_t gRoundingStartValue; - extern int test_copy_image_generic( cl_context context, cl_command_queue queue, image_descriptor *srcImageInfo, image_descriptor *dstImageInfo, const size_t sourcePos[], const size_t destPos[], const size_t regionSize[], MTdata d ); diff --git a/test_conformance/images/clCopyImage/test_copy_1D_array.cpp b/test_conformance/images/clCopyImage/test_copy_1D_array.cpp index 62eed3fd..0b616934 100644 --- a/test_conformance/images/clCopyImage/test_copy_1D_array.cpp +++ b/test_conformance/images/clCopyImage/test_copy_1D_array.cpp @@ -15,14 +15,6 @@ // #include "../testBase.h" -#define MAX_ERR 0.005f -#define MAX_HALF_LINEAR_ERR 0.3f - -extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestMipmaps; -extern cl_filter_mode gFilterModeToUse; -extern cl_addressing_mode gAddressModeToUse; -extern uint64_t gRoundingStartValue; - extern int test_copy_image_generic( cl_context context, cl_command_queue queue, image_descriptor *srcImageInfo, image_descriptor *dstImageInfo, const size_t sourcePos[], const size_t destPos[], const size_t regionSize[], MTdata d ); diff --git a/test_conformance/images/clCopyImage/test_copy_2D.cpp b/test_conformance/images/clCopyImage/test_copy_2D.cpp index 7af2fe3e..1a69a1fe 100644 --- a/test_conformance/images/clCopyImage/test_copy_2D.cpp +++ b/test_conformance/images/clCopyImage/test_copy_2D.cpp @@ -15,14 +15,6 @@ // #include "../testBase.h" -#define MAX_ERR 0.005f -#define MAX_HALF_LINEAR_ERR 0.3f - -extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestMipmaps; -extern cl_filter_mode gFilterModeToUse; -extern cl_addressing_mode gAddressModeToUse; -extern uint64_t gRoundingStartValue; - extern int test_copy_image_generic( cl_context context, cl_command_queue queue, image_descriptor *srcImageInfo, image_descriptor *dstImageInfo, const size_t sourcePos[], const size_t destPos[], const size_t regionSize[], MTdata d ); diff --git a/test_conformance/images/clCopyImage/test_copy_2D_2D_array.cpp b/test_conformance/images/clCopyImage/test_copy_2D_2D_array.cpp index f784230f..eb6dd552 100644 --- a/test_conformance/images/clCopyImage/test_copy_2D_2D_array.cpp +++ b/test_conformance/images/clCopyImage/test_copy_2D_2D_array.cpp @@ -16,14 +16,6 @@ #include "../testBase.h" #include "../common.h" -#define MAX_ERR 0.005f -#define MAX_HALF_LINEAR_ERR 0.3f - -extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gTestMaxImages, gEnablePitch, gTestMipmaps; -extern cl_filter_mode gFilterModeToUse; -extern cl_addressing_mode gAddressModeToUse; -extern uint64_t gRoundingStartValue; - extern int test_copy_image_generic( cl_context context, cl_command_queue queue, image_descriptor *srcImageInfo, image_descriptor *dstImageInfo, const size_t sourcePos[], const size_t destPos[], const size_t regionSize[], MTdata d ); diff --git a/test_conformance/images/clCopyImage/test_copy_2D_3D.cpp b/test_conformance/images/clCopyImage/test_copy_2D_3D.cpp index d341455e..8a56c95f 100644 --- a/test_conformance/images/clCopyImage/test_copy_2D_3D.cpp +++ b/test_conformance/images/clCopyImage/test_copy_2D_3D.cpp @@ -16,14 +16,6 @@ #include "../testBase.h" #include "../common.h" -#define MAX_ERR 0.005f -#define MAX_HALF_LINEAR_ERR 0.3f - -extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gTestMaxImages, gEnablePitch, gTestMipmaps; -extern cl_filter_mode gFilterModeToUse; -extern cl_addressing_mode gAddressModeToUse; -extern uint64_t gRoundingStartValue; - extern int test_copy_image_generic( cl_context context, cl_command_queue queue, image_descriptor *srcImageInfo, image_descriptor *dstImageInfo, const size_t sourcePos[], const size_t destPos[], const size_t regionSize[], MTdata d ); diff --git a/test_conformance/images/clCopyImage/test_copy_2D_array.cpp b/test_conformance/images/clCopyImage/test_copy_2D_array.cpp index 5624245a..6327ba58 100644 --- a/test_conformance/images/clCopyImage/test_copy_2D_array.cpp +++ b/test_conformance/images/clCopyImage/test_copy_2D_array.cpp @@ -15,13 +15,6 @@ // #include "../testBase.h" -#define MAX_ERR 0.005f -#define MAX_HALF_LINEAR_ERR 0.3f - -extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gTestMaxImages, gEnablePitch, gTestMipmaps; -extern cl_filter_mode gFilterModeToUse; -extern cl_addressing_mode gAddressModeToUse; - // Defined in test_copy_generic.cpp extern int test_copy_image_generic( cl_context context, cl_command_queue queue, image_descriptor *srcImageInfo, image_descriptor *dstImageInfo, const size_t sourcePos[], const size_t destPos[], const size_t regionSize[], MTdata d ); diff --git a/test_conformance/images/clCopyImage/test_copy_3D.cpp b/test_conformance/images/clCopyImage/test_copy_3D.cpp index fb176233..da6731d7 100644 --- a/test_conformance/images/clCopyImage/test_copy_3D.cpp +++ b/test_conformance/images/clCopyImage/test_copy_3D.cpp @@ -15,13 +15,6 @@ // #include "../testBase.h" -#define MAX_ERR 0.005f -#define MAX_HALF_LINEAR_ERR 0.3f - -extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gTestMaxImages, gEnablePitch, gTestMipmaps; -extern cl_filter_mode gFilterModeToUse; -extern cl_addressing_mode gAddressModeToUse; - // Defined in test_copy_generic.cpp extern int test_copy_image_generic( cl_context context, cl_command_queue queue, image_descriptor *srcImageInfo, image_descriptor *dstImageInfo, const size_t sourcePos[], const size_t destPos[], const size_t regionSize[], MTdata d ); diff --git a/test_conformance/images/clCopyImage/test_copy_3D_2D_array.cpp b/test_conformance/images/clCopyImage/test_copy_3D_2D_array.cpp index b3b32230..c098f645 100644 --- a/test_conformance/images/clCopyImage/test_copy_3D_2D_array.cpp +++ b/test_conformance/images/clCopyImage/test_copy_3D_2D_array.cpp @@ -16,14 +16,6 @@ #include "../testBase.h" #include "../common.h" -#define MAX_ERR 0.005f -#define MAX_HALF_LINEAR_ERR 0.3f - -extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gTestMaxImages, gEnablePitch, gTestMipmaps; -extern cl_filter_mode gFilterModeToUse; -extern cl_addressing_mode gAddressModeToUse; -extern uint64_t gRoundingStartValue; - extern int test_copy_image_generic( cl_context context, cl_command_queue queue, image_descriptor *srcImageInfo, image_descriptor *dstImageInfo, const size_t sourcePos[], const size_t destPos[], const size_t regionSize[], MTdata d ); diff --git a/test_conformance/images/clCopyImage/test_copy_generic.cpp b/test_conformance/images/clCopyImage/test_copy_generic.cpp index 5a8f3d31..d56ae770 100644 --- a/test_conformance/images/clCopyImage/test_copy_generic.cpp +++ b/test_conformance/images/clCopyImage/test_copy_generic.cpp @@ -15,14 +15,6 @@ // #include "../testBase.h" -#define MAX_ERR 0.005f -#define MAX_HALF_LINEAR_ERR 0.3f - -extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gTestMaxImages, gEnablePitch, gTestMipmaps; -extern cl_filter_mode gFilterModeToUse; -extern cl_addressing_mode gAddressModeToUse; -extern uint64_t gRoundingStartValue; - static void CL_CALLBACK free_pitch_buffer( cl_mem image, void *buf ) { free( buf ); @@ -642,111 +634,3 @@ int test_copy_image_generic( cl_context context, cl_command_queue queue, image_d return 0; } - -int test_copy_image_size_generic( cl_context context, cl_command_queue queue, image_descriptor *srcImageInfo, image_descriptor *dstImageInfo, MTdata d ) -{ - size_t sourcePos[ 3 ], destPos[ 3 ], regionSize[ 3 ]; - int ret = 0, retCode; - - for (int i = 0; i < 8; i++) - { - switch (srcImageInfo->type) - { - case CL_MEM_OBJECT_IMAGE1D: - sourcePos[ 0 ] = random_in_range( 0, (int)(srcImageInfo->width - 4), d ); - sourcePos[ 1 ] = 1; - sourcePos[ 2 ] = 1; - break; - case CL_MEM_OBJECT_IMAGE2D: - sourcePos[ 0 ] = random_in_range( 0, (int)(srcImageInfo->width - 4), d ); - sourcePos[ 1 ] = random_in_range( 0, (int)(srcImageInfo->height - 4), d ); - sourcePos[ 2 ] = 1; - break; - case CL_MEM_OBJECT_IMAGE3D: - sourcePos[ 0 ] = random_in_range( 0, (int)(srcImageInfo->width - 4), d ); - sourcePos[ 1 ] = random_in_range( 0, (int)(srcImageInfo->height - 4), d ); - sourcePos[ 2 ] = random_in_range( 0, (int)(srcImageInfo->depth - 4), d ); - break; - case CL_MEM_OBJECT_IMAGE1D_ARRAY: - sourcePos[ 0 ] = random_in_range( 0, (int)(srcImageInfo->width - 4), d ); - sourcePos[ 1 ] = random_in_range( 0, (int)(srcImageInfo->arraySize - 4), d ); - sourcePos[ 2 ] = 1; - break; - case CL_MEM_OBJECT_IMAGE2D_ARRAY: - sourcePos[ 0 ] = random_in_range( 0, (int)(srcImageInfo->width - 4), d ); - sourcePos[ 1 ] = random_in_range( 0, (int)(srcImageInfo->height - 4), d ); - sourcePos[ 2 ] = random_in_range( 0, (int)(srcImageInfo->arraySize - 4), d ); - break; - } - - switch (dstImageInfo->type) - { - case CL_MEM_OBJECT_IMAGE1D: - destPos[ 0 ] = random_in_range( 0, (int)(dstImageInfo->width - 4), d ); - destPos[ 1 ] = 1; - destPos[ 2 ] = 1; - break; - case CL_MEM_OBJECT_IMAGE2D: - destPos[ 0 ] = random_in_range( 0, (int)(dstImageInfo->width - 4), d ); - destPos[ 1 ] = random_in_range( 0, (int)(dstImageInfo->height - 4), d ); - destPos[ 2 ] = 1; - break; - case CL_MEM_OBJECT_IMAGE3D: - destPos[ 0 ] = random_in_range( 0, (int)(dstImageInfo->width - 4), d ); - destPos[ 1 ] = random_in_range( 0, (int)(dstImageInfo->height - 4), d ); - destPos[ 2 ] = random_in_range( 0, (int)(dstImageInfo->depth - 4), d ); - break; - case CL_MEM_OBJECT_IMAGE1D_ARRAY: - destPos[ 0 ] = random_in_range( 0, (int)(dstImageInfo->width - 4), d ); - destPos[ 1 ] = random_in_range( 0, (int)(dstImageInfo->arraySize - 4), d ); - destPos[ 2 ] = 1; - break; - case CL_MEM_OBJECT_IMAGE2D_ARRAY: - destPos[ 0 ] = random_in_range( 0, (int)(dstImageInfo->width - 4), d ); - destPos[ 1 ] = random_in_range( 0, (int)(dstImageInfo->height - 4), d ); - destPos[ 2 ] = random_in_range( 0, (int)(dstImageInfo->arraySize - 4), d ); - break; - } - - if ( (dstImageInfo->width - destPos[0]) < (srcImageInfo->width - sourcePos[0]) ) - regionSize[0] = random_in_range(1, (dstImageInfo->width - destPos[0]), d); - else - regionSize[0] = random_in_range(1, (srcImageInfo->width - sourcePos[0]), d); - - if (srcImageInfo->type == CL_MEM_OBJECT_IMAGE1D || dstImageInfo->type == CL_MEM_OBJECT_IMAGE1D) - regionSize[1] = 0; - else - { - if ( (dstImageInfo->height - destPos[1]) < (srcImageInfo->height - sourcePos[1]) ) - regionSize[1] = random_in_range(1, (dstImageInfo->height - destPos[1]), d); - else - regionSize[1] = random_in_range(1, (srcImageInfo->height - sourcePos[1]), d); - } - - regionSize[2] = 0; - if (dstImageInfo->type == CL_MEM_OBJECT_IMAGE3D && srcImageInfo->type == CL_MEM_OBJECT_IMAGE3D) - { - if ( (dstImageInfo->depth - destPos[2]) < (srcImageInfo->depth - sourcePos[2]) ) - regionSize[2] = random_in_range(1, (dstImageInfo->depth - destPos[2]), d); - else - regionSize[2] = random_in_range(1, (srcImageInfo->depth - sourcePos[2]), d); - } - else if ( (dstImageInfo->type == CL_MEM_OBJECT_IMAGE2D_ARRAY && srcImageInfo->type == CL_MEM_OBJECT_IMAGE2D_ARRAY) ) - { - if ( (dstImageInfo->arraySize - destPos[2]) < (srcImageInfo->arraySize - sourcePos[2]) ) - regionSize[2] = random_in_range(1, (dstImageInfo->arraySize - destPos[2]), d); - else - regionSize[2] = random_in_range(1, (srcImageInfo->arraySize - sourcePos[2]), d); - } - - // Go for it! - retCode = test_copy_image_generic( context, queue, srcImageInfo, dstImageInfo, sourcePos, destPos, regionSize, d ); - if( retCode < 0 ) - return retCode; - else - ret += retCode; - } - - return ret; -} - diff --git a/test_conformance/images/clCopyImage/test_loops.cpp b/test_conformance/images/clCopyImage/test_loops.cpp index 1cb79e98..03f34be7 100644 --- a/test_conformance/images/clCopyImage/test_loops.cpp +++ b/test_conformance/images/clCopyImage/test_loops.cpp @@ -16,18 +16,6 @@ #include "../testBase.h" #include "../common.h" -extern cl_filter_mode gFilterModeToUse; -extern cl_addressing_mode gAddressModeToUse; -extern int gTypesToTest; -extern int gNormalizedModeToUse; -extern bool gTestMipmaps; -extern cl_channel_type gChannelTypeToUse; -extern cl_channel_type gChannelTypeToUse; -extern cl_channel_order gChannelOrderToUse; - - -extern bool gDebugTrace; - extern int test_copy_image_set_1D( cl_device_id device, cl_context context, cl_command_queue queue, cl_image_format *format ); extern int test_copy_image_set_2D( cl_device_id device, cl_context context, cl_command_queue queue, cl_image_format *format ); extern int test_copy_image_set_3D( cl_device_id device, cl_context context, cl_command_queue queue, cl_image_format *format ); diff --git a/test_conformance/images/testBase.h b/test_conformance/images/testBase.h index f50f6b5b..7c45fdd1 100644 --- a/test_conformance/images/testBase.h +++ b/test_conformance/images/testBase.h @@ -22,6 +22,12 @@ #include "harness/clImageHelper.h" #include "harness/imageHelpers.h" +extern bool gDebugTrace; +extern bool gTestSmallImages; +extern bool gEnablePitch; +extern bool gTestMaxImages; +extern bool gTestMipmaps; + // Amount to offset pixels for checking normalized reads #define NORM_OFFSET 0.1f