From 9d0a4025ccbe903e2e4f0e7d1c0c0a24a8af2e0c Mon Sep 17 00:00:00 2001 From: Marcin Hajder Date: Tue, 20 Jun 2023 14:52:49 +0200 Subject: [PATCH] Corrected generator limits for half tests --- test_conformance/commonfns/test_binary_fn.cpp | 2 +- test_conformance/commonfns/test_clamp.cpp | 2 +- test_conformance/commonfns/test_step.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test_conformance/commonfns/test_binary_fn.cpp b/test_conformance/commonfns/test_binary_fn.cpp index 6330a04d31..a6c75647d0 100644 --- a/test_conformance/commonfns/test_binary_fn.cpp +++ b/test_conformance/commonfns/test_binary_fn.cpp @@ -107,7 +107,7 @@ int test_binary_fn(cl_device_id device, cl_context context, } else if (std::is_same::value) { - const float fval = 0x20000000; + const float fval = CL_HALF_MAX; pragma_str = "#pragma OPENCL EXTENSION cl_khr_fp16 : enable\n"; for (int j = 0; j < num_elements; j++) { diff --git a/test_conformance/commonfns/test_clamp.cpp b/test_conformance/commonfns/test_clamp.cpp index 83e98603b0..1bf4067705 100644 --- a/test_conformance/commonfns/test_clamp.cpp +++ b/test_conformance/commonfns/test_clamp.cpp @@ -201,7 +201,7 @@ int test_clamp_fn(cl_device_id device, cl_context context, } else if (std::is_same::value) { - const float fval = 0x200000; + const float fval = CL_HALF_MAX; for (j = 0; j < num_elements; j++) { input_ptr[0][j] = conv_to_half(get_random_float(-fval, fval, d)); diff --git a/test_conformance/commonfns/test_step.cpp b/test_conformance/commonfns/test_step.cpp index cea3b65884..1cfa96eabd 100644 --- a/test_conformance/commonfns/test_step.cpp +++ b/test_conformance/commonfns/test_step.cpp @@ -149,7 +149,7 @@ int test_step_fn(cl_device_id device, cl_context context, } else if (std::is_same::value) { - const float fval = 0x40000000; + const float fval = CL_HALF_MAX; pragma_str = "#pragma OPENCL EXTENSION cl_khr_fp16 : enable\n"; for (i = 0; i < num_elements; i++) {