OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.
1674 Discussions

CLK_LOCAL_MEM_FENCE causes OpenCL to skip a workgroup

vladimirsson
Beginner
199 Views

Hello,

Consider the following kernel:

[cpp]

__kernel void test(__global float *dest)
{
    const int gi = get_group_id(0);
    const int i = get_global_id(0);

    if(i >= 17)
        return;
    //barrier(CLK_LOCAL_MEM_FENCE);
    dest = gi;
}

[/cpp]

If I run it with local size 16 and global size 32, passing an array of size 17 to it, it will fill it as [0 ... 0 1], as expected. But if I uncomment the barrier, the last element does not get filled, as if the second group is not executed at all. This bug appears on Ubuntu 12.04 x64, Intel OpenCL SDK 2.0-31360, and does not appear on OSX OpenCL platform, or on the same Ubuntu system and nVidia CUDA 5 platform. Is this a known issue?

Thank you in advance.

0 Kudos
0 Replies
Reply