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, const property_list &PropList)
 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::device getDevice () const
 Query for the device tied to this graph. 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...
 
void update (std::shared_ptr< graph_impl > GraphImpl)
 
void update (std::shared_ptr< node_impl > Node)
 
void update (const std::vector< std::shared_ptr< node_impl >> Nodes)
 
void updateImpl (std::shared_ptr< node_impl > NodeImpl)
 

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 1296 of file graph_impl.hpp.

Member Typedef Documentation

◆ ReadLock

Definition at line 1298 of file graph_impl.hpp.

◆ WriteLock

Definition at line 1299 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,
const property_list PropList 
)

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.
PropListList of properties for constructing this object

Definition at line 761 of file graph_impl.cpp.

References sycl::_V1::feature_not_supported.

◆ ~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 785 of file graph_impl.cpp.

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

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 698 of file graph_impl.cpp.

References sycl::_V1::detail::getSyclObjImpl(), sycl::_V1::invalid, PI_EXT_STRUCTURE_TYPE_COMMAND_BUFFER_DESC, 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 822 of file graph_impl.cpp.

References sycl::_V1::detail::enqueueImpKernel(), sycl::_V1::event, sycl::_V1::invalid, 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 1349 of file graph_impl.hpp.

◆ getDevice()

sycl::device sycl::_V1::ext::oneapi::experimental::detail::exec_graph_impl::getDevice ( ) const
inline

Query for the device tied to this graph.

Returns
Device associated with graph.

Definition at line 1345 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 1359 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 1363 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 1382 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 1353 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 183 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 1372 of file graph_impl.hpp.

◆ update() [1/3]

void sycl::_V1::ext::oneapi::experimental::detail::exec_graph_impl::update ( const std::vector< std::shared_ptr< node_impl >>  Nodes)

◆ update() [2/3]

void sycl::_V1::ext::oneapi::experimental::detail::exec_graph_impl::update ( std::shared_ptr< graph_impl GraphImpl)

Definition at line 1166 of file graph_impl.cpp.

References sycl::_V1::invalid.

Referenced by update().

◆ update() [3/3]

void sycl::_V1::ext::oneapi::experimental::detail::exec_graph_impl::update ( std::shared_ptr< node_impl Node)

Definition at line 1234 of file graph_impl.cpp.

References update().

◆ updateImpl()

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 1302 of file graph_impl.hpp.

Referenced by enqueue().


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