We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f741bdd commit d33c7d0Copy full SHA for d33c7d0
sycl/test-e2e/ESIMD/lsc/Inputs/common.hpp
@@ -8,6 +8,7 @@
8
9
#pragma once
10
11
+#include <limits>
12
#include <stdlib.h>
13
#include <sycl/bit_cast.hpp>
14
@@ -23,5 +24,7 @@ template <typename T> T get_rand() {
23
24
Tuint v = rand();
25
if constexpr (sizeof(Tuint) > 4)
26
v = (v << 32) | rand();
- 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;
30
}
0 commit comments