Permalink
Browse files

Fix a bunch of warnings

  • Loading branch information...
1 parent 102bd99 commit 652524d5852dad421e660b2c8a2590308ac6ff05 @dagit committed Sep 8, 2011
@@ -5,6 +5,7 @@
module System.OpenCL.Raw.V10.CommandQueue
(clCreateCommandQueue
,clRetainCommandQueue
+ ,clReleaseCommandQueue
,clGetCommandQueueInfo
,clSetCommandQueueProperty)
where
@@ -14,8 +15,6 @@ import System.OpenCL.Raw.V10.Errors
import System.OpenCL.Raw.V10.Utils
import Foreign
import Control.Applicative
-import Data.Bits
-import Data.Maybe
import Control.Exception ( throw )
@@ -13,13 +13,9 @@ module System.OpenCL.Raw.V10.Context
where
import System.OpenCL.Raw.V10.Types
-import System.OpenCL.Raw.V10.Errors
import System.OpenCL.Raw.V10.Utils
import Foreign
import Foreign.C
-import Control.Applicative
-import Data.Bits
-import Data.Maybe
type ContextCallback = (CString -> Ptr () -> CLsizei -> Ptr () -> IO ())
@@ -10,7 +10,6 @@ import System.OpenCL.Raw.V10.Errors
import System.OpenCL.Raw.V10.Utils
import Foreign
import Control.Applicative
-import Data.Bits
import Control.Exception ( throw )
@@ -116,26 +116,26 @@ clInvalidWorkDimension = ErrorCode (-53)
clInvalidWorkGroupSize :: ErrorCode
clInvalidWorkGroupSize = ErrorCode (-54)
-clInvalidWorkItemSize :: ErrorCode
+clInvalidWorkItemSize :: ErrorCode
clInvalidWorkItemSize = ErrorCode (-55)
-clInvalidGlobalOffset :: ErrorCode
+clInvalidGlobalOffset :: ErrorCode
clInvalidGlobalOffset = ErrorCode (-56)
-clInvalidEventWaitList :: ErrorCode
+clInvalidEventWaitList :: ErrorCode
clInvalidEventWaitList = ErrorCode (-57)
-clInvalidEvent :: ErrorCode
+clInvalidEvent :: ErrorCode
clInvalidEvent = ErrorCode (-58)
-clInvalidOperation :: ErrorCode
+clInvalidOperation :: ErrorCode
clInvalidOperation = ErrorCode (-59)
-clInvalidGLObject :: ErrorCode
+clInvalidGLObject :: ErrorCode
clInvalidGLObject = ErrorCode (-60)
-clInvalidBufferSize :: ErrorCode
+clInvalidBufferSize, clInvalidMipLevel :: ErrorCode
clInvalidBufferSize = ErrorCode (-61)
clInvalidMipLevel = ErrorCode (-62)
@@ -4,12 +4,8 @@ module System.OpenCL.Raw.V10.Etc
(clGetExtensionFunctionAddress)
where
-import System.OpenCL.Raw.V10.Types
-import System.OpenCL.Raw.V10.Errors
-import System.OpenCL.Raw.V10.Utils
import Foreign
import Foreign.C
-import Control.Applicative
foreign import ccall "clGetExtensionFunctionAddress" raw_clGetExtensionFunctionAddress :: CString -> IO (Ptr ())
clGetExtensionFunctionAddress :: String -> IO (Ptr ())
@@ -9,11 +9,8 @@ module System.OpenCL.Raw.V10.EventObject
where
import System.OpenCL.Raw.V10.Types
-import System.OpenCL.Raw.V10.Errors
-import System.OpenCL.Raw.V10.Utils
import System.OpenCL.Raw.V10.Utils
import Foreign
-import Control.Applicative
foreign import ccall "clWaitForEvents" raw_clWaitForEvents :: CLuint -> Ptr Event -> IO CLint
@@ -6,10 +6,7 @@ module System.OpenCL.Raw.V10.FlushFinish
where
import System.OpenCL.Raw.V10.Types
-import System.OpenCL.Raw.V10.Errors
import System.OpenCL.Raw.V10.Utils
-import Foreign
-import Control.Applicative
foreign import ccall "clFlush" raw_clFlush :: CommandQueue -> IO CLint
clFlush :: CommandQueue -> IO ()
@@ -5,6 +5,7 @@ module System.OpenCL.Raw.V10.Kernel
,clCreateKernelsInProgram
,clRetainKernel
,clReleaseKernel
+ ,clSetKernelArg
,clGetKernelInfo
,clGetKernelWorkGroupInfo
,clEnqueueNDRangeKernel
@@ -18,11 +19,11 @@ import System.OpenCL.Raw.V10.Utils
import Foreign
import Foreign.C
import Control.Applicative
-import Data.Maybe
import Control.Exception ( throw )
foreign import ccall "clCreateKernel" raw_clCreateKernel :: Program -> CString -> Ptr CLint -> IO Kernel
+clCreateKernel :: Program -> CString -> IO Kernel
clCreateKernel program kernel_name = wrapErrorPtr $ raw_clCreateKernel program kernel_name
foreign import ccall "clCreateKernelsInProgram" raw_clCreateKernelsInProgram :: Program -> CLuint -> Ptr Kernel -> Ptr CLuint -> IO CLint
@@ -37,7 +38,7 @@ clRetainKernel kernel = wrapError $ raw_clRetainKernel kernel
foreign import ccall "clReleaseKernel" raw_clReleaseKernel :: Kernel -> IO CLint
clReleaseKernel :: Kernel -> IO ()
-clReleaseKernel kernel = wrapError $ raw_clRetainKernel kernel
+clReleaseKernel kernel = wrapError $ raw_clReleaseKernel kernel
foreign import ccall "clSetKernelArg" raw_clSetKernelArg :: Kernel -> CLuint -> CLsizei -> Ptr () -> IO CLint
clSetKernelArg :: Kernel -> CLuint -> CLsizei -> Ptr () -> IO ()
@@ -23,12 +23,8 @@ module System.OpenCL.Raw.V10.MemoryObject
where
import System.OpenCL.Raw.V10.Types
-import System.OpenCL.Raw.V10.Errors
import System.OpenCL.Raw.V10.Utils
import Foreign
-import Control.Applicative
-import Data.Maybe
-import Data.Bits
foreign import ccall "clCreateBuffer" raw_clCreateBuffer :: Context -> CLbitfield -> CLsizei -> Ptr () -> Ptr CLint -> IO Mem
@@ -81,6 +77,7 @@ enqueue fn queue events = allocaArray events_in_wait_list $ \event_wait_list ->
foreign import ccall "clEnqueueReadBuffer" raw_clEnqueueReadBuffer :: CommandQueue -> Mem -> CLbool -> CLsizei -> CLsizei -> Ptr () -> CLuint -> Ptr Event -> Ptr Event -> IO CLint
+clEnqueueReadBuffer :: Mem -> Bool -> CLsizei -> CLsizei -> Ptr () -> CommandQueue -> [Event] -> IO Event
clEnqueueReadBuffer buffer blocking_read offset cb ptr =
enqueue (\command_queue num_events_in_wait_list event_wait_list event ->
raw_clEnqueueReadBuffer
@@ -96,25 +93,29 @@ clEnqueueReadBuffer buffer blocking_read offset cb ptr =
foreign import ccall "clEnqueueWriteBuffer" raw_clEnqueueWriteBuffer :: CommandQueue -> Mem -> CLbool -> CLsizei -> CLsizei -> Ptr () -> CLuint -> Ptr Event -> Ptr Event -> IO CLint
+clEnqueueWriteBuffer :: Mem -> Bool -> CLsizei -> CLsizei -> Ptr () -> CommandQueue -> [Event] -> IO Event
clEnqueueWriteBuffer buffer blocking_write offset cb ptr =
enqueue (\command_queue num_events_in_wait_list event_wait_list event ->
raw_clEnqueueWriteBuffer command_queue buffer (if blocking_write then clTrue else clFalse) offset cb ptr num_events_in_wait_list event_wait_list event)
foreign import ccall "clEnqueueCopyBuffer" raw_clEnqueueCopyBuffer :: CommandQueue -> Mem -> Mem -> CLsizei -> CLsizei -> CLsizei -> CLuint -> Ptr Event -> Ptr Event -> IO CLint
+clEnqueueCopyBuffer :: Mem -> Mem -> CLsizei -> CLsizei -> CLsizei -> CommandQueue -> [Event] -> IO Event
clEnqueueCopyBuffer src_buffer dst_buffer src_offset dst_offset cb =
enqueue (\command_queue num_events_in_wait_list event_wait_list event ->
raw_clEnqueueCopyBuffer command_queue src_buffer dst_buffer src_offset dst_offset cb num_events_in_wait_list event_wait_list event)
type ImageDims = (CLsizei,CLsizei,CLsizei)
foreign import ccall "clEnqueueReadImage" raw_clEnqueueReadImage :: CommandQueue -> Mem -> CLbool -> Ptr CLsizei -> Ptr CLsizei -> CLsizei -> CLsizei -> Ptr () -> CLuint -> Ptr Event -> Ptr Event -> IO CLint
+clEnqueueReadImage :: Mem -> Bool -> (CLsizei, CLsizei, CLsizei) -> (CLsizei, CLsizei, CLsizei) -> CLsizei -> CLsizei -> Ptr () -> CommandQueue -> [Event] -> IO Event
clEnqueueReadImage image blocking_read (oa,ob,oc) (ra,rb,rc) row_pitch slice_pitch ptr =
enqueue (\command_queue num_events_in_wait_list event_wait_list event -> allocaArray 3 $ \origin -> allocaArray 3 $ \region -> do
pokeArray region [ra,rb,rc]
pokeArray origin [oa,ob,oc]
raw_clEnqueueReadImage command_queue image (if blocking_read then clTrue else clFalse) origin region row_pitch slice_pitch ptr num_events_in_wait_list event_wait_list event)
foreign import ccall "clEnqueueWriteImage" raw_clEnqueueWriteImage :: CommandQueue -> Mem -> CLbool -> Ptr CLsizei -> Ptr CLsizei -> CLsizei -> CLsizei -> Ptr () -> CLuint -> Ptr Event -> Ptr Event -> IO CLint
+clEnqueueWriteImage :: Mem -> Bool -> (CLsizei, CLsizei, CLsizei) -> (CLsizei, CLsizei, CLsizei) -> CLsizei -> CLsizei -> Ptr () -> CommandQueue -> [Event] -> IO Event
clEnqueueWriteImage image blocking_read (oa,ob,oc) (ra,rb,rc) row_pitch slice_pitch ptr =
enqueue (\command_queue num_events_in_wait_list event_wait_list event -> allocaArray 3 $ \origin -> allocaArray 3 $ \region -> do
pokeArray region [ra,rb,rc]
@@ -216,6 +217,7 @@ clEnqueueMapImage buffer blocking_map (MapFlags map_flags) (oa,ob,oc) (ra,rb,rc)
foreign import ccall "clEnqueueUnmapMemObject" raw_clEnqueueUnmapMemObject :: CommandQueue -> Mem -> Ptr () -> CLuint -> Ptr Event -> Ptr Event -> IO CLint
+clEnqueueUnmapMemObject :: Mem -> Ptr () -> CommandQueue -> [Event] -> IO Event
clEnqueueUnmapMemObject mem mapped_ptr = enqueue
(\command_queue num_events_in_wait_list event_wait_list event ->
raw_clEnqueueUnmapMemObject command_queue mem mapped_ptr num_events_in_wait_list event_wait_list event)
@@ -7,11 +7,8 @@ module System.OpenCL.Raw.V10.OutOfOrder
where
import System.OpenCL.Raw.V10.Types
-import System.OpenCL.Raw.V10.Errors
import System.OpenCL.Raw.V10.Utils
import Foreign
-import Control.Applicative
-import Data.Maybe
foreign import ccall "clEnqueueMarker" raw_clEnqueueMarker :: CommandQueue -> Ptr Event -> IO CLint
clEnqueueMarker :: CommandQueue -> IO Event
@@ -11,7 +11,6 @@ import System.OpenCL.Raw.V10.Utils
import Foreign
import Foreign.C
import Control.Applicative
-import Data.Maybe
import Control.Exception ( throw )
@@ -11,7 +11,6 @@ module System.OpenCL.Raw.V10.ProgramObject
,clGetProgramBuildInfo)
where
-import Control.Monad.Cont
import System.OpenCL.Raw.V10.Types
import System.OpenCL.Raw.V10.Errors
import System.OpenCL.Raw.V10.Utils
@@ -83,5 +82,5 @@ clGetProgramInfo program (ProgramInfo param_name) param_value_size = wrapGetInfo
foreign import ccall "clGetProgramBuildInfo" raw_clGetProgramBuildInfo :: Program -> CLuint -> CLsizei -> Ptr () -> Ptr CLsizei -> IO CLint
clGetProgramBuildInfo :: Program -> ProgramBuildInfo -> CLsizei -> IO (ForeignPtr (), CLsizei)
-clGetProgramBuildInfo program (ProgramBuildInfo param_name) param_value_size = wrapGetInfo (raw_clGetProgramInfo program param_name) param_value_size
+clGetProgramBuildInfo program (ProgramBuildInfo param_name) param_value_size = wrapGetInfo (raw_clGetProgramBuildInfo program param_name) param_value_size
@@ -8,12 +8,8 @@ module System.OpenCL.Raw.V10.Sampler
where
import System.OpenCL.Raw.V10.Types
-import System.OpenCL.Raw.V10.Errors
import System.OpenCL.Raw.V10.Utils
import Foreign
-import Foreign.C
-import Control.Applicative
-import Data.Maybe
@@ -281,9 +281,9 @@ clProfilingCommandStart = ProfilingInfo 0x1282
clProfilingCommandEnd :: ProfilingInfo
clProfilingCommandEnd = ProfilingInfo 0x1283
-
-clFalse = 0 :: CLbool
-clTrue = 1 :: CLbool
+clFalse, clTrue :: CLbool
+clFalse = 0
+clTrue = 1
clDeviceTypeDefault :: DeviceType
@@ -311,6 +311,7 @@ clContextDevices = ContextInfo 0x1081
clContextProperties :: ContextInfo
clContextProperties = ContextInfo 0x1082
+clContextPlatform :: Integer
clContextPlatform = 0x1084
@@ -573,6 +574,7 @@ clAddressClamp = AddressingMode 0x1132
clAddressRepeat :: AddressingMode
clAddressRepeat = AddressingMode 0x1133
+clFilterNearest, clFilterLinear :: FilterMode
clFilterNearest = FilterMode 0x1140
clFilterLinear = FilterMode 0x1141
@@ -6,7 +6,6 @@ import Foreign.C
import System.OpenCL.Raw.V10.Errors
import System.OpenCL.Raw.V10.Types
import Control.Applicative
-import Data.Maybe
import Control.Monad.Cont
import Control.Exception ( throw )

0 comments on commit 652524d

Please sign in to comment.