4 Replies Latest reply on Aug 16, 2010 12:17 PM by danbartlett@ntlworld.com

    Floating point division by zero error when building CL programs for CPU



      When I try to build a CL program for my CPU (Intel Core i7 Q720) using Delphi, I get a "EZeroDivide" exception (Floating point division by zero).  The kernel code is just a nonsense test kernel, but it builds + runs on the GPU ok.  If I remove "sin" from the kernel, it compiles + runs ok, but I've also had problems with other kernels causing a divide by zero error when building.


      __kernel void some_func(__global float4 * inval, __global float * outval) { size_t gid = get_global_id(0); float g_size = (float)get_global_size(0); outval[gid] = sin((float)gid/g_size) * length(inval[gid]) + 17.0f; }