MCPcopy Create free account
hub / github.com/NVIDIA/cutlass / fpclassify

Function fpclassify

include/cutlass/tfloat32.h:229–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

227}
228
229CUTLASS_HOST_DEVICE
230int fpclassify(cutlass::tfloat32_t const& h) {
231 int exp = h.exponent_biased();
232 int mantissa = h.mantissa();
233 if (exp == 0x0ff) {
234 if (mantissa) {
235 return FP_NAN;
236 }
237 else {
238 return FP_INFINITE;
239 }
240 }
241 else if (!exp) {
242 if (mantissa) {
243 return FP_SUBNORMAL;
244 }
245 else {
246 return FP_ZERO;
247 }
248 }
249 return FP_NORMAL;
250}
251
252CUTLASS_HOST_DEVICE
253cutlass::tfloat32_t sqrt(cutlass::tfloat32_t const& h) {

Callers

nothing calls this directly

Calls 2

exponent_biasedMethod · 0.45
mantissaMethod · 0.45

Tested by

no test coverage detected