From ec2edb2c927e86944a0c5e077fa634357ef3d1d4 Mon Sep 17 00:00:00 2001 From: Jorghi12 Date: Sat, 26 May 2018 16:21:14 -0400 Subject: [PATCH] Update math_functions.cpp CUDA also has a function named labs. --- src/math_functions.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/math_functions.cpp b/src/math_functions.cpp index bd0116080d..982073275b 100644 --- a/src/math_functions.cpp +++ b/src/math_functions.cpp @@ -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; }