DPC++ Runtime
Runtime libraries for oneAPI DPC++
sycl::_V1::detail::LeavesCollection Class Reference

A wrapper for CircularBuffer class along with collection for host accessor's EmptyCommands. More...

#include <detail/scheduler/leaves_collection.hpp>

Classes

class  IteratorT
 

Public Types

using GenericCommandsT = CircularBuffer< Command * >
 
using HostAccessorCommandsT = std::list< EmptyCommand * >
 
using EnqueueListT = std::vector< Command * >
 
using AllocateDependencyF = std::function< void(Command *, Command *, MemObjRecord *, EnqueueListT &)>
 
using value_type = Command *
 
using pointer = value_type *
 
using const_pointer = const value_type *
 
using reference = value_type &
 
using const_reference = const value_type &
 
using iterator = IteratorT< false >
 
using const_iterator = IteratorT< true >
 

Public Member Functions

 LeavesCollection (MemObjRecord *Record, std::size_t GenericCommandsCapacity, AllocateDependencyF AllocateDependency)
 
iterator begin ()
 
iterator end ()
 
const_iterator cbegin () const
 
const_iterator cend () const
 
bool push_back (value_type Cmd, EnqueueListT &ToEnqueue)
 Returns true if insertion took place. Returns false otherwise. More...
 
size_t remove (value_type Cmd)
 Replacement for std::remove with subsequent call to erase(newEnd, end()). More...
 
std::vector< value_typetoVector () const
 
size_t genericCommandsCapacity () const
 
const GenericCommandsTgetGenericCommands () const
 
const HostAccessorCommandsT getHostAccessorCommands () const
 

Friends

class IteratorT< true >
 
class IteratorT< false >
 

Detailed Description

A wrapper for CircularBuffer class along with collection for host accessor's EmptyCommands.

This class is introduced to overcome the problem with a lot of host accessors for the same memory object. The problem arises even when all the host accessors are read-only and their ranges intersect somehow.

Inside the class there is a classical CircularBuffer for generic commands. Also, it contains proper data structures for storing host accessors' EmptyCommands. Cross-referencing data structures are employed for quick enough navigation amongst stored EmptyCommands. IteratorT subclass allows for iterating and dereferencing. Though, it's not guaranteed to work with std::remove as host accessors' commands are stored in a map. Hence, the LeavesCollection class provides a viable solution with its own remove method.

Definition at line 38 of file leaves_collection.hpp.

Member Typedef Documentation

◆ AllocateDependencyF

◆ const_iterator

◆ const_pointer

◆ const_reference

◆ EnqueueListT

Definition at line 42 of file leaves_collection.hpp.

◆ GenericCommandsT

◆ HostAccessorCommandsT

◆ iterator

◆ pointer

◆ reference

◆ value_type

Constructor & Destructor Documentation

◆ LeavesCollection()

sycl::_V1::detail::LeavesCollection::LeavesCollection ( MemObjRecord Record,
std::size_t  GenericCommandsCapacity,
AllocateDependencyF  AllocateDependency 
)
inline

Definition at line 59 of file leaves_collection.hpp.

Member Function Documentation

◆ begin()

iterator sycl::_V1::detail::LeavesCollection::begin ( )
inline

◆ cbegin()

const_iterator sycl::_V1::detail::LeavesCollection::cbegin ( ) const
inline

◆ cend()

const_iterator sycl::_V1::detail::LeavesCollection::cend ( ) const
inline

Definition at line 80 of file leaves_collection.hpp.

◆ end()

iterator sycl::_V1::detail::LeavesCollection::end ( )
inline

Definition at line 71 of file leaves_collection.hpp.

◆ genericCommandsCapacity()

size_t sycl::_V1::detail::LeavesCollection::genericCommandsCapacity ( ) const
inline

◆ getGenericCommands()

const GenericCommandsT& sycl::_V1::detail::LeavesCollection::getGenericCommands ( ) const
inline

Definition at line 98 of file leaves_collection.hpp.

◆ getHostAccessorCommands()

const HostAccessorCommandsT sycl::_V1::detail::LeavesCollection::getHostAccessorCommands ( ) const
inline

Definition at line 102 of file leaves_collection.hpp.

◆ push_back()

bool sycl::_V1::detail::LeavesCollection::push_back ( value_type  Cmd,
EnqueueListT ToEnqueue 
)

Returns true if insertion took place. Returns false otherwise.

Definition at line 52 of file leaves_collection.cpp.

References sycl::_V1::detail::isHostAccessorCmd().

◆ remove()

size_t sycl::_V1::detail::LeavesCollection::remove ( value_type  Cmd)

Replacement for std::remove with subsequent call to erase(newEnd, end()).

This function is introduced here due to complexity of iterator.

Returns
number of removed elements

Definition at line 38 of file leaves_collection.cpp.

References sycl::_V1::detail::CircularBuffer< T >::begin(), sycl::_V1::detail::CircularBuffer< T >::end(), sycl::_V1::detail::CircularBuffer< T >::erase(), and sycl::_V1::detail::isHostAccessorCmd().

Referenced by sycl::_V1::detail::Scheduler::GraphBuilder::updateLeaves().

◆ toVector()

Friends And Related Function Documentation

◆ IteratorT< false >

friend class IteratorT< false >
friend

Definition at line 150 of file leaves_collection.hpp.

◆ IteratorT< true >

friend class IteratorT< true >
friend

Definition at line 150 of file leaves_collection.hpp.


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