 #endif
 
 -- -----------------------------------------------------------------------------
+type NativeKernelCallback = Ptr () -> IO ()
+foreign import CALLCONV "wrapper" wrapNativeKernelCallback :: 
+  NativeKernelCallback -> IO (FunPtr NativeKernelCallback)
 foreign import CALLCONV "clCreateCommandQueue" raw_clCreateCommandQueue :: 
   CLContext -> CLDeviceID -> CLCommandQueueProperty_ -> Ptr CLint -> IO CLCommandQueue
 foreign import CALLCONV "clRetainCommandQueue" raw_clRetainCommandQueue :: 

  clEnqueueCopyBufferToImage, clEnqueueMapBuffer, clEnqueueMapImage,
  clEnqueueUnmapMemObject,
  -- * Executing Kernels
  clEnqueueNDRangeKernel, clEnqueueTask, clEnqueueMarker, 
  clEnqueueWaitForEvents, clEnqueueBarrier,
  -- * Flush and Finish
  clFlush, clFinish
  ) where

  CLCommandQueue -> CLMem -> Ptr () -> CLuint -> Ptr CLEvent -> Ptr CLEvent -> IO CLint
foreign import CALLCONV "clEnqueueNDRangeKernel" raw_clEnqueueNDRangeKernel :: 
  CLCommandQueue -> CLKernel -> CLuint -> Ptr CSize -> Ptr CSize -> Ptr CSize -> CLuint -> Ptr CLEvent -> Ptr CLEvent -> IO CLint
foreign import CALLCONV "clEnqueueNativeKernel" raw_clEnqueueNativeKernel ::
  CLCommandQueue ->  FunPtr NativeKernelCallback -> Ptr () -> CSize -> CLuint -> Ptr CLMem -> Ptr (Ptr ()) -> CLuint -> Ptr CLEvent -> Ptr CLEvent -> IO CLint
foreign import CALLCONV "clEnqueueTask" raw_clEnqueueTask :: 
  CLCommandQueue -> CLKernel -> CLuint -> Ptr CLEvent -> Ptr CLEvent -> IO CLint
foreign import CALLCONV "clEnqueueMarker" raw_clEnqueueMarker :: 
