 buffer objects created with the same host_ptr or overlapping host regions is
 considered to be undefined.
 
- * 'CLMEM_ALLOC_HOST_PTR', This flag specifies that the application wants the
+ * 'CL_MEM_ALLOC_HOST_PTR', This flag specifies that the application wants the
 OpenCL implementation to allocate memory from host accessible
-memory. 'CLMEM_ALLOC_HOST_PTR' and 'CLMEM_USE_HOST_PTR' are mutually exclusive.
-
- * 'CLMEM_COPY_HOST_PTR', This flag is valid only if host_ptr is not NULL. If
+memory. 'CL_MEM_ALLOC_HOST_PTR' and 'CL_MEM_USE_HOST_PTR' are mutually exclusive.
+
+ * 'CL_MEM_COPY_HOST_PTR', This flag is valid only if host_ptr is not NULL. If
 specified, it indicates that the application wants the OpenCL implementation to
 allocate memory for the memory object and copy the data from memory referenced
-by host_ptr. 'CLMEM_COPY_HOST_PTR' and 'CLMEM_USE_HOST_PTR' are mutually
-exclusive. 'CLMEM_COPY_HOST_PTR' can be used with 'CLMEM_ALLOC_HOST_PTR' to
+by host_ptr. 'CL_MEM_COPY_HOST_PTR' and 'CL_MEM_USE_HOST_PTR' are mutually
+exclusive. 'CL_MEM_COPY_HOST_PTR' can be used with 'CL_MEM_ALLOC_HOST_PTR' to
 initialize the contents of the cl_mem object allocated using host-accessible
 (e.g. PCIe) memory.  
 -} 
-{#enum CLMemFlag {} deriving( Show ) #}
+{#enum CLMemFlag {upcaseFirstLetter} deriving( Show ) #}
 
 -- -----------------------------------------------------------------------------
 getCLValue :: (Enum a, Integral b) => a -> b


getCommandExecutionStatus :: CLint -> Maybe CLCommandExecutionStatus                                
getCommandExecutionStatus n 
  | n < 0 = Just CLEXEC_ERROR
  | otherwise = Just . toEnum . fromIntegral $ n
                
-- -----------------------------------------------------------------------------

profile. The embedded profile is  defined to be a subset for each version of 
OpenCL.

 * 'CL_PLATFORM_VERSION', OpenCL version string. Returns the OpenCL version 
supported by the implementation. This version string has the following format: 
/OpenCL major_version.minor_version platform-specific information/ The 
/major_version.minor_version/ value returned will be 1.0.
                    
 * 'CL_PLATFORM_NAME', Platform name string.
 
 * 'CL_PLATFORM_VENDOR', Platform vendor string.
                   
 * 'CL_PLATFORM_EXTENSIONS', Returns a space-separated list of extension names 
(the extension names themselves do not contain any spaces) supported by the 
platform. Extensions defined here must be supported by all devices associated 
with this platform.
-}
{#enum CLPlatformInfo {upcaseFirstLetter} deriving( Show ) #}

-- -----------------------------------------------------------------------------
#c
enum CLDeviceType {
  cL_DEVICE_TYPE_CPU=CL_DEVICE_TYPE_CPU,
  cL_DEVICE_TYPE_GPU=CL_DEVICE_TYPE_GPU,
  cL_DEVICE_TYPE_ACCELERATOR=CL_DEVICE_TYPE_ACCELERATOR,
  cL_DEVICE_TYPE_DEFAULT=CL_DEVICE_TYPE_DEFAULT,
  cL_DEVICE_TYPE_ALL=CL_DEVICE_TYPE_ALL
  };
#endc

{-|
 * 'CL_DEVICE_TYPE_CPU', An OpenCL device that is the host processor. The host 
processor runs the OpenCL implementations and is a single or multi-core CPU.
                  
 * 'CL_DEVICE_TYPE_GPU', An OpenCL device that is a GPU. By this we mean that the 
device can also be used to accelerate a 3D API such as OpenGL or DirectX.
                  
 * 'CL_DEVICE_TYPE_ACCELERATOR', Dedicated OpenCL accelerators (for example the 
IBM CELL Blade). These devices communicate with the host processor using a 
peripheral interconnect such as PCIe.
                
 * 'CL_DEVICE_TYPE_DEFAULT', The default OpenCL device in the system.
           
 * 'CL_DEVICE_TYPE_ALL', All OpenCL devices available in the system.
-}
{#enum CLDeviceType {upcaseFirstLetter} deriving( Show ) #}

#c
enum CLCommandQueueProperty { 
  cL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE=CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE,
  cL_QUEUE_PROFILING_ENABLE=CL_QUEUE_PROFILING_ENABLE
  };
#endc

{-|
 * 'CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE', Determines whether the commands 
queued in the command-queue are executed in-order or out-of-order. If set, the 
commands in the command-queue are executed out-of-order. Otherwise, commands are 
executed in-order.
                            
 * 'CL_QUEUE_PROFILING_ENABLE', Enable or disable profiling of commands in the 
command-queue. If set, the profiling of commands is enabled. Otherwise profiling 
of commands is disabled. See 'clGetEventProfilingInfo' for more information.
-}
{#enum CLCommandQueueProperty {upcaseFirstLetter} deriving( Show, Bounded, Eq, Ord ) #}

#c
enum CLDeviceFPConfig {
  cL_FP_DENORM=CL_FP_DENORM, cL_FP_INF_NAN=CL_FP_INF_NAN,
  cL_FP_ROUND_TO_NEAREST=CL_FP_ROUND_TO_NEAREST,
  cL_FP_ROUND_TO_ZERO=CL_FP_ROUND_TO_ZERO,
  cL_FP_ROUND_TO_INF=CL_FP_ROUND_TO_INF, cL_FP_FMA=CL_FP_FMA,
  };
#endc

{-|
 * 'CL_FP_DENORM', denorms are supported.
                      
 * 'CL_FP_INF_NAN', INF and NaNs are supported.
                      
 * 'CL_FP_ROUND_TO_NEAREST', round to nearest even rounding mode supported.
                      
 * 'CL_FP_ROUND_TO_ZERO', round to zero rounding mode supported.
                      
 * 'CL_FP_ROUND_TO_INF', round to +ve and -ve infinity rounding modes supported.
                      
 * 'CL_FP_FMA', IEEE754-2008 fused multiply-add is supported.
-}
{#enum CLDeviceFPConfig {upcaseFirstLetter} deriving( Show, Bounded, Eq, Ord ) #}

#c
enum CLDeviceExecCapability {
  cL_EXEC_KERNEL=CL_EXEC_KERNEL,
  cL_EXEC_NATIVE_KERNEL=CL_EXEC_NATIVE_KERNEL
  };
#endc

{-|
 * 'CL_EXEC_KERNEL', The OpenCL device can execute OpenCL kernels.
                            
 * 'CL_EXEC_NATIVE_KERNEL', The OpenCL device can execute native kernels.
-}
{#enum CLDeviceExecCapability {upcaseFirstLetter} deriving( Show, Bounded, Eq, Ord ) #}

#c
enum CLDeviceMemCacheType {
  cL_NONE=CL_NONE, cL_READ_ONLY_CACHE=CL_READ_ONLY_CACHE,
  cL_READ_WRITE_CACHE=CL_READ_WRITE_CACHE
  };
#endc

{#enum CLDeviceMemCacheType {upcaseFirstLetter} deriving( Show ) #}

#c
enum CLDeviceLocalMemType {
  cL_LOCAL=CL_LOCAL, cL_GLOBAL=CL_GLOBAL
  };
#endc

{#enum CLDeviceLocalMemType {upcaseFirstLetter} deriving( Show ) #}

-- -----------------------------------------------------------------------------
#c
enum CLCommandType {
  cL_COMMAND_NDRANGE_KERNEL=CL_COMMAND_NDRANGE_KERNEL,
  cL_COMMAND_TASK=CL_COMMAND_TASK ,
  cL_COMMAND_NATIVE_KERNEL=CL_COMMAND_NATIVE_KERNEL,
  cL_COMMAND_READ_BUFFER=CL_COMMAND_READ_BUFFER,
  cL_COMMAND_WRITE_BUFFER=CL_COMMAND_WRITE_BUFFER,
  cL_COMMAND_COPY_BUFFER=CL_COMMAND_COPY_BUFFER,
  cL_COMMAND_READ_IMAGE=CL_COMMAND_READ_IMAGE,
  cL_COMMAND_WRITE_IMAGE=CL_COMMAND_WRITE_IMAGE,
  cL_COMMAND_COPY_IMAGE=CL_COMMAND_COPY_IMAGE,
  cL_COMMAND_COPY_BUFFER_TO_IMAGE=CL_COMMAND_COPY_BUFFER_TO_IMAGE,
  cL_COMMAND_COPY_IMAGE_TO_BUFFER=CL_COMMAND_COPY_IMAGE_TO_BUFFER,
  cL_COMMAND_MAP_BUFFER=CL_COMMAND_MAP_BUFFER,
  cL_COMMAND_MAP_IMAGE=CL_COMMAND_MAP_IMAGE,
  cL_COMMAND_UNMAP_MEM_OBJECT=CL_COMMAND_UNMAP_MEM_OBJECT,
  cL_COMMAND_MARKER=CL_COMMAND_MARKER,
  cL_COMMAND_ACQUIRE_GL_OBJECTS=CL_COMMAND_ACQUIRE_GL_OBJECTS,
  cL_COMMAND_RELEASE_GL_OBJECTS=CL_COMMAND_RELEASE_GL_OBJECTS
  };
#endc

-- | Command associated with an event.
{#enum CLCommandType {upcaseFirstLetter} deriving( Show ) #}

#c
enum CLCommandExecutionStatus {
  cL_QUEUED=CL_QUEUED, cL_SUBMITTED=CL_SUBMITTED, cL_RUNNING=CL_RUNNING,
  cL_COMPLETE=CL_COMPLETE, cL_EXEC_ERROR= -1
  };
#endc

{-|
 * 'CL_QUEUED', command has been enqueued in the command-queue.

 * 'CL_SUBMITTED', enqueued command has been submitted by the host to the 
device associated with the command-queue.

 * 'CL_RUNNING', device is currently executing this command.
                            
 * 'CL_COMPLETE', the command has completed.
                              
 * 'CL_EXEC_ERROR', command was abnormally terminated.
-}
{#enum CLCommandExecutionStatus {upcaseFirstLetter} deriving( Show ) #}

#c
enum CLProfilingInfo {
  cL_PROFILING_COMMAND_QUEUED=CL_PROFILING_COMMAND_QUEUED,
  cL_PROFILING_COMMAND_SUBMIT=CL_PROFILING_COMMAND_SUBMIT,
  cL_PROFILING_COMMAND_START=CL_PROFILING_COMMAND_START,
  cL_PROFILING_COMMAND_END=CL_PROFILING_COMMAND_END
  };
#endc

{-| Specifies the profiling data.

 * 'CL_PROFILING_COMMAND_QUEUED', A 64-bit value that describes the current 
device time counter in nanoseconds when the command identified by event is 
enqueued in a command-queue by the host.
 
 * 'CL_PROFILING_COMMAND_SUBMIT', A 64-bit value that describes the current 
device time counter in nanoseconds when the command identified by event that has 
been enqueued is submitted by the host to the device associated with the 
commandqueue.
 
 * 'CL_PROFILING_COMMAND_START', A 64-bit value that describes the current 
device time counter in nanoseconds when the command identified by event starts 
execution on the device.
 
 * 'CL_PROFILING_COMMAND_END', A 64-bit value that describes the current device 
time counter in nanoseconds when the command identified by event has finished 
execution on the device.
-}
{#enum CLProfilingInfo {upcaseFirstLetter} deriving( Show ) #}

-- -----------------------------------------------------------------------------
#c
enum CLMemFlag {
  cL_MEM_READ_WRITE=CL_MEM_READ_WRITE,
  cL_MEM_WRITE_ONLY=CL_MEM_WRITE_ONLY,
  cL_MEM_READ_ONLY=CL_MEM_READ_ONLY,
  cL_MEM_USE_HOST_PTR=CL_MEM_USE_HOST_PTR,
  cL_MEM_ALLOC_HOST_PTR=CL_MEM_ALLOC_HOST_PTR,
  cL_MEM_COPY_HOST_PTR=CL_MEM_COPY_HOST_PTR
  };
#endc
{-| 
 * 'CL_MEM_READ_WRITE', This flag specifies that the memory object will be
read and written by a kernel. This is the default.

 * 'CL_MEM_WRITE_ONLY', This flags specifies that the memory object will be
written but not read by a kernel. Reading from a buffer or image object created
with 'CLMEM_WRITE_ONLY' inside a kernel is undefined.

 * 'CL_MEM_READ_ONLY', This flag specifies that the memory object is a read-only
memory object when used inside a kernel. Writing to a buffer or image object
created with 'CLMEM_READ_ONLY' inside a kernel is undefined.

 * 'CL_MEM_USE_HOST_PTR', This flag is valid only if host_ptr is not NULL. If
specified, it indicates that the application wants the OpenCL implementation to
use memory referenced by host_ptr as the storage bits for the memory
object. OpenCL implementations are allowed to cache the buffer contents pointed
