- newtype QueueT m a = QueueT {
- runQueueT :: CommandQueue -> m a
- type QueueIO = QueueT IO
- runQueueForType :: MonadIO m => DeviceType -> QueueT m a -> m a
- runQueueForDevice :: MonadIO m => DeviceID -> QueueT m a -> m a
- runQueueForContext :: MonadIO m => DeviceID -> Context -> QueueT m a -> m a
- class MonadIO m => MonadBracket m where
- liftIOBracket :: (forall b. (a -> IO b) -> IO b) -> (a -> m c) -> m c
- class MonadBracket m => MonadQueue m where
- getQueue :: m CommandQueue
- module Control.Monad.Trans
- getContext :: MonadQueue m => m Context
- getDevice :: MonadQueue m => m DeviceID
- data Command
- waitForCommand :: MonadQueue m => Command -> m Event
- waitForCommands :: MonadQueue m => [Command] -> m [Event]
- waitForCommands_ :: MonadQueue m => [Command] -> m ()
- data CommandQueue
- data CommandQueueProperty
- createCommandQueue :: Context -> DeviceID -> [CommandQueueProperty] -> IO CommandQueue
- queueDevice :: CommandQueue -> DeviceID
- queueContext :: CommandQueue -> Context
- getQueueProperties :: CommandQueue -> IO [CommandQueueProperty]
- data Event
- eventCommandQueue :: Event -> CommandQueue
- data CommandType
- = CommandNdrangeKernel
- | CommandTask
- | CommandNativeKernel
- | CommandReadBuffer
- | CommandWriteBuffer
- | CommandCopyBuffer
- | CommandReadImage
- | CommandWriteImage
- | CommandCopyImage
- | CommandCopyImageToBuffer
- | CommandCopyBufferToImage
- | CommandMapBuffer
- | CommandMapImage
- | CommandUnmapMemObject
- | CommandMarker
- | CommandAcquireGlObjects
- | CommandReleaseGlObjects
- eventCommandType :: Event -> CommandType
- getEventCommandExecutionStatus :: Event -> IO ExecutionStatus
- data ExecutionStatus
- getCommandQueued :: Event -> IO Word64
- getCommandSubmit :: Event -> IO Word64
- getCommandStart :: Event -> IO Word64
- getCommandEnd :: Event -> IO Word64
Mid-level monadic interface
newtype QueueT m a
QueueT | |
|
MonadTrans QueueT | |
MArray a e m => MArray a e (QueueT m) | |
Monad m => Monad (QueueT m) | |
Functor m => Functor (QueueT m) | |
MonadIO m => MonadIO (QueueT m) | |
MonadBracket m => MonadQueue (QueueT m) | |
MonadBracket m => MonadBracket (QueueT m) |
Running QueueT actions
runQueueForType :: MonadIO m => DeviceType -> QueueT m a -> m a
runQueueForDevice :: MonadIO m => DeviceID -> QueueT m a -> m a
runQueueForContext :: MonadIO m => DeviceID -> Context -> QueueT m a -> m a
Monadic convenience classes
class MonadIO m => MonadBracket m where
liftIOBracket :: (forall b. (a -> IO b) -> IO b) -> (a -> m c) -> m c
MonadBracket IO | |
MonadBracket m => MonadBracket (QueueT m) |
class MonadBracket m => MonadQueue m where
getQueue :: m CommandQueue
MonadBracket m => MonadQueue (QueueT m) |
module Control.Monad.Trans
Basic queue operations
getContext :: MonadQueue m => m Context
getDevice :: MonadQueue m => m DeviceID
Commands
data Command
An action which can be enqueued and run on an OpenCL device; for example, reading/writing host memory or running a program kernel.
waitForCommand :: MonadQueue m => Command -> m Event
waitForCommands :: MonadQueue m => [Command] -> m [Event]
Enqueue and run the given Command
s. Blocks until all of the given
Command
s have completed.
Returns a list of Event
s describing the input Command
s.
If QueueOutOfOrderExecModeEnable
has been
set, then the Command
s are not guaranteed to run in the order of the list,
and a Command
may start before the previous one has finished.
waitForCommands_ :: MonadQueue m => [Command] -> m ()
Behaves the same as waitForCommands
, but does not create or return Event
s
for the given Command
s.
Command queues
data CommandQueue
data CommandQueueProperty
createCommandQueue :: Context -> DeviceID -> [CommandQueueProperty] -> IO CommandQueue
Querying properties
queueDevice :: CommandQueue -> DeviceID
queueContext :: CommandQueue -> Context
Events
data Event
data CommandType
eventCommandType :: Event -> CommandType
data ExecutionStatus
Profiling
When QueueProfilingEnable
has been set for a queue,
it is possible to get timing information from an Event
using
the following functions.
getCommandQueued :: Event -> IO Word64
getCommandSubmit :: Event -> IO Word64
getCommandStart :: Event -> IO Word64
getCommandEnd :: Event -> IO Word64