 
  * 'CL_COMPILER_NOT_AVAILABLE' if program is created with
 'clCreateProgramWithSource' and a compiler is not available
-i.e. 'CL_DEVICE_COMPILER_AVAILABLE' specified in the table of OpenCL Device
-Queries for 'clGetDeviceCompilerAvailable' is set to 'False'.
+i.e. 'clGetDeviceCompilerAvailable' is set to 'False'.
 
  * 'CL_BUILD_PROGRAM_FAILURE' if there is a failure to build the program
 executable. This error will be returned if 'clBuildProgram' does not return

{-# LANGUAGE ForeignFunctionInterface, ScopedTypeVariables #-}
module System.GPU.OpenCL.Program(  
  -- * Types
  CLProgram,
  -- * Functions
  clCreateProgramWithSource, clRetainProgram, clReleaseProgram, 
  clUnloadCompiler, clBuildProgram
  ) where

-- -----------------------------------------------------------------------------
import Foreign
import Foreign.C.Types
import Foreign.C.String( CString, withCString, newCString )
import System.GPU.OpenCL.Types( 
  CLint, CLuint, CLProgram, CLContext, CLDeviceID, CLError(..), 
  wrapCheckSuccess, wrapPError )

#include <CL/cl.h>


type BuildCallback = CLProgram -> Ptr () -> IO ()
foreign import ccall "clCreateProgramWithSource" raw_clCreateProgramWithSource :: 
  CLContext -> CLuint -> Ptr CString -> Ptr CSize -> Ptr CLint -> IO CLProgram
--foreign import ccall "clCreateProgramWithBinary" raw_clCreateProgramWithBinary :: 
--  CLContext -> CLuint -> Ptr CLDeviceID -> Ptr CSize -> Ptr (Ptr Word8) -> Ptr CLint -> Ptr CLint -> IO CLProgram
foreign import ccall "clRetainProgram" raw_clRetainProgram :: 
  CLProgram -> IO CLint
foreign import ccall "clReleaseProgram" raw_clReleaseProgram :: 
