Copyright | [2009..2017] Trevor L. McDonell |
---|---|
License | BSD |
Safe Haskell | None |
Language | Haskell98 |
Stream management for low-level driver interface
- newtype Stream = Stream {}
- data StreamFlag
- data StreamWriteFlag
- data StreamWaitFlag
- create :: [StreamFlag] -> IO Stream
- createWithPriority :: StreamPriority -> [StreamFlag] -> IO Stream
- destroy :: Stream -> IO ()
- finished :: Stream -> IO Bool
- block :: Stream -> IO ()
- getPriority :: Stream -> IO StreamPriority
- write :: DevicePtr Int32 -> Int32 -> Stream -> [StreamWriteFlag] -> IO ()
- wait :: DevicePtr Int32 -> Int32 -> Stream -> [StreamWaitFlag] -> IO ()
- defaultStream :: Stream
Stream Management
A processing stream. All operations in a stream are synchronous and executed in sequence, but operations in different non-default streams may happen out-of-order or concurrently with one another.
Use Event
s to synchronise operations between streams.
data StreamFlag Source #
Possible option flags for stream initialisation. Dummy instance until the API exports actual option values.
data StreamWriteFlag Source #
data StreamWaitFlag Source #
createWithPriority :: StreamPriority -> [StreamFlag] -> IO Stream Source #
Create a stream with the given priority. Work submitted to a higher-priority stream may preempt work already executing in a lower priority stream.
The convention is that lower numbers represent higher priorities. The
default priority is zero. The range of meaningful numeric priorities can
be queried using getStreamPriorityRange
.
If the specified priority is outside the supported numerical range, it
will automatically be clamped to the highest or lowest number in the
range
Requires CUDA-5.5.
destroy :: Stream -> IO () Source #
Destroy a stream. If the device is still doing work in the stream when
destroy
is called, the function returns immediately and the resources
associated with the stream will be released automatically once the
device has completed all work.
getPriority :: Stream -> IO StreamPriority Source #
Query the priority of a stream.
Requires CUDA-5.5.
write :: DevicePtr Int32 -> Int32 -> Stream -> [StreamWriteFlag] -> IO () Source #
Write a value to memory, (presumably) after all preceding work in the
stream has completed. Unless the option WriteValueNoMemoryBarrier
is
supplied, the write is preceded by a system-wide memory fence.
Requires CUDA-8.0.
wait :: DevicePtr Int32 -> Int32 -> Stream -> [StreamWaitFlag] -> IO () Source #
Wait on a memory location. Work ordered after the operation will block until the given condition on the memory is satisfied.
Requires CUDA-8.0.
defaultStream :: Stream Source #
The main execution stream. No operations overlap with operations in the default stream.