3#include "cuda_graph.hpp"
52 default:
return "undefined";
69 friend class cudaFlowCapturerBase;
99 template <
typename... Ts>
111 template <
typename... Ts>
154 template <
typename T>
155 void dump(T& ostream)
const;
160 template <
typename V>
166 template <
typename V>
173 cudaNode* _node {
nullptr};
181template <
typename... Ts>
183 (_node->_precede(tasks._node), ...);
188template <
typename... Ts>
190 (tasks._node->_precede(_node), ...);
196 return _node ==
nullptr;
212 return _node->_successors.size();
217 return _node->_dependents.size();
222 switch(_node->_handle.index()) {
238 if(_node->_name.empty()) os << _node;
239 else os << _node->_name;
246 for(
size_t i=0; i<_node->_successors.size(); ++i) {
247 visitor(
cudaTask(_node->_successors[i]));
254 for(
size_t i=0; i<_node->_dependents.size(); ++i) {
255 visitor(
cudaTask(_node->_dependents[i]));
class to create a cudaFlow graph using stream capture
Definition cuda_capturer.hpp:57
class to create a cudaFlow task dependency graph
Definition cudaflow.hpp:56
class to create a task handle over an internal node of a cudaFlow graph
Definition cuda_task.hpp:65
bool empty() const
queries if the task is associated with a cudaNode
Definition cuda_task.hpp:195
cudaTask(const cudaTask &)=default
copy-constructs a cudaTask
cudaTask & succeed(Ts &&... tasks)
adds precedence links from other tasks to this
Definition cuda_task.hpp:189
size_t num_successors() const
queries the number of successors
Definition cuda_task.hpp:211
cudaTask()=default
constructs an empty cudaTask
cudaTaskType type() const
queries the task type
Definition cuda_task.hpp:221
const std::string & name() const
queries the name of the task
Definition cuda_task.hpp:206
cudaTask & operator=(const cudaTask &)=default
copy-assigns a cudaTask
cudaTask & precede(Ts &&... tasks)
adds precedence links from this to other tasks
Definition cuda_task.hpp:182
void for_each_successor(V &&visitor) const
applies an visitor callable to each successor of the task
Definition cuda_task.hpp:245
void dump(T &ostream) const
dumps the task through an output stream
Definition cuda_task.hpp:236
friend std::ostream & operator<<(std::ostream &, const cudaTask &)
overload of ostream inserter operator for cudaTask
Definition cuda_task.hpp:266
void for_each_dependent(V &&visitor) const
applies an visitor callable to each dependents of the task
Definition cuda_task.hpp:253
size_t num_dependents() const
queries the number of dependents
Definition cuda_task.hpp:216
taskflow namespace
Definition small_vector.hpp:27
@ UNDEFINED
undefined task type (for internal use only)
const char * to_string(TaskType type)
convert a task type to a human-readable string
Definition task.hpp:81
std::ostream & operator<<(std::ostream &os, const Task &task)
overload of ostream inserter operator for cudaTask
Definition task.hpp:626
cudaTaskType
enumeration of all cudaTask types
Definition cuda_task.hpp:21
@ UNDEFINED
undefined task type
@ KERNEL
memory copy task type
@ MEMSET
memory set task type
@ SUBFLOW
subflow (child graph) task type
@ CAPTURE
capture task type
@ MEMCPY
memory copy task type