Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
utils.h File Reference
#include "bvh/v2/platform.h"
#include <limits>
#include <climits>
#include <cstdint>
#include <cstring>
#include <cmath>
#include <atomic>
Include dependency graph for utils.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  bvh::v2::IgnoreArgs
 Helper callable object that just ignores its arguments and returns nothing. More...
 
struct  bvh::v2::UnsignedInt< Bits >
 Helper type that gives an unsigned integer type with the given number of bits. More...
 
struct  bvh::v2::UnsignedInt< 16 >
 
struct  bvh::v2::UnsignedInt< 32 >
 
struct  bvh::v2::UnsignedInt< 64 >
 
struct  bvh::v2::UnsignedInt< 8 >
 

Namespaces

namespace  bvh
 
namespace  bvh::v2
 

Typedefs

template<size_t Bits>
using bvh::v2::UnsignedIntType = typename UnsignedInt< Bits >::Type
 

Functions

template<typename T , std::enable_if_t< std::is_floating_point_v< T >, bool > = true>
BVH_ALWAYS_INLINEbvh::v2::add_ulp_magnitude (T t, unsigned ulp)
 Adds the given number of ULPs (Units in the Last Place) to the given floating-point number.
 
template<typename T >
BVH_ALWAYS_INLINEbvh::v2::atomic_max (std::atomic< T > &atomic, const T &value)
 Computes the maximum between an atomic variable and a value, and returns the value previously held by the atomic variable.
 
template<typename T , std::enable_if_t< std::is_floating_point_v< T >, bool > = true>
BVH_ALWAYS_INLINEbvh::v2::fast_mul_add (T a, T b, T c)
 Fast multiply-add operation.
 
template<typename T , std::enable_if_t< std::is_unsigned_v< T >, bool > = true>
BVH_ALWAYS_INLINE constexpr T bvh::v2::make_bitmask (size_t bits)
 Generates a bitmask with the given number of bits.
 
template<typename T , std::enable_if_t< std::is_unsigned_v< T >, bool > = true>
BVH_ALWAYS_INLINEbvh::v2::morton_encode (T x, T y, T z)
 Morton-encode three unsigned integers into one.
 
template<typename T , std::enable_if_t< std::is_floating_point_v< T >, bool > = true>
BVH_ALWAYS_INLINEbvh::v2::robust_max (T a, T b)
 
template<typename T , std::enable_if_t< std::is_floating_point_v< T >, bool > = true>
BVH_ALWAYS_INLINEbvh::v2::robust_min (T a, T b)
 
template<typename T , std::enable_if_t< std::is_unsigned_v< T >, bool > = true>
constexpr T bvh::v2::round_up_log2 (T i, T p=0)
 Computes the (rounded-up) compile-time log in base-2 of an unsigned integer.
 
template<typename T , std::enable_if_t< std::is_floating_point_v< T >, bool > = true>
BVH_ALWAYS_INLINEbvh::v2::safe_inverse (T x)
 Computes the inverse of the given value, always returning a finite value.
 
template<typename T , std::enable_if_t< std::is_unsigned_v< T >, bool > = true>
BVH_ALWAYS_INLINEbvh::v2::split_bits (T x)
 Split an unsigned integer such that its bits are spaced by 2 zeros.
 
template<size_t Begin, size_t End, typename F >
BVH_ALWAYS_INLINE void bvh::v2::static_for (F &&f)
 Executes the given function once for every integer in the range [Begin, End).