HsOpenCL-0.0.1: A binding to the OpenCL parallel computing framework.

System.HsOpenCL.CommandQueue

Contents

Synopsis

Mid-level monadic interface

newtype QueueT m a

Constructors

QueueT 

Fields

runQueueT :: CommandQueue -> m a
 

Running QueueT actions

Monadic convenience classes

class MonadIO m => MonadBracket m where

Methods

liftIOBracket :: (forall b. (a -> IO b) -> IO b) -> (a -> m c) -> m c

class MonadBracket m => MonadQueue m where

Instances

Basic queue operations

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.

Instances

waitForCommand :: MonadQueue m => Command -> m Event

Enqueue and run one Command. Once that Command has completed, returns an Event describing the input Command.

waitForCommands :: MonadQueue m => [Command] -> m [Event]

Enqueue and run the given Commands. Blocks until all of the given Commands have completed. Returns a list of Events describing the input Commands.

If QueueOutOfOrderExecModeEnable has been set, then the Commands 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 Events for the given Commands.

Command queues

Querying properties

Events

data Event

Profiling

When QueueProfilingEnable has been set for a queue, it is possible to get timing information from an Event using the following functions.