summaryrefslogtreecommitdiff
path: root/kernels
diff options
context:
space:
mode:
authorRuiling Song <ruiling.song@intel.com>2013-11-05 16:37:12 +0800
committerZhigang Gong <zhigang.gong@intel.com>2013-11-06 11:05:35 +0800
commit34a5e8b94470623ce5ae40827a68e00c3592bf94 (patch)
tree32b57528cfd4cd90a84e0db33589dc3ff0d1daf0 /kernels
parent2a52b04d3d0d83ff9019059b8cffedac1122ef51 (diff)
utests: use mad which will get better precision.
Normal mul/add could not met the precision requirement of this case. Previously it passed because we will do mad optimization in backend. Use mad directly, so the test case does not depend on backend optimization. Signed-off-by: Ruiling Song <ruiling.song@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Diffstat (limited to 'kernels')
-rw-r--r--kernels/compiler_menger_sponge_no_shadow.cl2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernels/compiler_menger_sponge_no_shadow.cl b/kernels/compiler_menger_sponge_no_shadow.cl
index 4de6c10a..27b059a5 100644
--- a/kernels/compiler_menger_sponge_no_shadow.cl
+++ b/kernels/compiler_menger_sponge_no_shadow.cl
@@ -15,7 +15,7 @@ typedef float4 vec4;
// fmod is not like glsl mod!
inline __attribute__((always_inline, overloadable))
-float glsl_mod(float x,float y) { return x-y*floor(x/y); }
+float glsl_mod(float x,float y) { return mad( -y, floor(x/y), x); }
inline __attribute__((always_inline, overloadable))
float2 glsl_mod(float2 a,float2 b) { return (float2)(glsl_mod(a.x,b.x), glsl_mod(a.y,b.y)); }
inline __attribute__((always_inline, overloadable))