Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)

## Establish project ##

project(rkcommon VERSION 1.15.1 LANGUAGES CXX)
project(rkcommon VERSION 1.15.2 LANGUAGES CXX)

include(GNUInstallDirs)

Expand Down
15 changes: 11 additions & 4 deletions rkcommon/math/math.ih
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,21 @@ using int8 = int8_t;
// Constants
// ------------------------------------------------------------------

#ifdef ISPC
#define inf floatbits(0x7F800000)
#define pos_inf floatbits(0x7F800000)
#define neg_inf floatbits(0xFF800000)
#define nan floatbits(0x7FBFFFFF)
#else
constexpr float floatbits(unsigned int a)
{
return sycl::bit_cast<float>(a);
}
constexpr float inf = floatbits(0x7F800000);
constexpr float pos_inf = floatbits(0x7F800000);
constexpr float neg_inf = floatbits(0xFF800000);
constexpr float nan = floatbits(0x7FBFFFFF);
#endif
// smallest positive normal number 2^-126 ~ 1.17549435e-38
#define flt_min 0x1.0p-126f

Expand Down Expand Up @@ -137,10 +148,6 @@ inline float nextafter(const float a, const float b)
{
return sycl::nextafter(a, b);
}
inline float floatbits(unsigned int a)
{
return sycl::bit_cast<float>(a);
}
inline unsigned int intbits(float a)
{
return sycl::bit_cast<unsigned int>(a);
Expand Down