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

@@ -61,9 +61,11 @@ size_t gWorkGroupSize = 0;
int gTestCount = 0;
int gFailCount = 0;
bool gWimpyMode = false;
int gWimpyReductionFactor = 512;
int gTestDouble = 0;
uint32_t gDeviceIndex = 0;
int gIsEmbedded = 0;
size_t gBufferSize = 0;
#if defined( __APPLE__ )
int gReportTimes = 1;
@@ -184,17 +186,19 @@ int InitCL( void )
#if defined( __APPLE__ )
// FIXME: use clProtectedArray
#endif
gBufferSize = getBufferSize(gDevice);
//Allocate buffers
gIn_half = malloc( getBufferSize(gDevice)/2 );
gIn_half = malloc( gBufferSize/2 );
gOut_half = malloc( BUFFER_SIZE/2 );
gOut_half_reference = malloc( BUFFER_SIZE/2 );
gOut_half_reference_double = malloc( BUFFER_SIZE/2 );
gIn_single = malloc( BUFFER_SIZE );
gOut_single = malloc( getBufferSize(gDevice) );
gOut_single_reference = malloc( getBufferSize(gDevice) );
gOut_single = malloc( gBufferSize );
gOut_single_reference = malloc( gBufferSize );
gIn_double = malloc( 2*BUFFER_SIZE );
// gOut_double = malloc( (2*getBufferSize(gDevice)) );
// gOut_double_reference = malloc( (2*getBufferSize(gDevice)) );
// gOut_double = malloc( (2*gBufferSize) );
// gOut_double_reference = malloc( (2*gBufferSize) );
if ( NULL == gIn_half ||
NULL == gOut_half ||
@@ -207,7 +211,7 @@ int InitCL( void )
)
return -3;
gInBuffer_half = clCreateBuffer(gContext, CL_MEM_READ_ONLY, getBufferSize(gDevice) / 2, NULL, &error);
gInBuffer_half = clCreateBuffer(gContext, CL_MEM_READ_ONLY, gBufferSize / 2, NULL, &error);
if( gInBuffer_half == NULL )
{
vlog_error( "clCreateArray failed for input (%d)\n", error );
@@ -235,7 +239,7 @@ int InitCL( void )
return -5;
}
gOutBuffer_single = clCreateBuffer(gContext, CL_MEM_WRITE_ONLY, getBufferSize(gDevice), NULL, &error );
gOutBuffer_single = clCreateBuffer(gContext, CL_MEM_WRITE_ONLY, gBufferSize, NULL, &error );
if( gOutBuffer_single == NULL )
{
vlog_error( "clCreateArray failed for output (%d)\n", error );
@@ -243,7 +247,7 @@ int InitCL( void )
}
#if 0
gOutBuffer_double = clCreateBuffer(gContext, CL_MEM_WRITE_ONLY, (size_t)(2*getBufferSize(gDevice)), NULL, &error );
gOutBuffer_double = clCreateBuffer(gContext, CL_MEM_WRITE_ONLY, (size_t)(2*gBufferSize), NULL, &error );
if( gOutBuffer_double == NULL )
{
vlog_error( "clCreateArray failed for output (%d)\n", error );
@@ -317,6 +321,15 @@ void ReleaseCL(void)
// clReleaseMemObject(gOutBuffer_double);
clReleaseCommandQueue(gQueue);
clReleaseContext(gContext);
free(gIn_half);
free(gOut_half);
free(gOut_half_reference);
free(gOut_half_reference_double);
free(gIn_single);
free(gOut_single);
free(gOut_single_reference);
free(gIn_double);
}
cl_uint numVecs(cl_uint count, int vectorSizeIdx, bool aligned) {
@@ -453,19 +466,30 @@ size_t getBufferSize(cl_device_id device_id)
if(s_initialized == 0 || s_device_id != device_id)
{
cl_ulong result;
cl_ulong result, maxGlobalSize;
cl_int err = clGetDeviceInfo (device_id,
CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE,
sizeof(result), (void *)&result,
NULL);
if(err)
{
vlog_error("clGetDeviceInfo() failed\n");
vlog_error("clGetDeviceInfo(CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE) failed\n");
s_result = 64*1024;
goto exit;
}
result = result / 2;
log_info("Const buffer size is %llx (%llu)\n", result, result);
err = clGetDeviceInfo (device_id,
CL_DEVICE_GLOBAL_MEM_SIZE,
sizeof(maxGlobalSize), (void *)&maxGlobalSize,
NULL);
if(err)
{
vlog_error("clGetDeviceInfo(CL_DEVICE_GLOBAL_MEM_SIZE) failed\n");
goto exit;
}
result = result / 2;
if(maxGlobalSize < result * 10)
result = result / 10;
s_initialized = 1;
s_device_id = device_id;
s_result = result;