diff options
author | rander <rander.wang@intel.com> | 2017-03-31 14:34:47 +0800 |
---|---|---|
committer | Yang Rong <rong.r.yang@intel.com> | 2017-04-17 16:08:49 +0800 |
commit | 9b7a7955e1b992c947a595b5d82ca89fbe7cd73c (patch) | |
tree | d49bb423e1e8214061f46571cffe25bf0a5a947e | |
parent | e747c0d6706f44d63861728b92fcadeb48948fe9 (diff) |
backend: add double version of fma
simulated by mad, need to be refined to pass cft
Signed-off-by: rander <rander.wang@intel.com>
Tested-by: Yang Rong <rong.r.yang@intel.com>
-rw-r--r-- | backend/src/libocl/tmpl/ocl_math_common.tmpl.cl | 5 | ||||
-rw-r--r-- | backend/src/libocl/tmpl/ocl_math_common.tmpl.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/backend/src/libocl/tmpl/ocl_math_common.tmpl.cl b/backend/src/libocl/tmpl/ocl_math_common.tmpl.cl index 40c96292..6abf5a76 100644 --- a/backend/src/libocl/tmpl/ocl_math_common.tmpl.cl +++ b/backend/src/libocl/tmpl/ocl_math_common.tmpl.cl @@ -1444,6 +1444,11 @@ OVERLOADABLE double floor(double x) } } +OVERLOADABLE double fma(double x, double y, double z) +{ + return mad(x, y, z); +} + OVERLOADABLE double hypot(double x, double y) { double a=x,b=y,t1,t2,y1,y2,w; diff --git a/backend/src/libocl/tmpl/ocl_math_common.tmpl.h b/backend/src/libocl/tmpl/ocl_math_common.tmpl.h index 51b943b7..6c479af4 100644 --- a/backend/src/libocl/tmpl/ocl_math_common.tmpl.h +++ b/backend/src/libocl/tmpl/ocl_math_common.tmpl.h @@ -47,6 +47,7 @@ OVERLOADABLE double floor(double x); OVERLOADABLE double fmax(double a, double b); OVERLOADABLE double fmin(double a, double b); OVERLOADABLE double fmod (double x, double y); +OVERLOADABLE double fma(double x, double y, double z); OVERLOADABLE double hypot(double x, double y); OVERLOADABLE double ldexp(double x, int n); OVERLOADABLE double log(double x); |