Copyright | (c) [2009..2012] Trevor L. McDonell |
---|---|
License | BSD |
Safe Haskell | None |
Language | Haskell98 |
Device management routines
- type Device = Int
- data DeviceFlag
- data DeviceProperties = DeviceProperties {
- deviceName :: !String
- computeCapability :: !Compute
- totalGlobalMem :: !Int64
- totalConstMem :: !Int64
- sharedMemPerBlock :: !Int64
- regsPerBlock :: !Int
- warpSize :: !Int
- maxThreadsPerBlock :: !Int
- maxThreadsPerMultiProcessor :: !Int
- maxBlockSize :: !(Int, Int, Int)
- maxGridSize :: !(Int, Int, Int)
- maxTextureDim1D :: !Int
- maxTextureDim2D :: !(Int, Int)
- maxTextureDim3D :: !(Int, Int, Int)
- clockRate :: !Int
- multiProcessorCount :: !Int
- memPitch :: !Int64
- memBusWidth :: !Int
- memClockRate :: !Int
- textureAlignment :: !Int64
- computeMode :: !ComputeMode
- deviceOverlap :: !Bool
- concurrentKernels :: !Bool
- eccEnabled :: !Bool
- asyncEngineCount :: !Int
- cacheMemL2 :: !Int
- tccDriverEnabled :: !Bool
- pciInfo :: !PCI
- kernelExecTimeoutEnabled :: !Bool
- integrated :: !Bool
- canMapHostMemory :: !Bool
- unifiedAddressing :: !Bool
- data Compute = Compute !Int !Int
- data ComputeMode
- choose :: DeviceProperties -> IO Device
- get :: IO Device
- count :: IO Int
- props :: Device -> IO DeviceProperties
- set :: Device -> IO ()
- setFlags :: [DeviceFlag] -> IO ()
- setOrder :: [Device] -> IO ()
- reset :: IO ()
- sync :: IO ()
- data PeerFlag
- accessible :: Device -> Device -> IO Bool
- add :: Device -> [PeerFlag] -> IO ()
- remove :: Device -> IO ()
- data Limit
- getLimit :: Limit -> IO Int
- setLimit :: Limit -> Int -> IO ()
Device Management
data DeviceFlag Source
Device execution flags
data DeviceProperties Source
The properties of a compute device
DeviceProperties | |
|
data ComputeMode Source
The compute mode the device is currently in
Enum ComputeMode | GPU compute capability, major and minor revision number respectively. |
Eq ComputeMode | |
Show ComputeMode |
choose :: DeviceProperties -> IO Device Source
Select the compute device which best matches the given criteria
Returns the number of devices available for execution, with compute capability >= 1.0
props :: Device -> IO DeviceProperties Source
Return information about the selected compute device
setFlags :: [DeviceFlag] -> IO () Source
Set flags to be used for device executions
Explicitly destroys and cleans up all runtime resources associated with the current device in the current process. Any subsequent API call will reinitialise the device.
Note that this function will reset the device immediately. It is the caller’s responsibility to ensure that the device is not being accessed by any other host threads from the process when this function is called.
Block until the device has completed all preceding requested tasks. Returns an error if one of the tasks fails.
Peer Access
accessible :: Device -> Device -> IO Bool Source
Queries if the first device can directly access the memory of the second. If
direct access is possible, it can then be enabled with add
. Requires
cuda-4.0.
add :: Device -> [PeerFlag] -> IO () Source
If the devices of both the current and supplied contexts support unified addressing, then enable allocations in the supplied context to be accessible by the current context. Requires cuda-4.0.
remove :: Device -> IO () Source
Disable direct memory access from the current context to the supplied context. Requires cuda-4.0.
Cache Configuration
Device limit flags