Cpp-Taskflow  2.3.1
tf::cudaFlow Class Reference

Building methods of a cuda task dependency graph. More...

#include <cuda_flow_builder.hpp>

Public Member Functions

 cudaFlow (cudaGraph &graph)
 constructs a cudaFlow builder object More...
 
bool empty () const
 queries the emptiness of the graph
 
cudaTask placeholder ()
 creates a placeholder task
 
cudaTask noop ()
 creates a no-operation task More...
 
template<typename F , typename... ArgsT>
cudaTask kernel (dim3 g, dim3 b, size_t s, F &&f, ArgsT &&... args)
 creates a kernel task More...
 
template<typename T , std::enable_if_t<!std::is_same< T, void >::value, void > * = nullptr>
cudaTask copy (T *tgt, T *src, size_t num)
 creates an 1D copy task More...
 

Detailed Description

Building methods of a cuda task dependency graph.

Constructor & Destructor Documentation

◆ cudaFlow()

tf::cudaFlow::cudaFlow ( cudaGraph &  graph)
inline

constructs a cudaFlow builder object

Parameters
grapha cudaGraph to manipulate

Member Function Documentation

◆ copy()

template<typename T , std::enable_if_t<!std::is_same< T, void >::value, void > * >
cudaTask tf::cudaFlow::copy ( T *  tgt,
T *  src,
size_t  num 
)

creates an 1D copy task

Template Parameters
Telement type (non-void)
Parameters
tgtpointer to the target memory block
srcpointer to the source memory block
numnumber of elements to copy
Returns
cudaTask handle

A copy task transfers num*sizeof(T) bytes of data from a source location to a target location. Direction can be either cpu-to-gpu, gpu-to-cpu, gpu-to-gpu, or gpu-to-cpu.

◆ kernel()

template<typename F , typename... ArgsT>
cudaTask tf::cudaFlow::kernel ( dim3  g,
dim3  b,
size_t  s,
F &&  f,
ArgsT &&...  args 
)

creates a kernel task

Template Parameters
Fkernel function type
ArgsTkernel function parameters type
Parameters
gconfigured grid
bconfigured block
sconfigured shared memory
fkernel function
argsarguments to forward to the kernel function by copy
Returns
cudaTask handle

◆ noop()

cudaTask tf::cudaFlow::noop ( )
inline

creates a no-operation task

An empty node performs no operation during execution, but can be used for transitive ordering. For example, a phased execution graph with 2 groups of n nodes with a barrier between them can be represented using an empty node and 2*n dependency edges, rather than no empty node and n^2 dependency edges.


The documentation for this class was generated from the following file: