From 35cab9c85bb12c78d46a7def998857c3d1e27633 Mon Sep 17 00:00:00 2001 From: Sven van Haastregt Date: Tue, 11 Oct 2022 17:36:33 +0100 Subject: [PATCH] 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 Signed-off-by: Sven van Haastregt --- test_conformance/pipes/test_pipe_read_write.cpp | 8 ++++---- 1 file 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;