Skip to content

Commit

Permalink
Corrected generator limits for half tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shajder committed Jun 20, 2023
1 parent 84f189a commit 9d0a402
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test_conformance/commonfns/test_binary_fn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ int test_binary_fn(cl_device_id device, cl_context context,
}
else if (std::is_same<T, half>::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++)
{
Expand Down
2 changes: 1 addition & 1 deletion test_conformance/commonfns/test_clamp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ int test_clamp_fn(cl_device_id device, cl_context context,
}
else if (std::is_same<T, half>::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));
Expand Down
2 changes: 1 addition & 1 deletion test_conformance/commonfns/test_step.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ int test_step_fn(cl_device_id device, cl_context context,
}
else if (std::is_same<T, half>::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++)
{
Expand Down

0 comments on commit 9d0a402

Please sign in to comment.