pipes: Fix readwrite verification function for fp64 (#1522)

Use the appropriate function for verifying double precision values in
the `pipe_readwrite_double` test.

Change `verify_readwrite_double` to use `cl_long`, as `long long int`
could be wider than 64 bits which would cause out-of-bound reads.
This leaves no functional differences between
`verify_readwrite_double` and `verify_readwrite_long`.

Found by compiling with `-Wunused-function`, which flagged
`verify_readwrite_double` as unused.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
This commit is contained in:
Sven van Haastregt
2022-10-11 17:36:33 +01:00
committed by GitHub
parent 9e0ce2ba80
commit 35cab9c85b

View File

@@ -414,9 +414,9 @@ static int verify_readwrite_ulong(void *ptr1, void *ptr2, int n)
static int verify_readwrite_double(void *ptr1, void *ptr2, int n)
{
int i;
long long int sum_input = 0, sum_output = 0;
long long int *inptr = (long long int *)ptr1;
long long int *outptr = (long long int *)ptr2;
cl_long sum_input = 0, sum_output = 0;
cl_long *inptr = (cl_long *)ptr1;
cl_long *outptr = (cl_long *)ptr2;
for(i = 0; i < n; i++)
{
@@ -1246,7 +1246,7 @@ int test_pipe_readwrite_double( cl_device_id deviceID, cl_context context, cl_co
size_t min_alignment = get_min_alignment(context);
foo = verify_readwrite_long;
foo = verify_readwrite_double;
ptrSizes[0] = sizeof(cl_double);
ptrSizes[1] = ptrSizes[0] << 1;