Class representing the implementation of command_graph<executable>. More...
#include <detail/graph_impl.hpp>
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... | |
Class representing the implementation of command_graph<executable>.
Definition at line 1237 of file graph_impl.hpp.
using sycl::_V1::ext::oneapi::experimental::detail::exec_graph_impl::ReadLock = std::shared_lock<std::shared_mutex> |
Definition at line 1239 of file graph_impl.hpp.
using sycl::_V1::ext::oneapi::experimental::detail::exec_graph_impl::WriteLock = std::unique_lock<std::shared_mutex> |
Definition at line 1240 of file graph_impl.hpp.
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).
Context | Context to create graph with. |
GraphImpl | Modifiable graph implementation to create with. |
PropList | List of properties for constructing this object |
Definition at line 757 of file graph_impl.cpp.
References sycl::_V1::feature_not_supported.
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 779 of file graph_impl.cpp.
References sycl::_V1::detail::getSyclObjImpl(), piextCommandBufferRelease(), and piextCommandBufferReleaseCommand().
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.
Device | Device to create backend command-buffers for. |
Partion | Partition to which the created command-buffer should be attached. |
Definition at line 696 of file graph_impl.cpp.
References sycl::_V1::detail::getSyclObjImpl(), sycl::_V1::invalid, PI_EXT_STRUCTURE_TYPE_COMMAND_BUFFER_DESC, piextCommandBufferCreate(), and piextCommandBufferFinalize().
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.
Queue | Command-queue to schedule execution on. |
CGData | Command-group data provided by the sycl::handler |
Definition at line 812 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().
|
inline |
Query for the context tied to this graph.
Definition at line 1290 of file graph_impl.hpp.
|
inline |
Query for the device tied to this graph.
Definition at line 1286 of file graph_impl.hpp.
|
inline |
Query the graph_impl.
Definition at line 1300 of file graph_impl.hpp.
|
inline |
Query the vector of the partitions composing the exec_graph.
Definition at line 1304 of file graph_impl.hpp.
|
inline |
Returns a list of all the accessor requirements for this graph.
Definition at line 1323 of file graph_impl.hpp.
|
inline |
Query the scheduling of node execution.
Definition at line 1294 of file graph_impl.hpp.
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.
|
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.
Definition at line 1313 of file graph_impl.hpp.
void sycl::_V1::ext::oneapi::experimental::detail::exec_graph_impl::update | ( | const std::vector< std::shared_ptr< node_impl >> | Nodes | ) |
Definition at line 1209 of file graph_impl.cpp.
References sycl::_V1::detail::getSyclObjImpl(), sycl::_V1::invalid, and updateImpl().
void sycl::_V1::ext::oneapi::experimental::detail::exec_graph_impl::update | ( | std::shared_ptr< graph_impl > | GraphImpl | ) |
Definition at line 1159 of file graph_impl.cpp.
References sycl::_V1::invalid.
Referenced by update().
void sycl::_V1::ext::oneapi::experimental::detail::exec_graph_impl::update | ( | std::shared_ptr< node_impl > | Node | ) |
Definition at line 1205 of file graph_impl.cpp.
References update().
void sycl::_V1::ext::oneapi::experimental::detail::exec_graph_impl::updateImpl | ( | std::shared_ptr< node_impl > | NodeImpl | ) |
Definition at line 1284 of file graph_impl.cpp.
References sycl::_V1::detail::applyFuncOnFilteredArgs(), sycl::_V1::access::discard_write, sycl::_V1::detail::getSyclObjImpl(), pi_ext_command_buffer_update_kernel_launch_desc::global_work_offset, pi_ext_command_buffer_update_kernel_launch_desc::global_work_size, sycl::_V1::invalid, pi_ext_command_buffer_update_kernel_launch_desc::local_work_size, pi_ext_command_buffer_update_kernel_launch_desc::mem_obj_arg_list, pi_ext_command_buffer_update_kernel_launch_desc::num_mem_obj_args, pi_ext_command_buffer_update_kernel_launch_desc::num_ptr_args, pi_ext_command_buffer_update_kernel_launch_desc::num_value_args, pi_ext_command_buffer_update_kernel_launch_desc::num_work_dim, PI_ACCESS_READ_ONLY, PI_ACCESS_READ_WRITE, PI_ACCESS_WRITE_ONLY, PI_KERNEL_ARG_MEM_OBJ_ACCESS, PI_KERNEL_GROUP_INFO_COMPILE_WORK_GROUP_SIZE, piextCommandBufferUpdateKernelLaunch(), piKernelGetGroupInfo(), pi_ext_command_buffer_update_kernel_launch_desc::ptr_arg_list, sycl::_V1::access::read, sycl::_V1::detail::ReverseRangeDimensionsForKernel(), sycl::_V1::detail::tie(), pi_ext_command_buffer_update_kernel_launch_desc::value_arg_list, and sycl::_V1::access::write.
Referenced by update().
|
mutable |
Protects all the fields that can be changed by class' methods.
Definition at line 1243 of file graph_impl.hpp.
Referenced by enqueue().