Speclib  0.1.2
The library for writing better CUDA libraries
Math Functions

Modules

 Bit Twiddling
 Utilities for bit-twiddling.
 
 Floating Point Math with Rounding Modes
 These functions provide convenient access to the floating point instructions with special rounding modes.
 
 Integer Division
 Tools for doing integer division quickly on GPUS.
 
 Polynomials
 Trigonometry-related functions.
 
 Trigonometry
 Trigonometry-related functions.
 

Enumerations

enum class  sp::RoundMode { RoundMode::Nearest = 0 , RoundMode::Down = 1 , RoundMode::Up = 2 , RoundMode::TowardZero = 3 }
 Rounding mode (usually for floating point). More...
 

Functions

template<int Rank>
sp::Vec< int, Rank > sp::offsetToCoords (const sp::Vec< int, Rank > &dims, int offset)
 Convert a 1D offset to n-dimensional co-ordinates, for given dimensions. More...
 
template<int Rank>
bool sp::incrementCoords (const sp::Vec< int, Rank > &dims, sp::Vec< int, Rank > &coords)
 Increment co-ordinates in a Rank-dimensional space of size dims, initially at coords. More...
 
template<int Rank>
bool sp::advanceCoords (const sp::Vec< int, Rank > &dims, sp::Vec< int, Rank > &coords, int amount)
 

Detailed Description

Enumeration Type Documentation

◆ RoundMode

enum class sp::RoundMode
strong

Rounding mode (usually for floating point).

Enumerator
Nearest 

Round to the nearest representation.

Ties are rounded up or down, depending in which results in a zero in the LSB of the mantissa. This is the IEEE 754 default.

Down 

Round towards negative infinity.

Up 

Round towards positive infinity.

TowardZero 

Round towards zero.

Function Documentation

◆ incrementCoords()

template<int Rank>
bool sp::incrementCoords ( const sp::Vec< int, Rank > &  dims,
sp::Vec< int, Rank > &  coords 
)

Increment co-ordinates in a Rank-dimensional space of size dims, initially at coords.

◆ offsetToCoords()

template<int Rank>
sp::Vec< int, Rank > sp::offsetToCoords ( const sp::Vec< int, Rank > &  dims,
int  offset 
)

Convert a 1D offset to n-dimensional co-ordinates, for given dimensions.