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

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

Foreign.CUDA.Driver.Context.Primary

Description

Primary context management for low-level driver interface. The primary context is unique per device and shared with the Runtime API. This allows integration with other libraries using CUDA.

Since: CUDA-7.0

Synopsis

Documentation

status :: Device -> IO (Bool, [ContextFlag]) Source #

Get the status of the primary context. Returns whether the current context is active, and the flags it was (or will be) created with.

Requires CUDA-7.0.

http://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__PRIMARY__CTX.html#group__CUDA__PRIMARY__CTX_1g65f3e018721b6d90aa05cfb56250f469

setup :: Device -> [ContextFlag] -> IO () Source #

Specify the flags that the primary context should be created with. Note that this is an error if the primary context is already active.

Requires CUDA-7.0.

http://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__PRIMARY__CTX.html#group__CUDA__PRIMARY__CTX_1gd779a84f17acdad0d9143d9fe719cfdf

reset :: Device -> IO () Source #

Destroy all allocations and reset all state on the primary context of the given device in the current process. Requires cuda-7.0

Requires CUDA-7.0.

http://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__PRIMARY__CTX.html#group__CUDA__PRIMARY__CTX_1g5d38802e8600340283958a117466ce12

retain :: Device -> IO Context Source #

Retain the primary context for the given device, creating it if necessary, and increasing its usage count. The caller must call release when done using the context. Unlike create the newly retained context is not pushed onto the stack.

Requires CUDA-7.0.

http://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__PRIMARY__CTX.html#group__CUDA__PRIMARY__CTX_1g9051f2d5c31501997a6cb0530290a300

release :: Device -> IO () Source #

Release the primary context on the given device. If there are no more references to the primary context it will be destroyed, regardless of how many threads it is current to.

Unlike pop this does not pop the context from the stack in any circumstances.

Requires CUDA-7.0.

http://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__PRIMARY__CTX.html#group__CUDA__PRIMARY__CTX_1gf2a8bc16f8df0c88031f6a1ba3d6e8ad