mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-22 15:19:02 +00:00
* test_common: Replace cl_ushort with cl_half (#885) Change-Id: I507eca2084629c3b6f3e7331f062f006edbce434 Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com> * buffers, pipes, profiling: Replace cl_ushort with cl_half (#885) Change-Id: Id9799322b636af6aa0eec3d4e846d7af8c7f9602 Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com> * images/kernel_read_write: Replace cl_ushort with cl_half (#885) Change-Id: I922ddb593b6e5631d0f4ea1522c7f75f8770be40 Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com> * half: Replace cl_ushort with cl_half (#885) Change-Id: I484a5bb2b33a7e87805fc6079953c66e5f8d9239 Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
This commit is contained in:
@@ -554,8 +554,8 @@ static int verify_write_float( void *ptr1, void *ptr2, int n )
|
||||
static int verify_write_half( void *ptr1, void *ptr2, int n )
|
||||
{
|
||||
int i;
|
||||
cl_ushort *inptr = (cl_ushort *)ptr1;
|
||||
cl_ushort *outptr = (cl_ushort *)ptr2;
|
||||
cl_half *inptr = (cl_half *)ptr1;
|
||||
cl_half *outptr = (cl_half *)ptr2;
|
||||
|
||||
for ( i = 0; i < n; i++ ){
|
||||
if ( outptr[i] != inptr[i] )
|
||||
|
||||
@@ -210,42 +210,42 @@ CheckD(cl_uint jid, cl_uint tid, void *userInfo)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static cl_ushort float2half_rte(float f)
|
||||
static cl_half float2half_rte(float f)
|
||||
{
|
||||
return cl_half_from_float(f, CL_HALF_RTE);
|
||||
}
|
||||
|
||||
static cl_ushort float2half_rtz(float f)
|
||||
static cl_half float2half_rtz(float f)
|
||||
{
|
||||
return cl_half_from_float(f, CL_HALF_RTZ);
|
||||
}
|
||||
|
||||
static cl_ushort float2half_rtp(float f)
|
||||
static cl_half float2half_rtp(float f)
|
||||
{
|
||||
return cl_half_from_float(f, CL_HALF_RTP);
|
||||
}
|
||||
|
||||
static cl_ushort float2half_rtn(float f)
|
||||
static cl_half float2half_rtn(float f)
|
||||
{
|
||||
return cl_half_from_float(f, CL_HALF_RTN);
|
||||
}
|
||||
|
||||
static cl_ushort double2half_rte(double f)
|
||||
static cl_half double2half_rte(double f)
|
||||
{
|
||||
return cl_half_from_double(f, CL_HALF_RTE);
|
||||
}
|
||||
|
||||
static cl_ushort double2half_rtz(double f)
|
||||
static cl_half double2half_rtz(double f)
|
||||
{
|
||||
return cl_half_from_double(f, CL_HALF_RTZ);
|
||||
}
|
||||
|
||||
static cl_ushort double2half_rtp(double f)
|
||||
static cl_half double2half_rtp(double f)
|
||||
{
|
||||
return cl_half_from_double(f, CL_HALF_RTP);
|
||||
}
|
||||
|
||||
static cl_ushort double2half_rtn(double f)
|
||||
static cl_half double2half_rtn(double f)
|
||||
{
|
||||
return cl_half_from_double(f, CL_HALF_RTN);
|
||||
}
|
||||
@@ -696,30 +696,30 @@ int Test_vStoreHalf_private( cl_device_id device, f2h referenceFunc, d2h doubleR
|
||||
|
||||
ComputeReferenceInfoF fref;
|
||||
fref.x = (float *)gIn_single;
|
||||
fref.r = (cl_ushort *)gOut_half_reference;
|
||||
fref.r = (cl_half *)gOut_half_reference;
|
||||
fref.f = referenceFunc;
|
||||
fref.lim = blockCount;
|
||||
fref.count = (blockCount + threadCount - 1) / threadCount;
|
||||
|
||||
CheckResultInfoF fchk;
|
||||
fchk.x = (const float *)gIn_single;
|
||||
fchk.r = (const cl_ushort *)gOut_half_reference;
|
||||
fchk.s = (const cl_ushort *)gOut_half;
|
||||
fchk.r = (const cl_half *)gOut_half_reference;
|
||||
fchk.s = (const cl_half *)gOut_half;
|
||||
fchk.f = referenceFunc;
|
||||
fchk.lim = blockCount;
|
||||
fchk.count = (blockCount + threadCount - 1) / threadCount;
|
||||
|
||||
ComputeReferenceInfoD dref;
|
||||
dref.x = (double *)gIn_double;
|
||||
dref.r = (cl_ushort *)gOut_half_reference_double;
|
||||
dref.r = (cl_half *)gOut_half_reference_double;
|
||||
dref.f = doubleReferenceFunc;
|
||||
dref.lim = blockCount;
|
||||
dref.count = (blockCount + threadCount - 1) / threadCount;
|
||||
|
||||
CheckResultInfoD dchk;
|
||||
dchk.x = (const double *)gIn_double;
|
||||
dchk.r = (const cl_ushort *)gOut_half_reference_double;
|
||||
dchk.s = (const cl_ushort *)gOut_half;
|
||||
dchk.r = (const cl_half *)gOut_half_reference_double;
|
||||
dchk.s = (const cl_half *)gOut_half;
|
||||
dchk.f = doubleReferenceFunc;
|
||||
dchk.lim = blockCount;
|
||||
dchk.count = (blockCount + threadCount - 1) / threadCount;
|
||||
@@ -764,7 +764,9 @@ int Test_vStoreHalf_private( cl_device_id device, f2h referenceFunc, d2h doubleR
|
||||
cl_uint pattern = 0xdeaddead;
|
||||
memset_pattern4( gOut_half, &pattern, BUFFER_SIZE/2);
|
||||
|
||||
error = clEnqueueWriteBuffer(gQueue, gOutBuffer_half, CL_FALSE, 0, count * sizeof(cl_ushort), gOut_half, 0, NULL, NULL);
|
||||
error = clEnqueueWriteBuffer(gQueue, gOutBuffer_half, CL_FALSE,
|
||||
0, count * sizeof(cl_half),
|
||||
gOut_half, 0, NULL, NULL);
|
||||
if (error) {
|
||||
vlog_error( "Failure in clWriteArray\n" );
|
||||
gFailCount++;
|
||||
@@ -779,7 +781,9 @@ int Test_vStoreHalf_private( cl_device_id device, f2h referenceFunc, d2h doubleR
|
||||
goto exit;
|
||||
}
|
||||
|
||||
error = clEnqueueReadBuffer(gQueue, gOutBuffer_half, CL_TRUE, 0, count * sizeof(cl_ushort), gOut_half, 0, NULL, NULL);
|
||||
error = clEnqueueReadBuffer(gQueue, gOutBuffer_half, CL_TRUE, 0,
|
||||
count * sizeof(cl_half), gOut_half,
|
||||
0, NULL, NULL);
|
||||
if (error) {
|
||||
vlog_error( "Failure in clReadArray\n" );
|
||||
gFailCount++;
|
||||
@@ -795,7 +799,9 @@ int Test_vStoreHalf_private( cl_device_id device, f2h referenceFunc, d2h doubleR
|
||||
if (gTestDouble) {
|
||||
memset_pattern4( gOut_half, &pattern, BUFFER_SIZE/2);
|
||||
|
||||
error = clEnqueueWriteBuffer(gQueue, gOutBuffer_half, CL_FALSE, 0, count * sizeof(cl_ushort), gOut_half, 0, NULL, NULL);
|
||||
error = clEnqueueWriteBuffer(
|
||||
gQueue, gOutBuffer_half, CL_FALSE, 0,
|
||||
count * sizeof(cl_half), gOut_half, 0, NULL, NULL);
|
||||
if (error) {
|
||||
vlog_error( "Failure in clWriteArray\n" );
|
||||
gFailCount++;
|
||||
@@ -810,7 +816,9 @@ int Test_vStoreHalf_private( cl_device_id device, f2h referenceFunc, d2h doubleR
|
||||
goto exit;
|
||||
}
|
||||
|
||||
error = clEnqueueReadBuffer(gQueue, gOutBuffer_half, CL_TRUE, 0, count * sizeof(cl_ushort), gOut_half, 0, NULL, NULL);
|
||||
error = clEnqueueReadBuffer(
|
||||
gQueue, gOutBuffer_half, CL_TRUE, 0,
|
||||
count * sizeof(cl_half), gOut_half, 0, NULL, NULL);
|
||||
if (error) {
|
||||
vlog_error( "Failure in clReadArray\n" );
|
||||
gFailCount++;
|
||||
@@ -1285,30 +1293,30 @@ int Test_vStoreaHalf_private( cl_device_id device, f2h referenceFunc, d2h double
|
||||
|
||||
ComputeReferenceInfoF fref;
|
||||
fref.x = (float *)gIn_single;
|
||||
fref.r = (cl_ushort *)gOut_half_reference;
|
||||
fref.r = (cl_half *)gOut_half_reference;
|
||||
fref.f = referenceFunc;
|
||||
fref.lim = blockCount;
|
||||
fref.count = (blockCount + threadCount - 1) / threadCount;
|
||||
|
||||
CheckResultInfoF fchk;
|
||||
fchk.x = (const float *)gIn_single;
|
||||
fchk.r = (const cl_ushort *)gOut_half_reference;
|
||||
fchk.s = (const cl_ushort *)gOut_half;
|
||||
fchk.r = (const cl_half *)gOut_half_reference;
|
||||
fchk.s = (const cl_half *)gOut_half;
|
||||
fchk.f = referenceFunc;
|
||||
fchk.lim = blockCount;
|
||||
fchk.count = (blockCount + threadCount - 1) / threadCount;
|
||||
|
||||
ComputeReferenceInfoD dref;
|
||||
dref.x = (double *)gIn_double;
|
||||
dref.r = (cl_ushort *)gOut_half_reference_double;
|
||||
dref.r = (cl_half *)gOut_half_reference_double;
|
||||
dref.f = doubleReferenceFunc;
|
||||
dref.lim = blockCount;
|
||||
dref.count = (blockCount + threadCount - 1) / threadCount;
|
||||
|
||||
CheckResultInfoD dchk;
|
||||
dchk.x = (const double *)gIn_double;
|
||||
dchk.r = (const cl_ushort *)gOut_half_reference_double;
|
||||
dchk.s = (const cl_ushort *)gOut_half;
|
||||
dchk.r = (const cl_half *)gOut_half_reference_double;
|
||||
dchk.s = (const cl_half *)gOut_half;
|
||||
dchk.f = doubleReferenceFunc;
|
||||
dchk.lim = blockCount;
|
||||
dchk.count = (blockCount + threadCount - 1) / threadCount;
|
||||
@@ -1353,7 +1361,9 @@ int Test_vStoreaHalf_private( cl_device_id device, f2h referenceFunc, d2h double
|
||||
cl_uint pattern = 0xdeaddead;
|
||||
memset_pattern4(gOut_half, &pattern, BUFFER_SIZE/2);
|
||||
|
||||
error = clEnqueueWriteBuffer(gQueue, gOutBuffer_half, CL_FALSE, 0, count * sizeof(cl_ushort), gOut_half, 0, NULL, NULL);
|
||||
error = clEnqueueWriteBuffer(gQueue, gOutBuffer_half, CL_FALSE,
|
||||
0, count * sizeof(cl_half),
|
||||
gOut_half, 0, NULL, NULL);
|
||||
if (error) {
|
||||
vlog_error( "Failure in clWriteArray\n" );
|
||||
gFailCount++;
|
||||
@@ -1368,7 +1378,9 @@ int Test_vStoreaHalf_private( cl_device_id device, f2h referenceFunc, d2h double
|
||||
goto exit;
|
||||
}
|
||||
|
||||
error = clEnqueueReadBuffer(gQueue, gOutBuffer_half, CL_TRUE, 0, count * sizeof(cl_ushort), gOut_half, 0, NULL, NULL);
|
||||
error = clEnqueueReadBuffer(gQueue, gOutBuffer_half, CL_TRUE, 0,
|
||||
count * sizeof(cl_half), gOut_half,
|
||||
0, NULL, NULL);
|
||||
if (error) {
|
||||
vlog_error( "Failure in clReadArray\n" );
|
||||
gFailCount++;
|
||||
@@ -1384,7 +1396,9 @@ int Test_vStoreaHalf_private( cl_device_id device, f2h referenceFunc, d2h double
|
||||
if (gTestDouble) {
|
||||
memset_pattern4(gOut_half, &pattern, BUFFER_SIZE/2);
|
||||
|
||||
error = clEnqueueWriteBuffer(gQueue, gOutBuffer_half, CL_FALSE, 0, count * sizeof(cl_ushort), gOut_half, 0, NULL, NULL);
|
||||
error = clEnqueueWriteBuffer(
|
||||
gQueue, gOutBuffer_half, CL_FALSE, 0,
|
||||
count * sizeof(cl_half), gOut_half, 0, NULL, NULL);
|
||||
if (error) {
|
||||
vlog_error( "Failure in clWriteArray\n" );
|
||||
gFailCount++;
|
||||
@@ -1399,7 +1413,9 @@ int Test_vStoreaHalf_private( cl_device_id device, f2h referenceFunc, d2h double
|
||||
goto exit;
|
||||
}
|
||||
|
||||
error = clEnqueueReadBuffer(gQueue, gOutBuffer_half, CL_TRUE, 0, count * sizeof(cl_ushort), gOut_half, 0, NULL, NULL);
|
||||
error = clEnqueueReadBuffer(
|
||||
gQueue, gOutBuffer_half, CL_TRUE, 0,
|
||||
count * sizeof(cl_half), gOut_half, 0, NULL, NULL);
|
||||
if (error) {
|
||||
vlog_error( "Failure in clReadArray\n" );
|
||||
gFailCount++;
|
||||
|
||||
@@ -472,8 +472,18 @@ int test_write_image_1D( cl_device_id device, cl_context context, cl_command_que
|
||||
log_error( " Error: %f %f %f %f\n", errors[0], errors[1], errors[2], errors[3] );
|
||||
break;
|
||||
case CL_HALF_FLOAT:
|
||||
log_error( " Expected: 0x%4.4x 0x%4.4x 0x%4.4x 0x%4.4x\n", ((cl_ushort*)resultBuffer)[0], ((cl_ushort*)resultBuffer)[1], ((cl_ushort*)resultBuffer)[2], ((cl_ushort*)resultBuffer)[3] );
|
||||
log_error( " Actual: 0x%4.4x 0x%4.4x 0x%4.4x 0x%4.4x\n", ((cl_ushort*)resultPtr)[0], ((cl_ushort*)resultPtr)[1], ((cl_ushort*)resultPtr)[2], ((cl_ushort*)resultPtr)[3] );
|
||||
log_error(" Expected: 0x%4.4x "
|
||||
"0x%4.4x 0x%4.4x 0x%4.4x\n",
|
||||
((cl_half *)resultBuffer)[0],
|
||||
((cl_half *)resultBuffer)[1],
|
||||
((cl_half *)resultBuffer)[2],
|
||||
((cl_half *)resultBuffer)[3]);
|
||||
log_error(" Actual: 0x%4.4x "
|
||||
"0x%4.4x 0x%4.4x 0x%4.4x\n",
|
||||
((cl_half *)resultPtr)[0],
|
||||
((cl_half *)resultPtr)[1],
|
||||
((cl_half *)resultPtr)[2],
|
||||
((cl_half *)resultPtr)[3]);
|
||||
log_error( " Ulps: %f %f %f %f\n", errors[0], errors[1], errors[2], errors[3] );
|
||||
break;
|
||||
case CL_UNSIGNED_INT32:
|
||||
|
||||
@@ -491,8 +491,18 @@ int test_write_image_1D_array( cl_device_id device, cl_context context, cl_comma
|
||||
log_error( " Error: %f %f %f %f\n", errors[0], errors[1], errors[2], errors[3] );
|
||||
break;
|
||||
case CL_HALF_FLOAT:
|
||||
log_error( " Expected: 0x%4.4x 0x%4.4x 0x%4.4x 0x%4.4x\n", ((cl_ushort*)resultBuffer)[0], ((cl_ushort*)resultBuffer)[1], ((cl_ushort*)resultBuffer)[2], ((cl_ushort*)resultBuffer)[3] );
|
||||
log_error( " Actual: 0x%4.4x 0x%4.4x 0x%4.4x 0x%4.4x\n", ((cl_ushort*)resultPtr)[0], ((cl_ushort*)resultPtr)[1], ((cl_ushort*)resultPtr)[2], ((cl_ushort*)resultPtr)[3] );
|
||||
log_error(" Expected: 0x%4.4x "
|
||||
"0x%4.4x 0x%4.4x 0x%4.4x\n",
|
||||
((cl_half *)resultBuffer)[0],
|
||||
((cl_half *)resultBuffer)[1],
|
||||
((cl_half *)resultBuffer)[2],
|
||||
((cl_half *)resultBuffer)[3]);
|
||||
log_error(" Actual: 0x%4.4x "
|
||||
"0x%4.4x 0x%4.4x 0x%4.4x\n",
|
||||
((cl_half *)resultPtr)[0],
|
||||
((cl_half *)resultPtr)[1],
|
||||
((cl_half *)resultPtr)[2],
|
||||
((cl_half *)resultPtr)[3]);
|
||||
log_error( " Ulps: %f %f %f %f\n", errors[0], errors[1], errors[2], errors[3] );
|
||||
break;
|
||||
case CL_UNSIGNED_INT32:
|
||||
|
||||
@@ -514,8 +514,20 @@ int test_write_image_2D_array( cl_device_id device, cl_context context, cl_comma
|
||||
log_error( " Error: %f %f %f %f\n", errors[0], errors[1], errors[2], errors[3] );
|
||||
break;
|
||||
case CL_HALF_FLOAT:
|
||||
log_error( " Expected: 0x%4.4x 0x%4.4x 0x%4.4x 0x%4.4x\n", ((cl_ushort*)resultBuffer)[0], ((cl_ushort*)resultBuffer)[1], ((cl_ushort*)resultBuffer)[2], ((cl_ushort*)resultBuffer)[3] );
|
||||
log_error( " Actual: 0x%4.4x 0x%4.4x 0x%4.4x 0x%4.4x\n", ((cl_ushort*)resultPtr)[0], ((cl_ushort*)resultPtr)[1], ((cl_ushort*)resultPtr)[2], ((cl_ushort*)resultPtr)[3] );
|
||||
log_error(
|
||||
" Expected: 0x%4.4x 0x%4.4x "
|
||||
"0x%4.4x 0x%4.4x\n",
|
||||
((cl_half *)resultBuffer)[0],
|
||||
((cl_half *)resultBuffer)[1],
|
||||
((cl_half *)resultBuffer)[2],
|
||||
((cl_half *)resultBuffer)[3]);
|
||||
log_error(
|
||||
" Actual: 0x%4.4x 0x%4.4x "
|
||||
"0x%4.4x 0x%4.4x\n",
|
||||
((cl_half *)resultPtr)[0],
|
||||
((cl_half *)resultPtr)[1],
|
||||
((cl_half *)resultPtr)[2],
|
||||
((cl_half *)resultPtr)[3]);
|
||||
log_error( " Ulps: %f %f %f %f\n", errors[0], errors[1], errors[2], errors[3] );
|
||||
break;
|
||||
case CL_UNSIGNED_INT32:
|
||||
|
||||
@@ -521,8 +521,20 @@ int test_write_image_3D( cl_device_id device, cl_context context, cl_command_que
|
||||
log_error( " Error: %f %f %f %f\n", errors[0], errors[1], errors[2], errors[3] );
|
||||
break;
|
||||
case CL_HALF_FLOAT:
|
||||
log_error( " Expected: 0x%4.4x 0x%4.4x 0x%4.4x 0x%4.4x\n", ((cl_ushort*)resultBuffer)[0], ((cl_ushort*)resultBuffer)[1], ((cl_ushort*)resultBuffer)[2], ((cl_ushort*)resultBuffer)[3] );
|
||||
log_error( " Actual: 0x%4.4x 0x%4.4x 0x%4.4x 0x%4.4x\n", ((cl_ushort*)resultPtr)[0], ((cl_ushort*)resultPtr)[1], ((cl_ushort*)resultPtr)[2], ((cl_ushort*)resultPtr)[3] );
|
||||
log_error(
|
||||
" Expected: 0x%4.4x 0x%4.4x "
|
||||
"0x%4.4x 0x%4.4x\n",
|
||||
((cl_half *)resultBuffer)[0],
|
||||
((cl_half *)resultBuffer)[1],
|
||||
((cl_half *)resultBuffer)[2],
|
||||
((cl_half *)resultBuffer)[3]);
|
||||
log_error(
|
||||
" Actual: 0x%4.4x 0x%4.4x "
|
||||
"0x%4.4x 0x%4.4x\n",
|
||||
((cl_half *)resultPtr)[0],
|
||||
((cl_half *)resultPtr)[1],
|
||||
((cl_half *)resultPtr)[2],
|
||||
((cl_half *)resultPtr)[3]);
|
||||
log_error( " Ulps: %f %f %f %f\n", errors[0], errors[1], errors[2], errors[3] );
|
||||
break;
|
||||
case CL_UNSIGNED_INT32:
|
||||
|
||||
@@ -538,8 +538,18 @@ int test_write_image( cl_device_id device, cl_context context, cl_command_queue
|
||||
log_error( " Error: %f %f %f %f\n", errors[0], errors[1], errors[2], errors[3] );
|
||||
break;
|
||||
case CL_HALF_FLOAT:
|
||||
log_error( " Expected: 0x%4.4x 0x%4.4x 0x%4.4x 0x%4.4x\n", ((cl_ushort*)resultBuffer)[0], ((cl_ushort*)resultBuffer)[1], ((cl_ushort*)resultBuffer)[2], ((cl_ushort*)resultBuffer)[3] );
|
||||
log_error( " Actual: 0x%4.4x 0x%4.4x 0x%4.4x 0x%4.4x\n", ((cl_ushort*)resultPtr)[0], ((cl_ushort*)resultPtr)[1], ((cl_ushort*)resultPtr)[2], ((cl_ushort*)resultPtr)[3] );
|
||||
log_error(" Expected: 0x%4.4x "
|
||||
"0x%4.4x 0x%4.4x 0x%4.4x\n",
|
||||
((cl_half *)resultBuffer)[0],
|
||||
((cl_half *)resultBuffer)[1],
|
||||
((cl_half *)resultBuffer)[2],
|
||||
((cl_half *)resultBuffer)[3]);
|
||||
log_error(" Actual: 0x%4.4x "
|
||||
"0x%4.4x 0x%4.4x 0x%4.4x\n",
|
||||
((cl_half *)resultPtr)[0],
|
||||
((cl_half *)resultPtr)[1],
|
||||
((cl_half *)resultPtr)[2],
|
||||
((cl_half *)resultPtr)[3]);
|
||||
log_error( " Ulps: %f %f %f %f\n", errors[0], errors[1], errors[2], errors[3] );
|
||||
break;
|
||||
case CL_UNSIGNED_INT32:
|
||||
|
||||
@@ -361,8 +361,8 @@ static int verify_readwrite_half(void *ptr1, void *ptr2, int n)
|
||||
{
|
||||
int i;
|
||||
int sum_input = 0, sum_output = 0;
|
||||
cl_ushort *inptr = (cl_ushort *)ptr1;
|
||||
cl_ushort *outptr = (cl_ushort *)ptr2;
|
||||
cl_half *inptr = (cl_half *)ptr1;
|
||||
cl_half *outptr = (cl_half *)ptr2;
|
||||
|
||||
for(i = 0; i < n; i++)
|
||||
{
|
||||
|
||||
@@ -551,8 +551,8 @@ static int verify_write_float( void *ptr1, void *ptr2, int n )
|
||||
static int verify_write_half( void *ptr1, void *ptr2, int n )
|
||||
{
|
||||
int i;
|
||||
cl_ushort *inptr = (cl_ushort *)ptr1;
|
||||
cl_ushort *outptr = (cl_ushort *)ptr2;
|
||||
cl_half *inptr = (cl_half *)ptr1;
|
||||
cl_half *outptr = (cl_half *)ptr2;
|
||||
|
||||
for( i = 0; i < n; i++ ){
|
||||
if( outptr[i] != inptr[i] )
|
||||
|
||||
Reference in New Issue
Block a user