Update math_functions.cpp

CUDA also has a function named labs.
This commit is contained in:
Jorghi12
2018-05-26 16:21:14 -04:00
committed by GitHub
parent 4383d6c6de
commit ec2edb2c92
+3
View File
@@ -65,6 +65,9 @@ __device__ double abs(double x) {
__device__ long int abs(long int x) {
return x >= 0 ? x : -x;
}
__device__ long long int labs(long long int x) {
return x >= 0 ? x : -x;
}
__device__ float fabsf(float x) { return hc::precise_math::fabsf(x); }
__device__ float fdimf(float x, float y) { return hc::precise_math::fdimf(x, y); }
__device__ float fdividef(float x, float y) { return x / y; }