no "div by zero" in smoothstep test case
authorHomer Hsing <homer.xing@intel.com>
Mon, 12 Aug 2013 05:51:26 +0000 (13:51 +0800)
committerZhigang Gong <zhigang.gong@linux.intel.com>
Mon, 12 Aug 2013 07:00:16 +0000 (15:00 +0800)
Signed-off-by: Homer Hsing <homer.xing@intel.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
utests/compiler_smoothstep.cpp

index 760063b..363ea7e 100644 (file)
@@ -34,7 +34,7 @@ void compiler_smoothstep(void)
   OCL_MAP_BUFFER(2);
   for (int i = 0; i < n; ++i) {
     float a = 0.1f * (rand() & 15) - 0.75f;
-    float b = a + 0.1f * (rand() & 15);
+    float b = a + 0.1f * (rand() & 15) + 0.1f;
     float c = 0.1f * (rand() & 15) - 0.75f;
     src1[i] = ((float*)buf_data[0])[i] = a;
     src2[i] = ((float*)buf_data[1])[i] = b;