Synchronise with Khronos-private Gitlab branch

The maintenance of the conformance tests is moving to Github.

This commit contains all the changes that have been done in
Gitlab since the first public release of the conformance tests.

Signed-off-by: Kevin Petit kevin.petit@arm.com
This commit is contained in:
Kevin Petit
2019-02-20 16:19:45 +00:00
committed by Kévin Petit
parent ba975e4112
commit 05a11d8e49
785 changed files with 18699 additions and 1070 deletions

View File

@@ -207,7 +207,10 @@ long double roundl(long double x);
int cf_signbit(double x);
int cf_signbitf(float x);
// Added in _MSC_VER == 1800 (Visual Studio 2013)
#if _MSC_VER < 1800
static int signbit(double x) { return cf_signbit(x); }
#endif
static int signbitf(float x) { return cf_signbitf(x); }
long int lrint (double flt);
@@ -241,8 +244,11 @@ int32_t float2int (float fx);
// stdio.h
//
#if defined( _MSC_VER )
#define snprintf sprintf_s
#if defined(_MSC_VER)
// snprintf added in _MSC_VER == 1900 (Visual Studio 2015)
#if _MSC_VER < 1900
#define snprintf sprintf_s
#endif
#endif

View File

@@ -479,16 +479,6 @@ struct AddressingTable
static AddressingTable sAddressingTable;
bool alpha_is_x(cl_image_format *format){
switch (format->image_channel_order) {
case CL_RGBx:
case CL_sRGBx:
return true;
default:
return false;
}
}
bool is_sRGBA_order(cl_channel_order image_channel_order){
switch (image_channel_order) {
case CL_sRGB:
@@ -508,19 +498,21 @@ int has_alpha(cl_image_format *format) {
case CL_R:
return 0;
case CL_A:
case CL_Rx:
return 1;
case CL_Rx:
return 0;
case CL_RG:
return 0;
case CL_RA:
case CL_RGx:
return 1;
case CL_RGx:
return 0;
case CL_RGB:
case CL_sRGB:
return 0;
case CL_RGBx:
case CL_sRGBx:
return 1;
return 0;
case CL_RGBA:
return 1;
case CL_BGRA:
@@ -719,13 +711,6 @@ void get_max_sizes(size_t *numberOfSizes, const int maxNumberOfSizes,
}
}
int issubnormal(float a)
{
union { cl_int i; cl_float f; } u;
u.f = a;
return (u.i & 0x7f800000U) == 0;
}
float get_max_absolute_error( cl_image_format *format, image_sampler_data *sampler) {
if (sampler->filter_mode == CL_FILTER_NEAREST)
return 0.0f;
@@ -1412,16 +1397,9 @@ void read_image_pixel_float( void *imageData, image_descriptor *imageInfo,
|| ( depth_lod != 0 && z >= (int)depth_lod )
|| ( imageInfo->arraySize != 0 && z >= (int)imageInfo->arraySize ) )
{
// Border color
if (imageInfo->format->image_channel_order == CL_DEPTH)
{
outData[ 0 ] = 0;
}
else {
outData[ 0 ] = outData[ 1 ] = outData[ 2 ] = outData[ 3 ] = 0;
if (!has_alpha(imageInfo->format))
outData[3] = alpha_is_x(imageInfo->format) ? 0 : 1;
}
outData[3] = 1;
return;
}

View File

@@ -136,8 +136,6 @@ extern void copy_image_data( image_descriptor *srcImageInfo, image_descriptor *d
int has_alpha(cl_image_format *format);
extern bool alpha_is_x(cl_image_format *format);
extern bool is_sRGBA_order(cl_channel_order image_channel_order);
inline float calculate_array_index( float coord, float extent );
@@ -594,7 +592,6 @@ extern char *create_random_image_data( ExplicitType dataType, image_descriptor *
extern void get_sampler_kernel_code( image_sampler_data *imageSampler, char *outLine );
extern float get_max_absolute_error( cl_image_format *format, image_sampler_data *sampler);
extern float get_max_relative_error( cl_image_format *format, image_sampler_data *sampler, int is3D, int isLinearFilter );
extern int issubnormal(float);
#define errMax( _x , _y ) ( (_x) != (_x) ? (_x) : (_x) > (_y) ? (_x) : (_y) )

View File

@@ -968,14 +968,14 @@ size_t get_pixel_bytes( const cl_image_format *fmt )
return 0;
}
int verifyImageSupport( cl_device_id device )
test_status verifyImageSupport( cl_device_id device )
{
if( checkForImageSupport( device ) )
{
log_error( "ERROR: Device does not supported images as required by this test!\n" );
return CL_IMAGE_FORMAT_NOT_SUPPORTED;
return TEST_FAIL;
}
return 0;
return TEST_PASS;
}
int checkForImageSupport( cl_device_id device )

View File

@@ -17,6 +17,7 @@
#define _kernelHelpers_h
#include "compat.h"
#include "testHarness.h"
#include <stdio.h>
#include <stdlib.h>
@@ -89,8 +90,8 @@ extern int is_image_format_supported( cl_context context, cl_mem_flags flags, cl
/* Helper to get pixel size for a pixel format */
size_t get_pixel_bytes( const cl_image_format *fmt );
/* Verify the given device supports images. 0 means you're good to go, otherwise an error */
extern int verifyImageSupport( cl_device_id device );
/* Verify the given device supports images. */
extern test_status verifyImageSupport( cl_device_id device );
/* Checks that the given device supports images. Same as verify, but doesn't print an error */
extern int checkForImageSupport( cl_device_id device );
@@ -123,6 +124,13 @@ cl_device_fp_config get_default_rounding_mode( cl_device_id device );
return 0; \
}
#define PASSIVE_REQUIRE_FP16_SUPPORT(device) \
if (!is_extension_available(device, "cl_khr_fp16")) \
{ \
log_info("\n\tNote: device does not support fp16. Skipping test...\n"); \
return 0; \
}
/* Prints out the standard device header for all tests given the device to print for */
extern int printDeviceHeader( cl_device_id device );

View File

@@ -566,6 +566,7 @@ long int lrintf (float x)
//
///////////////////////////////////////////////////////////////////
#if _MSC_VER < 1900
int fetestexcept(int excepts)
{
unsigned int status = _statusfp();
@@ -583,6 +584,7 @@ int feclearexcept(int excepts)
_clearfp();
return 0;
}
#endif
#endif // __INTEL_COMPILER

View File

@@ -35,12 +35,13 @@ OfflineCompilerOutputType gOfflineCompilerOutputType;
void helpInfo ()
{
log_info(" '-ILPath path_to_spirv_bin.\n");
log_info(" '-offlineCompiler <output_type:binary|source|spir_v>': use offline compiler\n");
log_info(" ' output_type binary - \"../build_script_binary.py\" is invoked\n");
log_info(" ' output_type source - \"../build_script_source.py\" is invoked\n");
log_info(" ' output_type spir_v <mode:generate|cache> - \"../cl_build_script_spir_v.py\" is invoked\n, optional modes: generate, cache");
log_info(" ' mode generate <path> - force binary generation");
log_info(" ' mode cache <path> - force reading binary files from cache");
log_info(" ' output_type spir_v <mode:generate|cache> - \"../cl_build_script_spir_v.py\" is invoked. optional modes: generate, cache\n");
log_info(" ' mode generate <path> - force binary generation\n");
log_info(" ' mode cache <path> - force reading binary files from cache\n");
log_info("\n");
}
@@ -61,10 +62,17 @@ int parseCustomParam (int argc, const char *argv[], const char *ignore)
continue;
}
if (i < 0) i = 0;
delArg = 0;
if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--help") == 0)
helpInfo ();
delArg = 0;
if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--help") == 0)
{
helpInfo ();
}
else if (!strcmp(argv[i], "-ILPath"))
{
gSpirVPath = argv[i + 1];
delArg = 2;
}
else if (!strcmp(argv[i], "-offlineCompiler"))
{
log_info(" Offline Compiler enabled\n");
@@ -128,3 +136,26 @@ int parseCustomParam (int argc, const char *argv[], const char *ignore)
return argc;
}
bool is_power_of_two(int number)
{
return number && !(number & (number - 1));
}
extern void parseWimpyReductionFactor(const char *&arg, int &wimpyReductionFactor)
{
const char *arg_temp = strchr(&arg[1], ']');
if (arg_temp != 0)
{
int new_factor = atoi(&arg[1]);
arg = arg_temp; // Advance until ']'
if (is_power_of_two(new_factor))
{
log_info("\n Wimpy reduction factor changed from %d to %d \n", wimpyReductionFactor, new_factor);
wimpyReductionFactor = new_factor;
}
else
{
log_info("\n WARNING: Incorrect wimpy reduction factor %d, must be power of 2. The default value will be used.\n", new_factor);
}
}
}

View File

@@ -16,6 +16,7 @@
#ifndef _parseParameters_h
#define _parseParameters_h
#include "compat.h"
#include <string>
extern bool gOfflineCompiler;
@@ -34,4 +35,6 @@ extern OfflineCompilerOutputType gOfflineCompilerOutputType;
extern int parseCustomParam (int argc, const char *argv[], const char *ignore = 0 );
extern void parseWimpyReductionFactor(const char *&arg, int &wimpyReductionFactor);
#endif // _parseParameters_h

View File

@@ -143,7 +143,7 @@ int runTestHarnessWithCheck( int argc, const char *argv[], unsigned int num_fns,
log_info( "\tid<num>\t\tIndicates device at index <num> should be used (default 0).\n" );
log_info( "\t<device_type>\tcpu|gpu|accelerator|<CL_DEVICE_TYPE_*> (default CL_DEVICE_TYPE_DEFAULT)\n" );
for( i = 0; i < num_fns - 1; i++ )
for( i = 0; i < num_fns; i++ )
{
log_info( "\t\t%s\n", fnNames[ i ] );
}
@@ -439,10 +439,18 @@ int runTestHarnessWithCheck( int argc, const char *argv[], unsigned int num_fns,
/* If we have a device checking function, run it */
if( ( deviceCheckFn != NULL ) && deviceCheckFn( device ) != CL_SUCCESS )
if( ( deviceCheckFn != NULL ) )
{
test_finish();
return -1;
test_status status = deviceCheckFn( device );
switch (status)
{
case TEST_PASS:
break;
case TEST_FAIL:
return 1;
case TEST_SKIP:
return 0;
}
}
if (num_elements <= 0)

View File

@@ -25,6 +25,13 @@
extern "C" {
#endif
typedef enum test_status
{
TEST_PASS = 0,
TEST_FAIL = 1,
TEST_SKIP = 2,
} test_status;
extern cl_uint gReSeed;
extern cl_uint gRandomSeed;
@@ -34,8 +41,8 @@ extern int runTestHarness( int argc, const char *argv[], unsigned int num_fns,
basefn fnList[], const char *fnNames[],
int imageSupportRequired, int forceNoContextCreation, cl_command_queue_properties queueProps );
// Device checking function. See runTestHarnessWithCheck. If this function returns anything other than CL_SUCCESS (0), the harness exits.
typedef int (*DeviceCheckFn)( cl_device_id device );
// Device checking function. See runTestHarnessWithCheck. If this function returns anything other than TEST_PASS, the harness exits.
typedef test_status (*DeviceCheckFn)( cl_device_id device );
// Same as runTestHarness, but also supplies a function that checks the created device for required functionality.
extern int runTestHarnessWithCheck( int argc, const char *argv[], unsigned int num_fns,