Skip to content

Commit 674d4cb

Browse files
committed
Merge branch 'devel' into 'master' for 1.15.2 release
2 parents 77aed0e + 7281ac5 commit 674d4cb

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

1919
include(GNUInstallDirs)
2020

rkcommon/math/math.ih

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff 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-
}
144151
inline unsigned int intbits(float a)
145152
{
146153
return sycl::bit_cast<unsigned int>(a);

0 commit comments

Comments
 (0)