Repeatedly incrementing array elements using OpenCL
Sorry, but this is a general review and will not answer your specific question. While this is a simple test program, it is good to develop some habits in writing C or C++ programs.

Complexity
One of the good habits to keep in mind is the Single Responsibility Principle which states 


  "every module, class, or function should have responsibility over a
  single part of the functionality provided by the software, ...".


The Single Responsibility Principle is the first pillar in SOLID programming. SOLID programming is a set of principles that generally improve object oriented programming.

The code is too complex to be in one function, main() could be divided into may functions that would make it easier to read and debug. Generally main() should do the following when necessary:
 - call a function to process command line arguments.
 - call functions to set up for any processing
 - call one function to do the processing, this function may call
   many other functions
 - call functions to clean up after processing

In this program there doesn't seem to be any command line arguments so that function isn't necessary. Some possible functions called by main():
 - Set Up Platforms
 - Set Up Devices
 - Set Up Program
 - Set Up Queues
 - Execute Program
Any or all of these functions can return bool or int to indicate success or failure

Use System Defined Constants to Make Code More Readable
Rather than using return(1); or return(0) in main there are constants defined in cstdlib or stdlib.h that indicate success or failure of a program, these are EXIT_SUCCESS and EXIT_FAILURE. Since they are system defined they are more portable than zero or one. They also make the code self documenting:

    return(EXIT_SUCCESS);

    return(EXIT_FAILURE);


Avoid the Use of the Exit Function in C++ and C
The code is good in that it only calls std::exit() from main(), however, it is generally a bad idea to call std::exit() especially from functions that are not main(). When calling exit from a function other than main no cleanup code will be called and if the program is a program that shouldn't terminate such as an operating system there can be dire side effects. Even calling exit from main may not clean up after processing as explained in this stackoverflow.com question. The accepted practice is to call return from main.