Copyright | [2009..2023] Trevor L. McDonell |
---|---|
License | BSD |
Safe Haskell | Safe-Inferred |
Language | Haskell98 |
Device management routines
Synopsis
- 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
- pciInfo :: !PCI
- tccDriverEnabled :: !Bool
- kernelExecTimeoutEnabled :: !Bool
- integrated :: !Bool
- canMapHostMemory :: !Bool
- unifiedAddressing :: !Bool
- streamPriorities :: !Bool
- globalL1Cache :: !Bool
- localL1Cache :: !Bool
- managedMemory :: !Bool
- multiGPUBoard :: !Bool
- multiGPUBoardGroupID :: !Int
- preemption :: !Bool
- singleToDoublePerfRatio :: !Int
- cooperativeLaunch :: !Bool
- cooperativeLaunchMultiDevice :: !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
Instances
Bounded DeviceFlag Source # | |
Defined in Foreign.CUDA.Runtime.Device minBound :: DeviceFlag # maxBound :: DeviceFlag # | |
Enum DeviceFlag Source # | |
Defined in Foreign.CUDA.Runtime.Device succ :: DeviceFlag -> DeviceFlag # pred :: DeviceFlag -> DeviceFlag # toEnum :: Int -> DeviceFlag # fromEnum :: DeviceFlag -> Int # enumFrom :: DeviceFlag -> [DeviceFlag] # enumFromThen :: DeviceFlag -> DeviceFlag -> [DeviceFlag] # enumFromTo :: DeviceFlag -> DeviceFlag -> [DeviceFlag] # enumFromThenTo :: DeviceFlag -> DeviceFlag -> DeviceFlag -> [DeviceFlag] # | |
Show DeviceFlag Source # | |
Defined in Foreign.CUDA.Runtime.Device showsPrec :: Int -> DeviceFlag -> ShowS # show :: DeviceFlag -> String # showList :: [DeviceFlag] -> ShowS # | |
Eq DeviceFlag Source # | |
Defined in Foreign.CUDA.Runtime.Device (==) :: DeviceFlag -> DeviceFlag -> Bool # (/=) :: DeviceFlag -> DeviceFlag -> Bool # |
data DeviceProperties Source #
The properties of a compute device
DeviceProperties | |
|
Instances
Storable DeviceProperties Source # | |
Defined in Foreign.CUDA.Runtime.Device sizeOf :: DeviceProperties -> Int # alignment :: DeviceProperties -> Int # peekElemOff :: Ptr DeviceProperties -> Int -> IO DeviceProperties # pokeElemOff :: Ptr DeviceProperties -> Int -> DeviceProperties -> IO () # peekByteOff :: Ptr b -> Int -> IO DeviceProperties # pokeByteOff :: Ptr b -> Int -> DeviceProperties -> IO () # peek :: Ptr DeviceProperties -> IO DeviceProperties # poke :: Ptr DeviceProperties -> DeviceProperties -> IO () # | |
Show DeviceProperties Source # | |
Defined in Foreign.CUDA.Analysis.Device showsPrec :: Int -> DeviceProperties -> ShowS # show :: DeviceProperties -> String # showList :: [DeviceProperties] -> ShowS # |
GPU compute capability, major and minor revision number respectively.
data ComputeMode Source #
The compute mode the device is currently in
Instances
Enum ComputeMode Source # | |
Defined in Foreign.CUDA.Analysis.Device succ :: ComputeMode -> ComputeMode # pred :: ComputeMode -> ComputeMode # toEnum :: Int -> ComputeMode # fromEnum :: ComputeMode -> Int # enumFrom :: ComputeMode -> [ComputeMode] # enumFromThen :: ComputeMode -> ComputeMode -> [ComputeMode] # enumFromTo :: ComputeMode -> ComputeMode -> [ComputeMode] # enumFromThenTo :: ComputeMode -> ComputeMode -> ComputeMode -> [ComputeMode] # | |
Show ComputeMode Source # | |
Defined in Foreign.CUDA.Analysis.Device showsPrec :: Int -> ComputeMode -> ShowS # show :: ComputeMode -> String # showList :: [ComputeMode] -> ShowS # | |
Eq ComputeMode Source # | |
Defined in Foreign.CUDA.Analysis.Device (==) :: ComputeMode -> ComputeMode -> Bool # (/=) :: ComputeMode -> ComputeMode -> Bool # |
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
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
Possible option values for direct peer memory access
Instances
Enum PeerFlag Source # | |
Defined in Foreign.CUDA.Runtime.Device |
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
Stacksize | |
Printffifosize | |
Mallocheapsize | |
Devruntimesyncdepth | |
Devruntimependinglaunchcount | |
Maxl2fetchgranularity | |
Persistingl2cachesize |
Orphan instances
Storable DeviceProperties Source # | |
sizeOf :: DeviceProperties -> Int # alignment :: DeviceProperties -> Int # peekElemOff :: Ptr DeviceProperties -> Int -> IO DeviceProperties # pokeElemOff :: Ptr DeviceProperties -> Int -> DeviceProperties -> IO () # peekByteOff :: Ptr b -> Int -> IO DeviceProperties # pokeByteOff :: Ptr b -> Int -> DeviceProperties -> IO () # peek :: Ptr DeviceProperties -> IO DeviceProperties # poke :: Ptr DeviceProperties -> DeviceProperties -> IO () # |