cuda- FFI binding to the CUDA interface for programming NVIDIA GPUs

Copyright[2009..2017] Trevor L. McDonell
Safe HaskellNone




Stream management for low-level driver interface


Stream Management

newtype Stream Source #

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 Events to synchronise operations between streams.





data StreamFlag Source #

Possible option flags for stream initialisation. Dummy instance until the API exports actual option values.

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.

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.