6 Replies Latest reply on Jun 18, 2010 6:15 PM by koarl0815

    Simple OpenCL kernel freezes system with Stream SDK 2.1



      The attached OpenCL kernel is supposed to compute a plane rotation of two vectors. For some reasons, it leads to a system freeze under Stream SDK 2.1, while it works correctly under another OpenCL implementation. Does anyone have an idea why this could be the case? Could it be related to a bug in the Stream SDK?

      Again, the WARNING: The code below may freeze your system.

      Best regards,


      ////// plane rotation: (x,y) <- (\alpha x + \beta y, -\beta x + \alpha y) __kernel void plane_rotation( __global float * vec1, __global float * vec2, float alpha, float beta, unsigned int size) { float tmp1 = 0; float tmp2 = 0; for (unsigned int i = get_global_id(0); i < size; i += get_global_size(0)) { tmp1 = vec1[i]; tmp2 = vec2[i]; //the following barrier is not needed, but does not improve the situation. barrier(CLK_GLOBAL_MEM_FENCE); vec1[i] = alpha * tmp1 + beta * tmp2; vec2[i] = alpha * tmp2 - beta * tmp1; } };