openCL barrier() is not recognized by VC++ 2010

my VC++ doesnt recognized barrier() function, as it gives error ‘barrier’: identifier not found. How can I fix that problem?

This was how I configureed VC++ to work with openCL: … 0Tutorials

barrier() can only be used inside an OpenCL kernel, and not code that is compiled by Visual Studio.

Start with one of the example projects (available, for example, in one of the SDKs, like AMD’s APP SDK). You’ll see host-side code for finding and creating device contexts, and then they will pass the kernel source to be compiled and run on the GPU.