stdgpu/bit.h Source File#
stdgpu Latest
Efficient STL-like Data Structures on the GPU
|
bit.h
Go to the documentation of this file.
STDGPU_HOST_DEVICE T bit_ceil(const T number) noexcept
Computes the smallest power of two which is larger or equal than the given number.
STDGPU_HOST_DEVICE T bit_floor(const T number) noexcept
Computes the largest power of two which is smaller or equal than the given number.
STDGPU_HOST_DEVICE int popcount(const T number) noexcept
Counts the number of set bits in the number.
STDGPU_HOST_DEVICE T bit_width(const T number) noexcept
Computes the smallest number of bits to represent the given number.
STDGPU_HOST_DEVICE T bit_mod(const T number, const T divider) noexcept
Computes the modulus of the given number and a power of two divider.
STDGPU_HOST_DEVICE bool has_single_bit(const T number) noexcept
Determines whether the number is a power of two.
STDGPU_HOST_DEVICE To bit_cast(const From &object) noexcept
Reinterprets the object of the given type as an instance of the desired type.
#define STDGPU_HOST_DEVICE
Platform-independent host device function annotation.
Definition: platform.h:77
Generated by 1.9.6