Skip to content

Commit d33c7d0

Browse files
committed
[SYCL][ESIMD][E2E] Fix LSC USM store test failure
Signed-off-by: Sarnie, Nick <[email protected]>
1 parent f741bdd commit d33c7d0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sycl/test-e2e/ESIMD/lsc/Inputs/common.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#pragma once
1010

11+
#include <limits>
1112
#include <stdlib.h>
1213
#include <sycl/bit_cast.hpp>
1314

@@ -23,5 +24,7 @@ template <typename T> T get_rand() {
2324
Tuint v = rand();
2425
if constexpr (sizeof(Tuint) > 4)
2526
v = (v << 32) | rand();
26-
return sycl::bit_cast<T>(v);
27+
T bitcast_v = sycl::bit_cast<T>(v);
28+
return bitcast_v <= std::numeric_limits<T>::epsilon() ? static_cast<T>(0)
29+
: bitcast_v;
2730
}

0 commit comments

Comments
 (0)