Add integer abs (initial implementation, can be optimized with OCML)

Change-Id: I1f568c8c0e2333af1fda4c313dc48ea0c5b6ab00


[ROCm/clr commit: 8bd34535b4]
This commit is contained in:
Ben Sander
2017-04-11 01:16:28 +00:00
parent 0d24c155a3
commit ab55162481
2 changed files with 5 additions and 0 deletions
@@ -114,6 +114,10 @@ __device__ float expm1f(float x)
{
return hc::precise_math::expm1f(x);
}
__device__ int abs(int x)
{
return x >= 0 ? x : -x; // TODO - optimize with OCML
}
__device__ float fabsf(float x)
{
return hc::precise_math::fabsf(x);