Kernel doesn't work on Intel CPU,but works fine on GeForce and SOMETIMES at Intel HD

Hello!

I have a strange trouble with my kernel…

I use laptop Lenovo U430p with Intel Haswell i5 processor with integrated Nvidia GeForce GT 730M (Nvidia Optimus).

Kernel works on NVidia all the time.
Kernel DOES NOT work on Intel CPU all the time.
Kernel DOES NOT works on Intel GPU SOMETIMES (very rarely).

Looks like a bug in a synchronization.

Visual Studio 2012 solution with tests can be downloaded at Dropbox - Error - Simplify your life
Screenshot 1 [ATTACH=CONFIG]51[/ATTACH]
Screenshot 2 [ATTACH=CONFIG]52[/ATTACH]

Can anyone reproduce this bug?
Is there bug in my code instead of the bug in Intel OpenCL implementation?
Any ideas about how to enlight this bug?

I have COMPLETELY no ideas how to investigate this issue…

Thanks!

ps. addition - I use C# with OpenCL.Net.
pps. I use actual version of Intel OpenCL SDK.

I am having the same problem. I noticed that if the barriers are taken off, the kernel is compiled and executed, but it doesn´t gave the correct answer.

I’ve found something interesting…

  1. switch read-write mem

    __global float * gdata

to read-only mode.

  1. introduce a new write-only mem:

    __global float * tdata,

  2. write results to tdata instead of gdata:

    if(get_local_id(0) == 0)
    {
    tdata[get_group_id(0)] = ldata[0];
    }

Then the kernel works fine at all three platforms (intel cpu, intel gpu, NVidia geforce gt 730m). Unfortunately, it’s not an answer too ))

Fixed solution can be found here: Dropbox - Error