11#ifndef _CU_ARITHMETICS_CU_ABS_H_
12#define _CU_ARITHMETICS_CU_ABS_H_
18#include "../_cu_definitions/cu_types.h"
57 template <
typename DataType>
58 inline __host__ __device__ DataType
abs(
const DataType x);
75 #if defined(USE_CUDA_FP8_E5M2) && (USE_CUDA_FP8_E5M2 == 1)
102 #if defined(USE_CUDA_FP8_E4M3) && (USE_CUDA_FP8_E4M3 == 1)
128 #if defined(USE_CUDA_FP16) && (USE_CUDA_FP16 == 1)
151 #if defined(USE_CUDA_BF16) && (USE_CUDA_BF16 == 1)
174 #if defined(USE_CUDA_FP32) && (USE_CUDA_FP32 == 1)
196 #if defined(USE_CUDA_FP64) && (USE_CUDA_FP64 == 1)
Cast from float to __half and __nv_bfloat16 types and vice-versa, and float to double and vice-versa.
__host__ __device__ float abs< float >(const float x)
Absolute value of a floating point number in __nv_fp8_e5m2 type.
__host__ __device__ DataType abs(const DataType x)
Absolute value of a floating point number.
__host__ __device__ double abs< double >(const double x)
Absolute value of a floating point number in double type.