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

Change-Id: I1f568c8c0e2333af1fda4c313dc48ea0c5b6ab00


[ROCm/clr commit: 8bd34535b4]
Этот коммит содержится в:
Ben Sander
2017-04-11 01:16:28 +00:00
родитель 0d24c155a3
Коммит ab55162481
2 изменённых файлов: 5 добавлений и 0 удалений
+1
Просмотреть файл
@@ -51,6 +51,7 @@ __device__ float exp10f(float x);
__device__ float exp2f(float x);
__device__ float expf(float x);
__device__ float expm1f(float x);
__device__ int abs(int x);
__device__ float fabsf(float x);
__device__ float fdimf(float x, float y);
__device__ float fdividef(float x, float y);
+4
Просмотреть файл
@@ -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);