MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / cbrt

Method cbrt

samples/common/half.h:1848–1858  ·  view source on GitHub ↗

Cubic root implementation. \param arg function argument \return function value stored in single-preicision

Source from the content-addressed store, hash-verified

1846 /// \param arg function argument
1847 /// \return function value stored in single-preicision
1848 static expr cbrt(float arg)
1849 {
1850#if HALF_ENABLE_CPP11_CMATH
1851 return expr(std::cbrt(arg));
1852#else
1853 if (builtin_isnan(arg) || builtin_isinf(arg))
1854 return expr(arg);
1855 return expr(builtin_signbit(arg) ? -static_cast<float>(std::pow(-static_cast<double>(arg), 1.0 / 3.0))
1856 : static_cast<float>(std::pow(static_cast<double>(arg), 1.0 / 3.0)));
1857#endif
1858 }
1859
1860 /// Hypotenuse implementation.
1861 /// \param x first argument

Callers

nothing calls this directly

Calls 6

exprClass · 0.70
cbrtFunction · 0.70
builtin_isnanFunction · 0.70
builtin_isinfFunction · 0.70
builtin_signbitFunction · 0.70
powFunction · 0.70

Tested by

no test coverage detected