#include <detail/queue_impl.hpp>
Public Types | |
using | SubmitPostProcessF = std::function< void(bool, bool, event &)> |
Public Member Functions | |
queue_impl (const DeviceImplPtr &Device, const async_handler &AsyncHandler, const property_list &PropList) | |
Constructs a SYCL queue from a device using an async_handler and property_list provided. More... | |
queue_impl (const DeviceImplPtr &Device, const ContextImplPtr &Context, const async_handler &AsyncHandler, const property_list &PropList) | |
Constructs a SYCL queue with an async_handler and property_list provided form a device and a context. More... | |
queue_impl (RT::PiQueue PiQueue, const ContextImplPtr &Context, const async_handler &AsyncHandler) | |
Constructs a SYCL queue from plugin interoperability handle. More... | |
~queue_impl () | |
cl_command_queue | get () |
context | get_context () const |
const plugin & | getPlugin () const |
const ContextImplPtr & | getContextImplPtr () const |
const DeviceImplPtr & | getDeviceImplPtr () const |
device | get_device () const |
bool | is_host () const |
bool | has_discard_events_support () const |
bool | isInOrder () const |
template<typename Param > | |
Param::return_type | get_info () const |
Queries SYCL queue for information. More... | |
event | submit (const std::function< void(handler &)> &CGF, const std::shared_ptr< queue_impl > &Self, const std::shared_ptr< queue_impl > &SecondQueue, const detail::code_location &Loc, const SubmitPostProcessF *PostProcess=nullptr) |
Submits a command group function object to the queue, in order to be scheduled for execution on the device. More... | |
event | submit (const std::function< void(handler &)> &CGF, const std::shared_ptr< queue_impl > &Self, const detail::code_location &Loc, const SubmitPostProcessF *PostProcess=nullptr) |
Submits a command group function object to the queue, in order to be scheduled for execution on the device. More... | |
void | wait (const detail::code_location &Loc={}) |
Performs a blocking wait for the completion of all enqueued tasks in the queue. More... | |
exception_list | getExceptionList () const |
void | wait_and_throw (const detail::code_location &Loc={}) |
void | throw_asynchronous () |
Performs a blocking wait for the completion of all enqueued tasks in the queue. More... | |
RT::PiQueue | createQueue (QueueOrder Order) |
Creates PI queue. More... | |
RT::PiQueue & | getExclusiveQueueHandleRef () |
RT::PiQueue & | getHandleRef () |
template<typename propertyT > | |
bool | has_property () const noexcept |
template<typename propertyT > | |
propertyT | get_property () const |
event | memset (const std::shared_ptr< queue_impl > &Self, void *Ptr, int Value, size_t Count, const std::vector< event > &DepEvents) |
Fills the memory pointed by a USM pointer with the value specified. More... | |
event | memcpy (const std::shared_ptr< queue_impl > &Self, void *Dest, const void *Src, size_t Count, const std::vector< event > &DepEvents) |
Copies data from one memory region to another, both pointed by USM pointers. More... | |
event | mem_advise (const std::shared_ptr< queue_impl > &Self, const void *Ptr, size_t Length, pi_mem_advice Advice, const std::vector< event > &DepEvents) |
Provides additional information to the underlying runtime about how different allocations are used. More... | |
void | reportAsyncException (const std::exception_ptr &ExceptionPtr) |
Puts exception to the list of asynchronous ecxeptions. More... | |
ThreadPool & | getThreadPool () |
pi_native_handle | getNative () const |
Gets the native handle of the SYCL queue. More... | |
buffer< AssertHappened, 1 > & | getAssertHappenedBuffer () |
void | registerStreamServiceEvent (const EventImplPtr &Event) |
bool | ext_oneapi_empty () const |
bool | is_in_fusion_mode () |
Check whether the queue is in fusion mode. More... | |
Static Public Member Functions | |
static ContextImplPtr | getDefaultOrNew (const DeviceImplPtr &Device) |
Public Attributes | |
const bool | MDiscardEvents |
const bool | MIsProfilingEnabled |
Protected Member Functions | |
template<typename HandlerType = handler> | |
void | finalizeHandler (HandlerType &Handler, const CG::CGTYPE &Type, event &EventRet) |
event | submit_impl (const std::function< void(handler &)> &CGF, const std::shared_ptr< queue_impl > &Self, const std::shared_ptr< queue_impl > &PrimaryQueue, const std::shared_ptr< queue_impl > &SecondaryQueue, const detail::code_location &Loc, const SubmitPostProcessF *PostProcess) |
Performs command group submission to the queue. More... | |
void * | instrumentationProlog (const detail::code_location &CodeLoc, std::string &Name, int32_t StreamID, uint64_t &iid) |
void | instrumentationEpilog (void *TelementryEvent, std::string &Name, int32_t StreamID, uint64_t IId) |
void | addSharedEvent (const event &Event) |
queue_impl.addEvent tracks events with weak pointers but some events have no other owners. More... | |
void | addEvent (const event &Event) |
Stores an event that should be associated with the queue. More... | |
Protected Attributes | |
std::mutex | MMutex |
Protects all the fields that can be changed by class' methods. More... | |
DeviceImplPtr | MDevice |
const ContextImplPtr | MContext |
std::vector< std::weak_ptr< event_impl > > | MEventsWeak |
These events are tracked, but not owned, by the queue. More... | |
std::vector< event > | MEventsShared |
Events without data dependencies (such as USM) need an owner, additionally, USM operations are not added to the scheduler command graph, queue is the only owner on the runtime side. More... | |
exception_list | MExceptions |
const async_handler | MAsyncHandler |
const property_list | MPropList |
std::vector< RT::PiQueue > | MQueues |
List of queues created for FPGA device from a single SYCL queue. More... | |
size_t | MNextQueueIdx = 0 |
Iterator through MQueues. More... | |
const bool | MHostQueue = false |
bool | MSupportOOO = true |
buffer< AssertHappened, 1 > | MAssertHappenedBuffer |
event | MLastEvent |
std::mutex | MLastEventMtx |
CG::CGTYPE | MLastCGType = CG::CGTYPE::None |
const bool | MIsInorder |
std::vector< EventImplPtr > | MStreamsServiceEvents |
void * | MTraceEvent = nullptr |
uint8_t | MStreamID |
The stream under which the traces are emitted from the queue object. More... | |
uint64_t | MInstanceID = 0 |
The instance ID of the trace event for queue object. More... | |
const bool | MHasDiscardEventsSupport |
Definition at line 59 of file queue_impl.hpp.
using sycl::_V1::detail::queue_impl::SubmitPostProcessF = std::function<void(bool, bool, event &)> |
Definition at line 302 of file queue_impl.hpp.
|
inline |
Constructs a SYCL queue from a device using an async_handler and property_list provided.
Device | is a SYCL device that is used to dispatch tasks submitted to the queue. |
AsyncHandler | is a SYCL asynchronous exception handler. |
PropList | is a list of properties to use for queue construction. |
Definition at line 82 of file queue_impl.hpp.
|
inline |
Constructs a SYCL queue with an async_handler and property_list provided form a device and a context.
Device | is a SYCL device that is used to dispatch tasks submitted to the queue. |
Context | is a SYCL context to associate with the queue being constructed. |
AsyncHandler | is a SYCL asynchronous exception handler. |
PropList | is a list of properties to use for queue construction. |
Definition at line 95 of file queue_impl.hpp.
|
inline |
Constructs a SYCL queue from plugin interoperability handle.
PiQueue | is a raw PI queue handle. |
Context | is a SYCL context to associate with the queue being constructed. |
AsyncHandler | is a SYCL asynchronous exception handler. |
Definition at line 182 of file queue_impl.hpp.
|
inline |
Definition at line 245 of file queue_impl.hpp.
References sycl::_V1::detail::plugin::call(), sycl::_V1::detail::pi::getPlugin(), and piQueueRelease().
|
protected |
Stores an event that should be associated with the queue.
Event | is the event to be stored |
Definition at line 232 of file queue_impl.cpp.
References sycl::_V1::detail::getSyclObjImpl().
|
protected |
queue_impl.addEvent tracks events with weak pointers but some events have no other owners.
addSharedEvent - queue_impl tracks events with weak pointers but some events have no other owner.
addSharedEvent() follows events with a shared pointer.
Event | is the event to be stored |
In this case, addSharedEvent will have the queue track the events via a shared pointer.
Definition at line 255 of file queue_impl.cpp.
|
inline |
Creates PI queue.
Order | specifies whether the queue being constructed as in-order or out-of-order. |
Definition at line 388 of file queue_impl.hpp.
References __SYCL_PI_CUDA_USE_DEFAULT_STREAM, sycl::_V1::detail::plugin::call_nocheck(), sycl::_V1::detail::plugin::checkPiResult(), Device, sycl::_V1::detail::plugin::getBackend(), sycl::_V1::detail::pi::getPlugin(), sycl::_V1::make_error_code(), sycl::_V1::detail::OOO, sycl::_V1::detail::Ordered, PI_EXT_ONEAPI_QUEUE_FLAG_DISCARD_EVENTS, PI_EXT_ONEAPI_QUEUE_FLAG_PRIORITY_HIGH, PI_EXT_ONEAPI_QUEUE_FLAG_PRIORITY_LOW, PI_QUEUE_COMPUTE_INDEX, PI_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE, PI_QUEUE_FLAG_PROFILING_ENABLE, PI_QUEUE_FLAGS, and piextQueueCreate().
bool sycl::_V1::detail::queue_impl::ext_oneapi_empty | ( | ) | const |
Definition at line 435 of file queue_impl.cpp.
References sycl::_V1::detail::plugin::call(), sycl::_V1::detail::pi::getPlugin(), PI_EXT_ONEAPI_QUEUE_INFO_EMPTY, and piQueueGetInfo().
|
inlineprotected |
Definition at line 593 of file queue_impl.hpp.
|
inline |
Definition at line 265 of file queue_impl.hpp.
References sycl::_V1::detail::plugin::call(), sycl::_V1::detail::pi::getPlugin(), and piQueueRetain().
|
inline |
Definition at line 276 of file queue_impl.hpp.
|
inline |
Definition at line 287 of file queue_impl.hpp.
Param::return_type sycl::_V1::detail::queue_impl::get_info | ( | ) | const |
Queries SYCL queue for information.
The return type depends on information being queried.
|
inline |
Definition at line 511 of file queue_impl.hpp.
|
inline |
Definition at line 570 of file queue_impl.hpp.
|
inline |
Definition at line 282 of file queue_impl.hpp.
|
inlinestatic |
Definition at line 63 of file queue_impl.hpp.
References Device, and sycl::_V1::detail::getSyclObjImpl().
|
inline |
Definition at line 284 of file queue_impl.hpp.
|
inline |
Definition at line 353 of file queue_impl.hpp.
|
inline |
Definition at line 464 of file queue_impl.hpp.
References sycl::_V1::detail::plugin::call(), sycl::_V1::detail::pi::getPlugin(), sycl::_V1::detail::MaxNumQueues, sycl::_V1::detail::Ordered, and piQueueFinish().
|
inline |
Definition at line 495 of file queue_impl.hpp.
pi_native_handle sycl::_V1::detail::queue_impl::getNative | ( | ) | const |
Gets the native handle of the SYCL queue.
Definition at line 426 of file queue_impl.cpp.
References sycl::_V1::detail::plugin::call(), sycl::_V1::detail::plugin::getBackend(), sycl::_V1::detail::pi::getPlugin(), piextQueueGetNativeHandle(), and piQueueRetain().
|
inline |
Definition at line 280 of file queue_impl.hpp.
|
inline |
Definition at line 561 of file queue_impl.hpp.
|
inline |
Definition at line 293 of file queue_impl.hpp.
|
inlinenoexcept |
Definition at line 504 of file queue_impl.hpp.
|
protected |
Definition at line 352 of file queue_impl.cpp.
|
protected |
Definition at line 284 of file queue_impl.cpp.
References sycl::_V1::detail::code_location::columnNumber(), sycl::_V1::detail::code_location::fileName(), sycl::_V1::detail::code_location::functionName(), sycl::_V1::detail::getSyclObjImpl(), sycl::_V1::device::is_accelerator(), sycl::_V1::device::is_cpu(), sycl::_V1::device::is_gpu(), and sycl::_V1::detail::code_location::lineNumber().
|
inline |
Definition at line 290 of file queue_impl.hpp.
|
inline |
Check whether the queue is in fusion mode.
Definition at line 584 of file queue_impl.hpp.
|
inline |
Definition at line 295 of file queue_impl.hpp.
event sycl::_V1::detail::queue_impl::mem_advise | ( | const std::shared_ptr< queue_impl > & | Self, |
const void * | Ptr, | ||
size_t | Length, | ||
pi_mem_advice | Advice, | ||
const std::vector< event > & | DepEvents | ||
) |
Provides additional information to the underlying runtime about how different allocations are used.
Self | is a shared_ptr to this queue. |
Ptr | is a USM pointer to the allocation. |
Length | is a number of bytes in the allocation. |
Advice | is a device-defined advice for the specified allocation. |
DepEvents | is a vector of events that specifies the kernel dependencies. |
Definition at line 188 of file queue_impl.cpp.
References sycl::_V1::detail::createDiscardedEvent(), sycl::_V1::detail::getOrWaitEvents(), and sycl::_V1::detail::prepareUSMEvent().
event sycl::_V1::detail::queue_impl::memcpy | ( | const std::shared_ptr< queue_impl > & | Self, |
void * | Dest, | ||
const void * | Src, | ||
size_t | Count, | ||
const std::vector< event > & | DepEvents | ||
) |
Copies data from one memory region to another, both pointed by USM pointers.
Self | is a shared_ptr to this queue. |
Dest | is a USM pointer to the destination memory. |
Src | is a USM pointer to the source memory. |
Count | is a number of bytes to copy. |
DepEvents | is a vector of events that specifies the kernel dependencies. |
Definition at line 125 of file queue_impl.cpp.
References sycl::_V1::detail::XPTIScope::addMetadata(), sycl::_V1::detail::createDiscardedEvent(), sycl::_V1::detail::getOrWaitEvents(), sycl::_V1::detail::XPTIScope::notify(), sycl::_V1::detail::prepareUSMEvent(), sycl::_V1::detail::XPTIScope::scopedNotify(), and sycl::_V1::detail::SYCL_MEM_ALLOC_STREAM_NAME.
event sycl::_V1::detail::queue_impl::memset | ( | const std::shared_ptr< queue_impl > & | Self, |
void * | Ptr, | ||
int | Value, | ||
size_t | Count, | ||
const std::vector< event > & | DepEvents | ||
) |
Fills the memory pointed by a USM pointer with the value specified.
Self | is a shared_ptr to this queue. |
Ptr | is a USM pointer to the memory to fill. |
Value | is a value to be set. Value is cast as an unsigned char. |
Count | is a number of bytes to fill. |
DepEvents | is a vector of events that specifies the kernel dependencies. |
Definition at line 63 of file queue_impl.cpp.
References sycl::_V1::detail::XPTIScope::addMetadata(), sycl::_V1::detail::createDiscardedEvent(), sycl::_V1::detail::getOrWaitEvents(), sycl::_V1::detail::XPTIScope::notify(), sycl::_V1::detail::prepareUSMEvent(), sycl::_V1::detail::XPTIScope::scopedNotify(), and sycl::_V1::detail::SYCL_MEM_ALLOC_STREAM_NAME.
|
inline |
Definition at line 574 of file queue_impl.hpp.
|
inline |
Puts exception to the list of asynchronous ecxeptions.
ExceptionPtr | is a pointer to exception to be put. |
Definition at line 556 of file queue_impl.hpp.
|
inline |
Submits a command group function object to the queue, in order to be scheduled for execution on the device.
CGF | is a function object containing command group. |
Self | is a shared_ptr to this queue. |
Loc | is the code location of the submit call (default argument) |
StoreAdditionalInfo | makes additional info be stored in event_impl |
Definition at line 338 of file queue_impl.hpp.
|
inline |
Submits a command group function object to the queue, in order to be scheduled for execution on the device.
On a kernel error, this command group function object is then scheduled for execution on a secondary queue.
CGF | is a function object containing command group. |
Self | is a shared_ptr to this queue. |
SecondQueue | is a shared_ptr to the secondary queue. |
Loc | is the code location of the submit call (default argument) |
StoreAdditionalInfo | makes additional info be stored in event_impl |
Definition at line 317 of file queue_impl.hpp.
|
inlineprotected |
Performs command group submission to the queue.
CGF | is a function object containing command group. |
Self | is a pointer to this queue. |
PrimaryQueue | is a pointer to the primary queue. This may be the same as Self. |
SecondaryQueue | is a pointer to the secondary queue. This may be the same as Self. |
Loc | is the code location of the submit call (default argument) |
Definition at line 635 of file queue_impl.hpp.
References sycl::_V1::detail::reduction::finalizeHandler().
|
inline |
Performs a blocking wait for the completion of all enqueued tasks in the queue.
Synchronous errors will be reported through SYCL exceptions. Asynchronous errors will be passed to the async_handler passed to the queue on construction. If no async_handler was provided then asynchronous exceptions will be lost.
Definition at line 368 of file queue_impl.hpp.
References sycl::_V1::exception_list::size().
void sycl::_V1::detail::queue_impl::wait | ( | const detail::code_location & | Loc = {} | ) |
Performs a blocking wait for the completion of all enqueued tasks in the queue.
Synchronous errors will be reported through SYCL exceptions.
Loc | is the code location of the submit call (default argument) |
Definition at line 369 of file queue_impl.cpp.
References sycl::_V1::detail::plugin::call(), sycl::_V1::detail::pi::getPlugin(), piQueueFinish(), and sycl::_V1::detail::SYCL_STREAM_NAME.
|
inline |
Loc | is the code location of the submit call (default argument) |
Definition at line 356 of file queue_impl.hpp.
|
protected |
Definition at line 720 of file queue_impl.hpp.
|
protected |
Definition at line 707 of file queue_impl.hpp.
|
protected |
Definition at line 697 of file queue_impl.hpp.
|
protected |
Definition at line 696 of file queue_impl.hpp.
const bool sycl::_V1::detail::queue_impl::MDiscardEvents |
Definition at line 747 of file queue_impl.hpp.
|
protected |
Events without data dependencies (such as USM) need an owner, additionally, USM operations are not added to the scheduler command graph, queue is the only owner on the runtime side.
Definition at line 705 of file queue_impl.hpp.
|
protected |
These events are tracked, but not owned, by the queue.
Definition at line 700 of file queue_impl.hpp.
|
protected |
Definition at line 706 of file queue_impl.hpp.
|
protected |
Definition at line 756 of file queue_impl.hpp.
|
protected |
Definition at line 715 of file queue_impl.hpp.
|
protected |
The instance ID of the trace event for queue object.
Definition at line 743 of file queue_impl.hpp.
|
protected |
Definition at line 731 of file queue_impl.hpp.
const bool sycl::_V1::detail::queue_impl::MIsProfilingEnabled |
Definition at line 748 of file queue_impl.hpp.
|
protected |
Definition at line 729 of file queue_impl.hpp.
|
protected |
Definition at line 724 of file queue_impl.hpp.
|
mutableprotected |
Definition at line 725 of file queue_impl.hpp.
|
mutableprotected |
Protects all the fields that can be changed by class' methods.
Definition at line 694 of file queue_impl.hpp.
|
protected |
Iterator through MQueues.
Definition at line 713 of file queue_impl.hpp.
|
protected |
Definition at line 708 of file queue_impl.hpp.
|
protected |
List of queues created for FPGA device from a single SYCL queue.
Definition at line 711 of file queue_impl.hpp.
|
protected |
The stream under which the traces are emitted from the queue object.
Definition at line 741 of file queue_impl.hpp.
|
protected |
Definition at line 733 of file queue_impl.hpp.
|
protected |
Definition at line 717 of file queue_impl.hpp.
|
protected |
Definition at line 739 of file queue_impl.hpp.