From f6799d14c0f46d35107469c22f091fc73f7b0633 Mon Sep 17 00:00:00 2001 From: Guo Yejun Date: Mon, 18 Jul 2016 09:04:16 +0800 Subject: do not use const pointer Signed-off-by: Guo Yejun Reviewed-by: Yang Rong --- utests/builtin_exp.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'utests/builtin_exp.cpp') diff --git a/utests/builtin_exp.cpp b/utests/builtin_exp.cpp index 6d51c33f..2c214bde 100644 --- a/utests/builtin_exp.cpp +++ b/utests/builtin_exp.cpp @@ -15,7 +15,9 @@ printf("\033[0m");\ } -const float input_data[] = {FLT_MAX, -FLT_MAX, FLT_MIN, -FLT_MIN, 80, -80, 3.14, -3.14, -0.5, 0.5, 1, -1, 0.0 }; +namespace{ + +float input_data[] = {FLT_MAX, -FLT_MAX, FLT_MIN, -FLT_MIN, 80, -80, 3.14, -3.14, -0.5, 0.5, 1, -1, 0.0 }; const int count_input = sizeof(input_data) / sizeof(input_data[0]); const int max_function = 5; @@ -51,7 +53,8 @@ static void builtin_exp(void) locals[0] = 1; clEnqueueWriteBuffer( queue, buf[1], CL_TRUE, 0, count_input * sizeof(float), input_data, 0, NULL, NULL); - clEnqueueWriteBuffer( queue, buf[2], CL_TRUE, 0, sizeof(int), &max_function , 0, NULL, NULL); + int maxfunc = max_function; + clEnqueueWriteBuffer( queue, buf[2], CL_TRUE, 0, sizeof(int), &maxfunc, 0, NULL, NULL); // Run the kernel OCL_NDRANGE( 1 ); @@ -100,3 +103,4 @@ static void builtin_exp(void) } MAKE_UTEST_FROM_FUNCTION(builtin_exp) +} -- cgit v1.2.1