diff options
author | Sven van Haastregt <sven.vanhaastregt@arm.com> | 2022-10-11 17:36:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-11 09:36:33 -0700 |
commit | 35cab9c85bb12c78d46a7def998857c3d1e27633 (patch) | |
tree | 8788cca1fac4d7fa6ce7f2a80aa75711dfb7f8be | |
parent | 9e0ce2ba80b0af7e64b013918c8b46dad51107dd (diff) | |
download | OpenCL-CTS-35cab9c85bb12c78d46a7def998857c3d1e27633.tar.gz |
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>
-rw-r--r-- | test_conformance/pipes/test_pipe_read_write.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test_conformance/pipes/test_pipe_read_write.cpp b/test_conformance/pipes/test_pipe_read_write.cpp index cb72e96b..425c7aee 100644 --- a/test_conformance/pipes/test_pipe_read_write.cpp +++ b/test_conformance/pipes/test_pipe_read_write.cpp @@ -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; |