File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
1414
1515## Establish project ##
1616
17- project (rkcommon VERSION 1.15.1 LANGUAGES CXX )
17+ project (rkcommon VERSION 1.15.2 LANGUAGES CXX )
1818
1919include (GNUInstallDirs )
2020
Original file line number Diff line number Diff line change @@ -27,10 +27,21 @@ using int8 = int8_t;
2727// Constants
2828// ------------------------------------------------------------------
2929
30+ #ifdef ISPC
3031#define inf floatbits(0x7F800000)
3132#define pos_inf floatbits(0x7F800000)
3233#define neg_inf floatbits(0xFF800000)
3334#define nan floatbits(0x7FBFFFFF)
35+ #else
36+ constexpr float floatbits(unsigned int a)
37+ {
38+ return sycl::bit_cast<float>(a);
39+ }
40+ constexpr float inf = floatbits(0x7F800000);
41+ constexpr float pos_inf = floatbits(0x7F800000);
42+ constexpr float neg_inf = floatbits(0xFF800000);
43+ constexpr float nan = floatbits(0x7FBFFFFF);
44+ #endif
3445// smallest positive normal number 2^-126 ~ 1.17549435e-38
3546#define flt_min 0x1.0p-126f
3647
@@ -137,10 +148,6 @@ inline float nextafter(const float a, const float b)
137148{
138149 return sycl::nextafter(a, b);
139150}
140- inline float floatbits(unsigned int a)
141- {
142- return sycl::bit_cast<float>(a);
143- }
144151inline unsigned int intbits(float a)
145152{
146153 return sycl::bit_cast<unsigned int>(a);
You can’t perform that action at this time.
0 commit comments