diff options
| author | Ruiling Song <ruiling.song@intel.com> | 2014-12-22 12:27:18 +0800 |
|---|---|---|
| committer | Zhigang Gong <zhigang.gong@intel.com> | 2014-12-22 12:41:15 +0800 |
| commit | 81781646bee872ac4267c7dc75634de55bc9a377 (patch) | |
| tree | bf9e5dfd1e9f90c6fa13e0b39a2fee6d6f3ecf0a /backend/src/libocl | |
| parent | 1ccc553933d66f812f22121b369a729331374458 (diff) | |
libocl: Correctly handle -inf in exp10.
exp10(-inf) should return 0.0f
Signed-off-by: Ruiling Song <ruiling.song@intel.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Diffstat (limited to 'backend/src/libocl')
| -rw-r--r-- | backend/src/libocl/tmpl/ocl_math.tmpl.cl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/backend/src/libocl/tmpl/ocl_math.tmpl.cl b/backend/src/libocl/tmpl/ocl_math.tmpl.cl index 5d73c163..220f3515 100644 --- a/backend/src/libocl/tmpl/ocl_math.tmpl.cl +++ b/backend/src/libocl/tmpl/ocl_math.tmpl.cl @@ -2709,10 +2709,10 @@ OVERLOADABLE float __gen_ocl_internal_exp10(float x){ P[3] = 2.034649854009453E+000; P[4] = 2.650948748208892E+000; P[5] = 2.302585167056758E+000; - if( isinf(x)) - return INFINITY; - if( x < -MAXL10 )return 0.0; + if( x < -MAXL10 ) return 0.0; + + if( isinf(x)) return INFINITY; /* The following is necessary because range reduction blows up: */ if( x == 0 )return 1.0; |
