| Copyright | [2018..2023] Trevor L. McDonell |
|---|---|
| License | BSD |
| Safe Haskell | Safe-Inferred |
| Language | Haskell98 |
Foreign.CUDA.Driver.Graph.Build
Contents
Description
Graph construction functions for the low-level driver interface
Requires CUDA-10
Synopsis
- newtype Graph = Graph {}
- newtype Node = Node {}
- data NodeType
- type HostCallback = FunPtr (Ptr () -> IO ())
- create :: [GraphFlag] -> IO Graph
- destroy :: Graph -> IO ()
- clone :: Graph -> IO Graph
- remove :: Node -> IO ()
- addChild :: Graph -> Graph -> [Node] -> IO Node
- addEmpty :: Graph -> [Node] -> IO Node
- addHost :: Graph -> [Node] -> HostCallback -> Ptr () -> IO Node
- addKernel :: Graph -> [Node] -> Fun -> (Int, Int, Int) -> (Int, Int, Int) -> Int -> [FunParam] -> IO Node
- addMemcpy :: Graph -> [Node] -> Context -> Int -> Int -> Int -> Int -> MemoryType -> Ptr a -> Int -> Int -> Int -> Int -> Int -> Int -> MemoryType -> Ptr a -> Int -> Int -> Int -> Int -> Int -> IO Node
- addMemset :: Storable a => Graph -> [Node] -> Context -> DevicePtr a -> a -> Int -> Int -> Int -> IO Node
- addDependencies :: Graph -> [(Node, Node)] -> IO ()
- removeDependencies :: Graph -> [(Node, Node)] -> IO ()
- getType :: Node -> IO NodeType
- getChildGraph :: Node -> IO Graph
- getEdges :: Graph -> IO [(Node, Node)]
- getNodes :: Graph -> IO [Node]
- getRootNodes :: Graph -> IO [Node]
- getDependencies :: Node -> IO [Node]
- getDependents :: Node -> IO [Node]
- findInClone :: Node -> Graph -> IO Node
Documentation
Instances
Constructors
| Kernel | |
| Memcpy | |
| Memset | |
| Host | |
| Subgraph | |
| Empty | |
| WaitEvent | |
| EventRecord | |
| ExtSemasSignal | |
| ExtSemasWait | |
| MemAlloc | |
| MemFree | |
| BatchMemOp |
Instances
| Bounded NodeType Source # | |
| Enum NodeType Source # | |
Defined in Foreign.CUDA.Driver.Graph.Base | |
| Show NodeType Source # | |
| Eq NodeType Source # | |
type HostCallback = FunPtr (Ptr () -> IO ()) Source #
Callback function executed on the host
Since: 0.10.0.0
create :: [GraphFlag] -> IO Graph Source #
Create an empty task graph
Requires CUDA-10.0
Since: 0.10.0.0
destroy :: Graph -> IO () Source #
Destroy a graph, as well as all of its nodes
Requires CUDA-10.0
Since: 0.10.0.0
Construction
addChild :: Graph -> Graph -> [Node] -> IO Node Source #
Create a child graph node and add it to the graph
Requires CUDA-10.0
Since: 0.10.0.0
addEmpty :: Graph -> [Node] -> IO Node Source #
Create an empty node and add it to the graph.
Requires CUDA-10.0
Since: 0.10.0.0
addHost :: Graph -> [Node] -> HostCallback -> Ptr () -> IO Node Source #
Creates a host execution node and adds it to the graph
Requires CUDA-10.0
Since: 0.10.0.0
Arguments
| :: Graph | |
| -> [Node] | |
| -> Fun | |
| -> (Int, Int, Int) | grid dimension |
| -> (Int, Int, Int) | thread block dimensions |
| -> Int | shared memory (bytes) |
| -> [FunParam] | |
| -> IO Node |
Create a kernel execution node and adds it to the graph
Requires CUDA-10.0
Since: 0.10.0.0
Arguments
| :: Graph | |
| -> [Node] | |
| -> Context | |
| -> Int | srcXInBytes |
| -> Int | srcY |
| -> Int | srcZ |
| -> Int | srcLOD |
| -> MemoryType | source memory type |
| -> Ptr a | source ptr |
| -> Int | srcPitch |
| -> Int | srcHeight |
| -> Int | dstXInBytes |
| -> Int | dstY |
| -> Int | dstZ |
| -> Int | dstLOD |
| -> MemoryType | destination memory type |
| -> Ptr a | destination ptr |
| -> Int | dstPitch |
| -> Int | dstHeight |
| -> Int | widthInBytes |
| -> Int | height |
| -> Int | depth |
| -> IO Node |
Create a memcpy node and add it to the graph
Requires CUDA-10.0
Since: 0.10.0.0
Arguments
| :: Storable a | |
| => Graph | |
| -> [Node] | |
| -> Context | |
| -> DevicePtr a | |
| -> a | |
| -> Int | height |
| -> Int | pitch |
| -> Int | width |
| -> IO Node |
Create a memset node and add it to the graph
Requires CUDA-10.0
Since: 0.10.0.0
addDependencies :: Graph -> [(Node, Node)] -> IO () Source #
Add dependency edges to the graph
Requires CUDA-10.0
Since: 0.10.0.0
removeDependencies :: Graph -> [(Node, Node)] -> IO () Source #
Remove dependency edges from the graph
Requires CUDA-10.0
Since: 0.10.0.0
Querying
getChildGraph :: Node -> IO Graph Source #
Retrieve the embedded graph of a child sub-graph node
Requires CUDA-10.0
Since: 0.10.0.0
getEdges :: Graph -> IO [(Node, Node)] Source #
Return a graph's dependency edges
Requires CUDA-10.0
Since: 0.10.0.0
getRootNodes :: Graph -> IO [Node] Source #
Returns the root nodes of a graph
Requires CUDA-10.0
Since: 0.10.0.0
getDependencies :: Node -> IO [Node] Source #
Return the dependencies of a node
Requires CUDA-10.0
Since: 0.10.0.0
getDependents :: Node -> IO [Node] Source #
Return a node's dependent nodes
Requires CUDA-10.0
Since: 0.10.0.0