DPC++ Runtime
Runtime libraries for oneAPI DPC++
sycl::_V1::ext::oneapi::experimental::detail::exec_graph_impl Class Reference

Class representing the implementation of command_graph<executable>. More...

#include <detail/graph_impl.hpp>

Collaboration diagram for sycl::_V1::ext::oneapi::experimental::detail::exec_graph_impl:

Public Types

using ReadLock = std::shared_lock< std::shared_mutex >
 
using WriteLock = std::unique_lock< std::shared_mutex >
 

Public Member Functions

 exec_graph_impl (sycl::context Context, const std::shared_ptr< graph_impl > &GraphImpl)
 Constructor. More...
 
 ~exec_graph_impl ()
 Destructor. More...
 
void makePartitions ()
 Partition the graph nodes and put the partition in MPartitions. More...
 
sycl::event enqueue (const std::shared_ptr< sycl::detail::queue_impl > &Queue, sycl::detail::CG::StorageInitHelper CGData)
 Called by handler::ext_oneapi_command_graph() to schedule graph for execution. More...
 
void createCommandBuffers (sycl::device Device, std::shared_ptr< partition > &Partition)
 Turns the internal graph representation into UR command-buffers for a device. More...
 
sycl::context getContext () const
 Query for the context tied to this graph. More...
 
const std::list< std::shared_ptr< node_impl > > & getSchedule () const
 Query the scheduling of node execution. More...
 
const std::shared_ptr< graph_impl > & getGraphImpl () const
 Query the graph_impl. More...
 
const std::vector< std::shared_ptr< partition > > & getPartitions () const
 Query the vector of the partitions composing the exec_graph. More...
 
bool previousSubmissionCompleted () const
 Checks if the previous submissions of this graph have been completed This function checks the status of events associated to the previous graph submissions. More...
 
std::vector< sycl::detail::AccessorImplHost * > getRequirements () const
 Returns a list of all the accessor requirements for this graph. More...
 

Public Attributes

std::shared_mutex MMutex
 Protects all the fields that can be changed by class' methods. More...
 

Detailed Description

Class representing the implementation of command_graph<executable>.

Definition at line 1009 of file graph_impl.hpp.

Member Typedef Documentation

◆ ReadLock

Definition at line 1011 of file graph_impl.hpp.

◆ WriteLock

Definition at line 1012 of file graph_impl.hpp.

Constructor & Destructor Documentation

◆ exec_graph_impl()

sycl::_V1::ext::oneapi::experimental::detail::exec_graph_impl::exec_graph_impl ( sycl::context  Context,
const std::shared_ptr< graph_impl > &  GraphImpl 
)
inline

Constructor.

Nodes from GraphImpl will be copied when constructing this exec_graph_impl so that nodes may be modified (e.g. when merging subgraph nodes).

Parameters
ContextContext to create graph with.
GraphImplModifiable graph implementation to create with.

Definition at line 1024 of file graph_impl.hpp.

◆ ~exec_graph_impl()

sycl::_V1::ext::oneapi::experimental::detail::exec_graph_impl::~exec_graph_impl ( )

Destructor.

Releases any PI command-buffers the object has created.

Definition at line 739 of file graph_impl.cpp.

References sycl::_V1::detail::getSyclObjImpl(), and piextCommandBufferRelease().

Member Function Documentation

◆ createCommandBuffers()

void sycl::_V1::ext::oneapi::experimental::detail::exec_graph_impl::createCommandBuffers ( sycl::device  Device,
std::shared_ptr< partition > &  Partition 
)

Turns the internal graph representation into UR command-buffers for a device.

Parameters
DeviceDevice to create backend command-buffers for.
PartionPartition to which the created command-buffer should be attached.

Definition at line 680 of file graph_impl.cpp.

References sycl::_V1::detail::getSyclObjImpl(), sycl::_V1::invalid, piextCommandBufferCreate(), and piextCommandBufferFinalize().

◆ enqueue()

sycl::event sycl::_V1::ext::oneapi::experimental::detail::exec_graph_impl::enqueue ( const std::shared_ptr< sycl::detail::queue_impl > &  Queue,
sycl::detail::CG::StorageInitHelper  CGData 
)

Called by handler::ext_oneapi_command_graph() to schedule graph for execution.

Parameters
QueueCommand-queue to schedule execution on.
CGDataCommand-group data provided by the sycl::handler
Returns
Event associated with the execution of the graph.

Definition at line 763 of file graph_impl.cpp.

References sycl::_V1::detail::enqueueImpKernel(), sycl::_V1::event, sycl::_V1::invalid, sycl::_V1::kernel, sycl::_V1::detail::CG::StorageInitHelper::MAccStorage, sycl::_V1::make_error_code(), sycl::_V1::detail::CG::StorageInitHelper::MEvents, MMutex, sycl::_V1::detail::CG::StorageInitHelper::MRequirements, PI_EXT_KERNEL_EXEC_INFO_CACHE_DEFAULT, and piextEnqueueCommandBuffer().

◆ getContext()

sycl::context sycl::_V1::ext::oneapi::experimental::detail::exec_graph_impl::getContext ( ) const
inline

Query for the context tied to this graph.

Returns
Context associated with graph.

Definition at line 1061 of file graph_impl.hpp.

◆ getGraphImpl()

const std::shared_ptr<graph_impl>& sycl::_V1::ext::oneapi::experimental::detail::exec_graph_impl::getGraphImpl ( ) const
inline

Query the graph_impl.

Returns
pointer to the graph_impl MGraphImpl

Definition at line 1071 of file graph_impl.hpp.

◆ getPartitions()

const std::vector<std::shared_ptr<partition> >& sycl::_V1::ext::oneapi::experimental::detail::exec_graph_impl::getPartitions ( ) const
inline

Query the vector of the partitions composing the exec_graph.

Returns
Vector of partitions in execution order.

Definition at line 1075 of file graph_impl.hpp.

◆ getRequirements()

std::vector<sycl::detail::AccessorImplHost *> sycl::_V1::ext::oneapi::experimental::detail::exec_graph_impl::getRequirements ( ) const
inline

Returns a list of all the accessor requirements for this graph.

Definition at line 1094 of file graph_impl.hpp.

◆ getSchedule()

const std::list<std::shared_ptr<node_impl> >& sycl::_V1::ext::oneapi::experimental::detail::exec_graph_impl::getSchedule ( ) const
inline

Query the scheduling of node execution.

Returns
List of nodes in execution order.

Definition at line 1065 of file graph_impl.hpp.

◆ makePartitions()

void sycl::_V1::ext::oneapi::experimental::detail::exec_graph_impl::makePartitions ( )

Partition the graph nodes and put the partition in MPartitions.

The partitioning splits the graph to allow synchronization between device events and events that do not run on the same device such as host_task.

Definition at line 187 of file graph_impl.cpp.

◆ previousSubmissionCompleted()

bool sycl::_V1::ext::oneapi::experimental::detail::exec_graph_impl::previousSubmissionCompleted ( ) const
inline

Checks if the previous submissions of this graph have been completed This function checks the status of events associated to the previous graph submissions.

Returns
true if all previous submissions have been completed, false otherwise.

Definition at line 1084 of file graph_impl.hpp.

Member Data Documentation

◆ MMutex

std::shared_mutex sycl::_V1::ext::oneapi::experimental::detail::exec_graph_impl::MMutex
mutable

Protects all the fields that can be changed by class' methods.

Definition at line 1015 of file graph_impl.hpp.

Referenced by enqueue().


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