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_type > | toVector () const |
size_t | genericCommandsCapacity () const |
const GenericCommandsT & | getGenericCommands () const |
const HostAccessorCommandsT | getHostAccessorCommands () const |
Friends | |
class | IteratorT< true > |
class | IteratorT< false > |
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.
using sycl::_V1::detail::LeavesCollection::AllocateDependencyF = std::function<void(Command *, Command *, MemObjRecord *, EnqueueListT &)> |
Definition at line 46 of file leaves_collection.hpp.
using sycl::_V1::detail::LeavesCollection::const_iterator = IteratorT<true> |
Definition at line 57 of file leaves_collection.hpp.
using sycl::_V1::detail::LeavesCollection::const_pointer = const value_type * |
Definition at line 52 of file leaves_collection.hpp.
using sycl::_V1::detail::LeavesCollection::const_reference = const value_type & |
Definition at line 54 of file leaves_collection.hpp.
using sycl::_V1::detail::LeavesCollection::EnqueueListT = std::vector<Command *> |
Definition at line 42 of file leaves_collection.hpp.
Definition at line 40 of file leaves_collection.hpp.
using sycl::_V1::detail::LeavesCollection::HostAccessorCommandsT = std::list<EmptyCommand *> |
Definition at line 41 of file leaves_collection.hpp.
using sycl::_V1::detail::LeavesCollection::iterator = IteratorT<false> |
Definition at line 56 of file leaves_collection.hpp.
Definition at line 51 of file leaves_collection.hpp.
Definition at line 53 of file leaves_collection.hpp.
Definition at line 50 of file leaves_collection.hpp.
|
inline |
Definition at line 59 of file leaves_collection.hpp.
|
inline |
Definition at line 64 of file leaves_collection.hpp.
|
inline |
Definition at line 73 of file leaves_collection.hpp.
|
inline |
Definition at line 80 of file leaves_collection.hpp.
|
inline |
Definition at line 71 of file leaves_collection.hpp.
|
inline |
Definition at line 94 of file leaves_collection.hpp.
|
inline |
Definition at line 98 of file leaves_collection.hpp.
|
inline |
Definition at line 102 of file leaves_collection.hpp.
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().
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.
Definition at line 38 of file leaves_collection.cpp.
References sycl::_V1::detail::isHostAccessorCmd().
Referenced by sycl::_V1::detail::Scheduler::GraphBuilder::updateLeaves().
std::vector< LeavesCollection::value_type > sycl::_V1::detail::LeavesCollection::toVector | ( | ) | const |
Definition at line 64 of file leaves_collection.cpp.
|
friend |
Definition at line 156 of file leaves_collection.hpp.
|
friend |
Definition at line 155 of file leaves_collection.hpp.