Replace cl_ushort with cl_half (#885) (#1000)

* 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:
Chetan Mistry
2020-10-02 16:29:05 +01:00
committed by GitHub
parent 615ab64db5
commit 7a735b74e3
15 changed files with 156 additions and 90 deletions

View File

@@ -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:

View File

@@ -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:

View File

@@ -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:

View File

@@ -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:

View File

@@ -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: