These functions provide convenient access to the floating point instructions with special rounding modes.
More...
|
| template<RoundingMode RM, bool FTZ = true> |
| __device__ float | sp::add (float x, float y) |
| | FP add with configurable rounding mode and denormal handling. More...
|
| |
| template<RoundingMode RM, bool FTZ = true> |
| __device__ double | sp::add (double x, double y) |
| | FP add with configurable rounding mode and denormal handling. More...
|
| |
| template<RoundingMode RM, bool FTZ = true, typename T > |
| __device__ T | sp::sub (T x, T y) |
| | FP subtract with configurable rounding mode and denormal handling. More...
|
| |
| template<RoundingMode RM, bool FTZ = true> |
| __device__ float | sp::mul (float x, float y) |
| | FP multiply with configurable rounding mode and denorm handling. More...
|
| |
| template<bool FTZ = true> |
| __device__ float | sp::divApprox (float x, float y) |
| | FP divide, computed as d = a * (1/b). More...
|
| |
| template<RoundingMode RM, bool FTZ = true> |
| __device__ float | sp::fma (float x, float y, float z) |
| | Full-range approximate FP divide. More...
|
| |
| template<RoundingMode RM, bool FTZ = true> |
| __device__ double | sp::fma (double x, double y, double z) |
| | FP multiply-add with configurable rounding mode and denorm handling. More...
|
| |
| template<RoundingMode RM, bool FTZ = true> |
| __device__ double | sp::mul (double x, double y) |
| | FP multiply with configurable rounding mode and denorm handling. More...
|
| |
| template<RoundingMode RM, bool FTZ = true> |
| __device__ float | sp::approxRcp (float x) |
| | FP approximate recirprocal with configurable rounding mode and denorm handling. More...
|
| |
|
template<bool FTZ = true> |
| __device__ float | sp::approxSqrt (float x) |
| |
|
template<bool FTZ = true> |
| __device__ float | sp::approxRSqrt (float x) |
| |
| template<bool FTZ = true> |
| __device__ float | sp::approxExp2 (float x) |
| | Compute a fast approximation to exp2(). More...
|
| |
| template<bool FTZ = true> |
| __device__ float | sp::approxLog2 (float x) |
| | Compute a fast approximation to Log2(). More...
|
| |
| template<bool FTZ = true> |
| __device__ float | sp::approxSin (float x) |
| | Compute a fast approximation to sin(). More...
|
| |
| template<bool FTZ = true> |
| __device__ float | sp::approxCos (float x) |
| | Compute a fast approximation to cos(). More...
|
| |
These functions provide convenient access to the floating point instructions with special rounding modes.
While these operations are somewhat more clunky to use than the regular FP operators, they can be occasionally helpful when writing particularly accuracy-sensitive code.
Typically, there is no performance penalty for using these operators over their ordinary counterparts. You just get a different value.
| __device__ float sp::fma |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
z |
|
) |
| |
Full-range approximate FP divide.
A fast, full-range approximation to divide. FP multiply-add with configurable rounding mode and denorm handling.
TODO: Saturation is supported by this instruction.
Computes (x * y) + z with no intermediate rounding.
- Template Parameters
-
| RM | Rounding mode to use for the final result. |
| FTZ | If true, denormal inputs may be flushed to zero. |