 #define __CL_ENABLE_EXCEPTIONS
 #define __NO_STD_VECTOR
 #define __NO_STD_STRING
#include <CL/cl.h> 
 #if defined(__APPLE__) || defined(__MACOSX)
 #include <OpenCL/cl.hpp>
 #else
 #include <CL/cl.hpp>
 #endif
 #include <cstdio>
 #include <cstdlib>
 #include <iostream>
 
  const char * helloStr  = "__kernel void "
                           "hello(void) "
                           "{ "
                           "  "
                           "} ";
 
  int
  main(void)
  {
     cl_int err = CL_SUCCESS;
     try {
       cl::Context context(CL_DEVICE_TYPE_CPU, 0, NULL, NULL, &err); 
 
       cl::vector<cl::Device> devices = context.getInfo<CL_CONTEXT_DEVICES>();
 
       cl::Program::Sources source(1,
           std::make_pair(helloStr,strlen(helloStr)));
       cl::Program program_ = cl::Program(context, source);
       program_.build(devices);
 
       cl::Kernel kernel(program_, "hello", &err);
 
       cl::CommandQueue queue(context, devices[0], 0, &err);
       cl::KernelFunctor func = kernel.bind(
          queue,
          cl::NDRange(4, 4),
          cl::NDRange(2, 2));
 
       func().wait();
     }
     catch (cl::Error err) {
        std::cerr 
           << "ERROR: "
           << err.what()
           << "("
           << err.err()
           << ")"
           << std::endl;
     }
 
    return EXIT_SUCCESS;
  }

