[Beignet] [VER_2 5/5] test exp2, exp10, expm1

Homer Hsing homer.xing at intel.com
Wed May 8 20:20:40 PDT 2013


Signed-off-by: Homer Hsing <homer.xing at intel.com>
---
 kernels/compiler_math.cl | 3 +++
 utests/compiler_math.cpp | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/kernels/compiler_math.cl b/kernels/compiler_math.cl
index de2cda3..494cba1 100644
--- a/kernels/compiler_math.cl
+++ b/kernels/compiler_math.cl
@@ -12,6 +12,9 @@ __kernel void compiler_math(__global float *dst, __global float *src) {
     case 7: dst[i] = cbrt(x); break;
     case 8: dst[i] = ceil(x); break;
     case 9: dst[i] = cospi(x); break;
+    case 10: dst[i] = exp2(x); break;
+    case 11: dst[i] = exp10(x); break;
+    case 12: dst[i] = expm1(x); break;
     default: dst[i] = 1.f; break;
   };
 }
diff --git a/utests/compiler_math.cpp b/utests/compiler_math.cpp
index efc7160..879f649 100644
--- a/utests/compiler_math.cpp
+++ b/utests/compiler_math.cpp
@@ -17,6 +17,9 @@ static void cpu_compiler_math(float *dst, float *src, int i)
     case 7: dst[i] = powf(x, 0.3333333333333333333f); break;
     case 8: dst[i] = ceilf(x); break;
     case 9: dst[i] = cosf(PI * x); break;
+    case 10: dst[i] = powf(2, x); break;
+    case 11: dst[i] = powf(10, x); break;
+    case 12: dst[i] = expf(x) - 1; break;
     default: dst[i] = 1.f; break;
   };
 }
-- 
1.8.1.2



More information about the Beignet mailing list