MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / getHalfNegative11

Function getHalfNegative11

src/backend/cuda/kernel/random_engine.hpp:102–107  ·  view source on GitHub ↗

Generates rationals in (-1, 1]

Source from the content-addressed store, hash-verified

100
101// Generates rationals in (-1, 1]
102__device__ static __half getHalfNegative11(uint num) {
103 // convert to ushort before the min operation
104 ushort v = min(max_int_before_infinity, ushort(num));
105 return __hfma(__ushort2half_rn(v), SIGNED_HALF_FACTOR,
106 SIGNED_HALF_HALF_FACTOR);
107}
108
109// Generates rationals in (0, 1]
110__device__ static float getFloat01(uint num) {

Callers 2

Calls 2

__hfmaFunction · 0.85
minFunction · 0.50

Tested by

no test coverage detected