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:25:19 +00:00
committed by Kévin Petit
parent de6c3db41b
commit 95b040bec2
87 changed files with 1358 additions and 589 deletions

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;
@@ -790,6 +775,7 @@ float get_max_relative_error( cl_image_format *format, image_sampler_data *sampl
{
if( sampler->filter_mode != CL_FILTER_NEAREST )
{
extern cl_device_type gDeviceType;
// The maximum
if( gDeviceType == CL_DEVICE_TYPE_GPU )
maxError += MAKE_HEX_FLOAT(0x1.0p-4f, 0x1L, -4); // Some GPUs ain't so accurate
@@ -1419,7 +1405,7 @@ void read_image_pixel_float( void *imageData, image_descriptor *imageInfo,
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

@@ -1070,14 +1070,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

@@ -20,6 +20,7 @@
#include "../config.hpp"
#include "compat.h"
#include "testHarness.h"
#include <stdio.h>
#include <stdlib.h>
@@ -128,8 +129,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 );

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,