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 :: Storable a => DevicePtr a -> a -> Stream -> [StreamWriteFlag] -> IO ()
- wait :: Storable a => DevicePtr a -> a -> 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 #
Execution stream creation flags
data StreamWriteFlag Source #
data StreamWaitFlag Source #
Bounded StreamWaitFlag Source # | |
Enum StreamWaitFlag Source # | Write a value to memory, (presumably) after all preceding work in the
stream has completed. Unless the option Requires CUDA-8.0 for 32-bit values. Requires CUDA-9.0 for 64-bit values. |
Eq StreamWaitFlag Source # | |
Show 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.
wait :: Storable a => DevicePtr a -> a -> 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 for 32-bit values.
Requires CUDA-9.0 for 64-bit values.
defaultStream :: Stream Source #
The main execution stream. No operations overlap with operations in the default stream.