| 1291 | /// \param arg function argument |
| 1292 | /// \return function value stored in single-preicision |
| 1293 | MEGDNN_HOST MEGDNN_DEVICE static expr cbrt(float arg) |
| 1294 | { |
| 1295 | #if defined(__CUDA_ARCH__) |
| 1296 | return expr(cbrtf(arg)); |
| 1297 | #elif HALF_ENABLE_CPP11_CMATH |
| 1298 | return expr(std::cbrt(arg)); |
| 1299 | #else |
| 1300 | if(builtin_isnan(arg) || builtin_isinf(arg)) |
| 1301 | return expr(arg); |
| 1302 | return expr(builtin_signbit(arg) ? -static_cast<float>(pow(fabs(static_cast<double>(arg)), 1.0/3.0)) : |
| 1303 | static_cast<float>(pow(static_cast<double>(arg), 1.0/3.0))); |
| 1304 | #endif |
| 1305 | } |
| 1306 | |
| 1307 | /// Hypotenuse implementation. |
| 1308 | /// \param x first argument |
nothing calls this directly
no test coverage detected