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

#include <detail/queue_impl.hpp>

Collaboration diagram for sycl::_V1::detail::queue_impl:

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...
 
event getLastEvent ()
 
 queue_impl (sycl::detail::pi::PiQueue PiQueue, const ContextImplPtr &Context, const async_handler &AsyncHandler)
 Constructs a SYCL queue from plugin interoperability handle. More...
 
 queue_impl (sycl::detail::pi::PiQueue PiQueue, const ContextImplPtr &Context, const async_handler &AsyncHandler, const property_list &PropList)
 Constructs a SYCL queue from plugin interoperability handle. More...
 
 ~queue_impl ()
 
cl_command_queue get ()
 
context get_context () const
 
const PluginPtrgetPlugin () const
 
const ContextImplPtrgetContextImplPtr () const
 
const DeviceImplPtrgetDeviceImplPtr () const
 
device get_device () const
 
bool is_host () const
 
bool supportsDiscardingPiEvents () const
 
bool isInOrder () const
 
template<typename Param >
Param::return_type get_info () const
 Queries SYCL queue for information. More...
 
template<typename Param >
Param::return_type get_backend_info () const
 Queries SYCL queue for SYCL backend-specific 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...
 
sycl::detail::pi::PiQueue createQueue (QueueOrder Order)
 Creates PI queue. More...
 
sycl::detail::pi::PiQueuegetExclusiveQueueHandleRef ()
 
sycl::detail::pi::PiQueuegetHandleRef ()
 
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, const code_location &CodeLoc)
 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...
 
ThreadPoolgetThreadPool ()
 
pi_native_handle getNative (int32_t &NativeHandleDesc) const
 Gets the native handle of the SYCL queue. More...
 
void registerStreamServiceEvent (const EventImplPtr &Event)
 
bool ext_oneapi_empty () const
 
bool is_in_fusion_mode ()
 Check whether the queue is in fusion mode. More...
 
event memcpyToDeviceGlobal (const std::shared_ptr< queue_impl > &Self, void *DeviceGlobalPtr, const void *Src, bool IsDeviceImageScope, size_t NumBytes, size_t Offset, const std::vector< event > &DepEvents)
 
event memcpyFromDeviceGlobal (const std::shared_ptr< queue_impl > &Self, void *Dest, const void *DeviceGlobalPtr, bool IsDeviceImageScope, size_t NumBytes, size_t Offset, const std::vector< event > &DepEvents)
 
bool isProfilingFallback ()
 
void setCommandGraph (std::shared_ptr< ext::oneapi::experimental::detail::graph_impl > Graph)
 
std::shared_ptr< ext::oneapi::experimental::detail::graph_implgetCommandGraph () const
 
unsigned long long getQueueID ()
 
void setExternalEvent (const event &Event)
 
std::optional< eventpopExternalEvent ()
 
const std::vector< event > & getExtendDependencyList (const std::vector< event > &DepEvents, std::vector< event > &MutableVec, std::unique_lock< std::mutex > &QueueLock)
 
template<typename HandlerFuncT , typename MemOpFuncT , typename... MemOpArgTs>
event submitMemOpHelper (const std::shared_ptr< queue_impl > &Self, const std::vector< event > &DepEvents, HandlerFuncT HandlerFunc, MemOpFuncT MemOpFunc, MemOpArgTs... MemOpArgs)
 

Static Public Member Functions

static ContextImplPtr getDefaultOrNew (const DeviceImplPtr &Device)
 
static sycl::detail::pi::PiQueueProperties createPiQueueProperties (const property_list &PropList, QueueOrder Order)
 Creates PI properties array. More...
 

Public Attributes

const bool MDiscardEvents
 
const bool MIsProfilingEnabled
 

Protected Member Functions

event discard_or_return (const event &Event)
 
void cleanup_fusion_cmd ()
 
template<typename HandlerType = handler>
void finalizeHandler (HandlerType &Handler, 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...
 
template<typename HandlerFuncT >
event submitWithHandler (const std::shared_ptr< queue_impl > &Self, const std::vector< event > &DepEvents, HandlerFuncT HandlerFunc)
 Helper function for submitting a memory operation with a handler. More...
 
template<typename HandlerFuncT , typename MemMngrFuncT , typename... MemMngrArgTs>
event submitMemOpHelper (const std::shared_ptr< queue_impl > &Self, const std::vector< event > &DepEvents, HandlerFuncT HandlerFunc, MemMngrFuncT MemMngrFunc, MemMngrArgTs... MemOpArgs)
 Performs submission of a memory operation directly if scheduler can be bypassed, or with a handler otherwise. 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< eventMEventsShared
 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< sycl::detail::pi::PiQueueMQueues
 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 MEmulateOOO = false
 Indicates that a native out-of-order queue could not be created and we need to emulate it with multiple native in-order queues. More...
 
EventImplPtr MLastEventPtr
 
EventImplPtr MGraphLastEventPtr
 
const bool MIsInorder
 
std::vector< EventImplPtrMStreamsServiceEvents
 
std::mutex MStreamsServiceEventsMutex
 
void * MTraceEvent = nullptr
 
uint8_t MStreamID = 0
 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...
 
bool MFallbackProfiling = false
 
std::optional< eventMInOrderExternalEvent
 
std::mutex MInOrderExternalEventMtx
 
const bool MSupportsDiscardingPiEvents
 
std::weak_ptr< ext::oneapi::experimental::detail::graph_implMGraph {}
 
unsigned long long MQueueID
 

Static Protected Attributes

static std::atomic< unsigned long long > MNextAvailableQueueID = 0
 

Friends

class sycl::ext::oneapi::experimental::detail::node_impl
 

Detailed Description

Definition at line 70 of file queue_impl.hpp.

Member Typedef Documentation

◆ SubmitPostProcessF

using sycl::_V1::detail::queue_impl::SubmitPostProcessF = std::function<void(bool, bool, event &)>

Definition at line 391 of file queue_impl.hpp.

Constructor & Destructor Documentation

◆ queue_impl() [1/4]

sycl::_V1::detail::queue_impl::queue_impl ( const DeviceImplPtr Device,
const async_handler AsyncHandler,
const property_list PropList 
)
inline

Constructs a SYCL queue from a device using an async_handler and property_list provided.

Parameters
Deviceis a SYCL device that is used to dispatch tasks submitted to the queue.
AsyncHandleris a SYCL asynchronous exception handler.
PropListis a list of properties to use for queue construction.

Definition at line 93 of file queue_impl.hpp.

◆ queue_impl() [2/4]

sycl::_V1::detail::queue_impl::queue_impl ( const DeviceImplPtr Device,
const ContextImplPtr Context,
const async_handler AsyncHandler,
const property_list PropList 
)
inline

Constructs a SYCL queue with an async_handler and property_list provided form a device and a context.

Parameters
Deviceis a SYCL device that is used to dispatch tasks submitted to the queue.
Contextis a SYCL context to associate with the queue being constructed.
AsyncHandleris a SYCL asynchronous exception handler.
PropListis a list of properties to use for queue construction.

Definition at line 106 of file queue_impl.hpp.

References createQueue(), sycl::_V1::feature_not_supported, getDeviceImplPtr(), getHandleRef(), has_property(), sycl::_V1::invalid, is_host(), sycl::_V1::make_error_code(), MContext, MDevice, MFallbackProfiling, MHostQueue, MInstanceID, MIsInorder, MQueueID, MQueues, MStreamID, MTraceEvent, sycl::_V1::detail::OOO, sycl::_V1::opencl, sycl::_V1::detail::Ordered, and sycl::_V1::detail::SYCL_STREAM_NAME.

◆ queue_impl() [3/4]

sycl::_V1::detail::queue_impl::queue_impl ( sycl::detail::pi::PiQueue  PiQueue,
const ContextImplPtr Context,
const async_handler AsyncHandler 
)
inline

Constructs a SYCL queue from plugin interoperability handle.

Parameters
PiQueueis a raw PI queue handle.
Contextis a SYCL context to associate with the queue being constructed.
AsyncHandleris a SYCL asynchronous exception handler.

Definition at line 288 of file queue_impl.hpp.

◆ queue_impl() [4/4]

sycl::_V1::detail::queue_impl::queue_impl ( sycl::detail::pi::PiQueue  PiQueue,
const ContextImplPtr Context,
const async_handler AsyncHandler,
const property_list PropList 
)
inline

Constructs a SYCL queue from plugin interoperability handle.

Parameters
PiQueueis a raw PI queue handle.
Contextis a SYCL context to associate with the queue being constructed.
AsyncHandleris a SYCL asynchronous exception handler.
PropListis the queue properties.

Definition at line 309 of file queue_impl.hpp.

◆ ~queue_impl()

sycl::_V1::detail::queue_impl::~queue_impl ( )
inline

Member Function Documentation

◆ addEvent()

void sycl::_V1::detail::queue_impl::addEvent ( const event Event)
protected

Stores an event that should be associated with the queue.

Parameters
Eventis the event to be stored

Definition at line 273 of file queue_impl.cpp.

References addSharedEvent(), sycl::_V1::detail::getSyclObjImpl(), is_host(), MEmulateOOO, MEventsWeak, and MMutex.

Referenced by submit_impl().

◆ addSharedEvent()

void sycl::_V1::detail::queue_impl::addSharedEvent ( const event Event)
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.

Parameters
Eventis the event to be stored

In this case, addSharedEvent will have the queue track the events via a shared pointer.

Definition at line 296 of file queue_impl.cpp.

References is_host(), MEmulateOOO, MEventsShared, and MMutex.

Referenced by addEvent(), and submitMemOpHelper().

◆ cleanup_fusion_cmd()

void sycl::_V1::detail::queue_impl::cleanup_fusion_cmd ( )
protected

◆ createPiQueueProperties()

static sycl::detail::pi::PiQueueProperties sycl::_V1::detail::queue_impl::createPiQueueProperties ( const property_list PropList,
QueueOrder  Order 
)
inlinestatic

◆ createQueue()

sycl::detail::pi::PiQueue sycl::_V1::detail::queue_impl::createQueue ( QueueOrder  Order)
inline

Creates PI queue.

Parameters
Orderspecifies whether the queue being constructed as in-order or out-of-order.

Definition at line 548 of file queue_impl.hpp.

References createPiQueueProperties(), getPlugin(), MContext, MDevice, MEmulateOOO, MPropList, sycl::_V1::detail::Ordered, PI_QUEUE_COMPUTE_INDEX, PI_QUEUE_FLAGS, and piextQueueCreate().

Referenced by getExclusiveQueueHandleRef(), and queue_impl().

◆ discard_or_return()

event sycl::_V1::detail::queue_impl::discard_or_return ( const event Event)
protected

Definition at line 599 of file queue_impl.cpp.

References sycl::_V1::detail::createDiscardedEvent(), and MDiscardEvents.

Referenced by submit(), and submitMemOpHelper().

◆ ext_oneapi_empty()

bool sycl::_V1::detail::queue_impl::ext_oneapi_empty ( ) const

◆ finalizeHandler()

template<typename HandlerType = handler>
void sycl::_V1::detail::queue_impl::finalizeHandler ( HandlerType &  Handler,
event EventRet 
)
inlineprotected

◆ get()

cl_command_queue sycl::_V1::detail::queue_impl::get ( )
inline
Returns
an OpenCL interoperability queue handle.

Definition at line 346 of file queue_impl.hpp.

References getPlugin(), MHostQueue, MQueues, and piQueueRetain().

◆ get_backend_info()

template<typename Param >
Param::return_type sycl::_V1::detail::queue_impl::get_backend_info ( ) const

Queries SYCL queue for SYCL backend-specific information.

The return type depends on information being queried.

◆ get_context()

context sycl::_V1::detail::queue_impl::get_context ( ) const
inline
Returns
an associated SYCL context.

Definition at line 357 of file queue_impl.hpp.

References MContext.

◆ get_device()

device sycl::_V1::detail::queue_impl::get_device ( ) const
inline
Returns
an associated SYCL device.

Definition at line 368 of file queue_impl.hpp.

References MDevice.

Referenced by instrumentationProlog().

◆ get_info()

template<typename Param >
Param::return_type sycl::_V1::detail::queue_impl::get_info ( ) const

Queries SYCL queue for information.

The return type depends on information being queried.

◆ get_property()

template<typename propertyT >
propertyT sycl::_V1::detail::queue_impl::get_property ( ) const
inline
Returns
a copy of the property of type PropertyT that the queue was constructed with. If the queue was not constructed with the PropertyT property, an invalid_object_error SYCL exception.

Definition at line 628 of file queue_impl.hpp.

References sycl::_V1::property_list::get_property(), and MPropList.

◆ getCommandGraph()

std::shared_ptr<ext::oneapi::experimental::detail::graph_impl> sycl::_V1::detail::queue_impl::getCommandGraph ( ) const
inline

Definition at line 725 of file queue_impl.hpp.

References MGraph.

◆ getContextImplPtr()

const ContextImplPtr& sycl::_V1::detail::queue_impl::getContextImplPtr ( ) const
inline

Definition at line 363 of file queue_impl.hpp.

References MContext.

Referenced by getNative().

◆ getDefaultOrNew()

static ContextImplPtr sycl::_V1::detail::queue_impl::getDefaultOrNew ( const DeviceImplPtr Device)
inlinestatic

◆ getDeviceImplPtr()

const DeviceImplPtr& sycl::_V1::detail::queue_impl::getDeviceImplPtr ( ) const
inline

Definition at line 365 of file queue_impl.hpp.

References MDevice.

Referenced by queue_impl().

◆ getExceptionList()

exception_list sycl::_V1::detail::queue_impl::getExceptionList ( ) const
inline
Returns
list of asynchronous exceptions occurred during execution.

Definition at line 445 of file queue_impl.hpp.

References MExceptions.

◆ getExclusiveQueueHandleRef()

sycl::detail::pi::PiQueue& sycl::_V1::detail::queue_impl::getExclusiveQueueHandleRef ( )
inline
Returns
a raw PI handle for a free queue. The returned handle is not retained. It is caller responsibility to make sure queue is still alive.

Definition at line 581 of file queue_impl.hpp.

References createQueue(), getPlugin(), sycl::_V1::detail::MaxNumQueues, MMutex, MNextQueueIdx, MQueues, sycl::_V1::detail::Ordered, and piQueueFinish().

Referenced by getHandleRef().

◆ getExtendDependencyList()

const std::vector< event > & sycl::_V1::detail::queue_impl::getExtendDependencyList ( const std::vector< event > &  DepEvents,
std::vector< event > &  MutableVec,
std::unique_lock< std::mutex > &  QueueLock 
)

Definition at line 111 of file queue_impl.cpp.

References isInOrder(), MGraph, MGraphLastEventPtr, MLastEventPtr, and popExternalEvent().

Referenced by submitMemOpHelper().

◆ getHandleRef()

sycl::detail::pi::PiQueue& sycl::_V1::detail::queue_impl::getHandleRef ( )
inline
Returns
a raw PI queue handle. The returned handle is not retained. It is caller responsibility to make sure queue is still alive.

Definition at line 612 of file queue_impl.hpp.

References getExclusiveQueueHandleRef(), MEmulateOOO, and MQueues.

Referenced by queue_impl(), and wait().

◆ getLastEvent()

event sycl::_V1::detail::queue_impl::getLastEvent ( )

◆ getNative()

pi_native_handle sycl::_V1::detail::queue_impl::getNative ( int32_t &  NativeHandleDesc) const

Gets the native handle of the SYCL queue.

Returns
a native handle.

Definition at line 540 of file queue_impl.cpp.

References getContextImplPtr(), getPlugin(), MQueues, sycl::_V1::opencl, piextQueueGetNativeHandle(), and piQueueRetain().

◆ getPlugin()

const PluginPtr& sycl::_V1::detail::queue_impl::getPlugin ( ) const
inline

◆ getQueueID()

unsigned long long sycl::_V1::detail::queue_impl::getQueueID ( )
inline

Definition at line 729 of file queue_impl.hpp.

References MQueueID.

◆ getThreadPool()

ThreadPool& sycl::_V1::detail::queue_impl::getThreadPool ( )
inline

◆ has_property()

template<typename propertyT >
bool sycl::_V1::detail::queue_impl::has_property ( ) const
inlinenoexcept
Returns
true if the queue was constructed with property specified by PropertyT.

Definition at line 621 of file queue_impl.hpp.

References sycl::_V1::property_list::has_property(), and MPropList.

Referenced by queue_impl().

◆ instrumentationEpilog()

void sycl::_V1::detail::queue_impl::instrumentationEpilog ( void *  TelementryEvent,
std::string &  Name,
int32_t  StreamID,
uint64_t  IId 
)
protected

Definition at line 453 of file queue_impl.cpp.

Referenced by wait().

◆ instrumentationProlog()

◆ is_host()

bool sycl::_V1::detail::queue_impl::is_host ( ) const
inline
Returns
true if this queue is a SYCL host queue.

Definition at line 371 of file queue_impl.hpp.

References MHostQueue.

Referenced by addEvent(), addSharedEvent(), ext_oneapi_empty(), instrumentationProlog(), queue_impl(), and wait().

◆ is_in_fusion_mode()

bool sycl::_V1::detail::queue_impl::is_in_fusion_mode ( )
inline

Check whether the queue is in fusion mode.

Returns
true if the queue is in fusion mode, false otherwise.

Definition at line 698 of file queue_impl.hpp.

References sycl::_V1::detail::Scheduler::getInstance(), and sycl::_V1::detail::Scheduler::isInFusionMode().

◆ isInOrder()

bool sycl::_V1::detail::queue_impl::isInOrder ( ) const
inline

Definition at line 378 of file queue_impl.hpp.

References MIsInorder.

Referenced by ext_oneapi_empty(), getExtendDependencyList(), and submitMemOpHelper().

◆ isProfilingFallback()

bool sycl::_V1::detail::queue_impl::isProfilingFallback ( )
inline

Definition at line 715 of file queue_impl.hpp.

References MFallbackProfiling.

◆ mem_advise()

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.

Parameters
Selfis a shared_ptr to this queue.
Ptris a USM pointer to the allocation.
Lengthis a number of bytes in the allocation.
Adviceis a device-defined advice for the specified allocation.
DepEventsis a vector of events that specifies the kernel dependencies.
Returns
an event representing advise operation.

Definition at line 219 of file queue_impl.cpp.

References sycl::_V1::detail::MemoryManager::advise_usm(), sycl::_V1::handler::mem_advise(), and submitMemOpHelper().

◆ memcpy()

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,
const code_location CodeLoc 
)

Copies data from one memory region to another, both pointed by USM pointers.

Parameters
Selfis a shared_ptr to this queue.
Destis a USM pointer to the destination memory.
Srcis a USM pointer to the source memory.
Countis a number of bytes to copy.
DepEventsis a vector of events that specifies the kernel dependencies.
Returns
an event representing copy operation.

Definition at line 180 of file queue_impl.cpp.

References sycl::_V1::detail::MemoryManager::copy_usm(), MDevice, sycl::_V1::handler::memcpy(), MQueueID, sycl::_V1::detail::report(), submitMemOpHelper(), and sycl::_V1::detail::SYCL_STREAM_NAME.

◆ memcpyFromDeviceGlobal()

event sycl::_V1::detail::queue_impl::memcpyFromDeviceGlobal ( const std::shared_ptr< queue_impl > &  Self,
void *  Dest,
const void *  DeviceGlobalPtr,
bool  IsDeviceImageScope,
size_t  NumBytes,
size_t  Offset,
const std::vector< event > &  DepEvents 
)

◆ memcpyToDeviceGlobal()

event sycl::_V1::detail::queue_impl::memcpyToDeviceGlobal ( const std::shared_ptr< queue_impl > &  Self,
void *  DeviceGlobalPtr,
const void *  Src,
bool  IsDeviceImageScope,
size_t  NumBytes,
size_t  Offset,
const std::vector< event > &  DepEvents 
)

◆ memset()

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.

Parameters
Selfis a shared_ptr to this queue.
Ptris a USM pointer to the memory to fill.
Valueis a value to be set. Value is cast as an unsigned char.
Countis a number of bytes to fill.
DepEventsis a vector of events that specifies the kernel dependencies.
Returns
an event representing fill operation.

Definition at line 133 of file queue_impl.cpp.

References sycl::_V1::detail::MemoryManager::fill_usm(), MDevice, sycl::_V1::handler::memset(), MQueueID, submitMemOpHelper(), and sycl::_V1::detail::SYCL_STREAM_NAME.

◆ popExternalEvent()

std::optional<event> sycl::_V1::detail::queue_impl::popExternalEvent ( )
inline

Definition at line 736 of file queue_impl.hpp.

References MInOrderExternalEvent, and MInOrderExternalEventMtx.

Referenced by finalizeHandler(), getExtendDependencyList(), and wait().

◆ registerStreamServiceEvent()

void sycl::_V1::detail::queue_impl::registerStreamServiceEvent ( const EventImplPtr Event)
inline

Definition at line 688 of file queue_impl.hpp.

References MStreamsServiceEvents, and MStreamsServiceEventsMutex.

◆ reportAsyncException()

void sycl::_V1::detail::queue_impl::reportAsyncException ( const std::exception_ptr &  ExceptionPtr)
inline

Puts exception to the list of asynchronous ecxeptions.

Parameters
ExceptionPtris a pointer to exception to be put.

Definition at line 674 of file queue_impl.hpp.

References MExceptions, and MMutex.

◆ setCommandGraph()

void sycl::_V1::detail::queue_impl::setCommandGraph ( std::shared_ptr< ext::oneapi::experimental::detail::graph_impl Graph)
inline

Definition at line 717 of file queue_impl.hpp.

References MGraph, MGraphLastEventPtr, and MMutex.

◆ setExternalEvent()

void sycl::_V1::detail::queue_impl::setExternalEvent ( const event Event)
inline

Definition at line 731 of file queue_impl.hpp.

References MInOrderExternalEvent, and MInOrderExternalEventMtx.

◆ submit() [1/2]

event sycl::_V1::detail::queue_impl::submit ( const std::function< void(handler &)> &  CGF,
const std::shared_ptr< queue_impl > &  Self,
const detail::code_location Loc,
const SubmitPostProcessF PostProcess = nullptr 
)
inline

Submits a command group function object to the queue, in order to be scheduled for execution on the device.

Parameters
CGFis a function object containing command group.
Selfis a shared_ptr to this queue.
Locis the code location of the submit call (default argument)
StoreAdditionalInfomakes additional info be stored in event_impl
Returns
a SYCL event object for the submitted command group.

Definition at line 429 of file queue_impl.hpp.

References discard_or_return(), and submit_impl().

◆ submit() [2/2]

event sycl::_V1::detail::queue_impl::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 
)
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.

Parameters
CGFis a function object containing command group.
Selfis a shared_ptr to this queue.
SecondQueueis a shared_ptr to the secondary queue.
Locis the code location of the submit call (default argument)
StoreAdditionalInfomakes additional info be stored in event_impl
Returns
a SYCL event object, which corresponds to the queue the command group is being enqueued on.

Definition at line 406 of file queue_impl.hpp.

References discard_or_return(), and submit_impl().

Referenced by submitWithHandler().

◆ submit_impl()

event sycl::_V1::detail::queue_impl::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 
)
inlineprotected

Performs command group submission to the queue.

Parameters
CGFis a function object containing command group.
Selfis a pointer to this queue.
PrimaryQueueis a pointer to the primary queue. This may be the same as Self.
SecondaryQueueis a pointer to the secondary queue. This may be the same as Self.
Locis the code location of the submit call (default argument)
Returns
a SYCL event representing submitted command group.

Definition at line 796 of file queue_impl.hpp.

References addEvent(), sycl::_V1::detail::string::c_str(), finalizeHandler(), sycl::_V1::detail::ProgramManager::getInstance(), sycl::_V1::invalid, sycl::_V1::detail::CG::Kernel, sycl::_V1::detail::ProgramManager::kernelUsesAssert(), sycl::_V1::make_error_code(), and MHostQueue.

Referenced by submit().

◆ submitMemOpHelper() [1/2]

template<typename HandlerFuncT , typename MemMngrFuncT , typename... MemMngrArgTs>
event sycl::_V1::detail::queue_impl::submitMemOpHelper ( const std::shared_ptr< queue_impl > &  Self,
const std::vector< event > &  DepEvents,
HandlerFuncT  HandlerFunc,
MemMngrFuncT  MemMngrFunc,
MemMngrArgTs...  MemOpArgs 
)
protected

Performs submission of a memory operation directly if scheduler can be bypassed, or with a handler otherwise.

Parameters
Selfis a shared_ptr to this queue.
DepEventsis a vector of dependencies of the operation.
HandlerFuncis a function that submits the operation with a handler.
MemMngrFuncis a function that forwards its arguments to the appropriate memory manager function.
MemMngrArgsare all the arguments that need to be passed to memory manager except the last three: dependencies, PI event and EventImplPtr are filled out by this helper.
Returns
an event representing the submitted operation.

Referenced by mem_advise(), memcpy(), memcpyFromDeviceGlobal(), memcpyToDeviceGlobal(), and memset().

◆ submitMemOpHelper() [2/2]

template<typename HandlerFuncT , typename MemOpFuncT , typename... MemOpArgTs>
event sycl::_V1::detail::queue_impl::submitMemOpHelper ( const std::shared_ptr< queue_impl > &  Self,
const std::vector< event > &  DepEvents,
HandlerFuncT  HandlerFunc,
MemOpFuncT  MemOpFunc,
MemOpArgTs...  MemOpArgs 
)

◆ submitWithHandler()

template<typename HandlerFuncT >
event sycl::_V1::detail::queue_impl::submitWithHandler ( const std::shared_ptr< queue_impl > &  Self,
const std::vector< event > &  DepEvents,
HandlerFuncT  HandlerFunc 
)
protected

Helper function for submitting a memory operation with a handler.

Parameters
Selfis a shared_ptr to this queue.
DepEventsis a vector of dependencies of the operation.
HandlerFuncis a function that submits the operation with a handler.

Definition at line 326 of file queue_impl.cpp.

References sycl::_V1::handler::depends_on(), and submit().

Referenced by submitMemOpHelper().

◆ supportsDiscardingPiEvents()

bool sycl::_V1::detail::queue_impl::supportsDiscardingPiEvents ( ) const
inline
Returns
true if this queue has discard_events support.

Definition at line 374 of file queue_impl.hpp.

References MSupportsDiscardingPiEvents.

◆ throw_asynchronous()

void sycl::_V1::detail::queue_impl::throw_asynchronous ( )
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 460 of file queue_impl.hpp.

References MAsyncHandler, MExceptions, MMutex, and sycl::_V1::exception_list::size().

Referenced by ~queue_impl().

◆ wait()

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.

Parameters
Locis the code location of the submit call (default argument)

Definition at line 472 of file queue_impl.cpp.

References getHandleRef(), getPlugin(), instrumentationEpilog(), instrumentationProlog(), sycl::_V1::invalid, is_host(), sycl::_V1::make_error_code(), MEmulateOOO, MEventsShared, MEventsWeak, MGraph, MMutex, MStreamsServiceEvents, MStreamsServiceEventsMutex, piQueueFinish(), popExternalEvent(), and sycl::_V1::detail::SYCL_STREAM_NAME.

◆ wait_and_throw()

void sycl::_V1::detail::queue_impl::wait_and_throw ( const detail::code_location Loc = {})
inline
Parameters
Locis the code location of the submit call (default argument)

Definition at line 448 of file queue_impl.hpp.

Friends And Related Function Documentation

◆ sycl::ext::oneapi::experimental::detail::node_impl

Definition at line 979 of file queue_impl.hpp.

Member Data Documentation

◆ MAsyncHandler

const async_handler sycl::_V1::detail::queue_impl::MAsyncHandler
protected

Definition at line 914 of file queue_impl.hpp.

Referenced by throw_asynchronous().

◆ MContext

const ContextImplPtr sycl::_V1::detail::queue_impl::MContext
protected

◆ MDevice

DeviceImplPtr sycl::_V1::detail::queue_impl::MDevice
protected

Definition at line 903 of file queue_impl.hpp.

Referenced by createQueue(), get_device(), getDeviceImplPtr(), memcpy(), memset(), and queue_impl().

◆ MDiscardEvents

const bool sycl::_V1::detail::queue_impl::MDiscardEvents

◆ MEmulateOOO

bool sycl::_V1::detail::queue_impl::MEmulateOOO = false
protected

Indicates that a native out-of-order queue could not be created and we need to emulate it with multiple native in-order queues.

Definition at line 925 of file queue_impl.hpp.

Referenced by addEvent(), addSharedEvent(), createQueue(), getHandleRef(), submitMemOpHelper(), and wait().

◆ MEventsShared

std::vector<event> sycl::_V1::detail::queue_impl::MEventsShared
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 912 of file queue_impl.hpp.

Referenced by addSharedEvent(), ext_oneapi_empty(), and wait().

◆ MEventsWeak

std::vector<std::weak_ptr<event_impl> > sycl::_V1::detail::queue_impl::MEventsWeak
protected

These events are tracked, but not owned, by the queue.

Definition at line 907 of file queue_impl.hpp.

Referenced by addEvent(), ext_oneapi_empty(), and wait().

◆ MExceptions

exception_list sycl::_V1::detail::queue_impl::MExceptions
protected

Definition at line 913 of file queue_impl.hpp.

Referenced by getExceptionList(), reportAsyncException(), and throw_asynchronous().

◆ MFallbackProfiling

bool sycl::_V1::detail::queue_impl::MFallbackProfiling = false
protected

Definition at line 951 of file queue_impl.hpp.

Referenced by isProfilingFallback(), and queue_impl().

◆ MGraph

std::weak_ptr<ext::oneapi::experimental::detail::graph_impl> sycl::_V1::detail::queue_impl::MGraph {}
protected

◆ MGraphLastEventPtr

EventImplPtr sycl::_V1::detail::queue_impl::MGraphLastEventPtr
protected

◆ MHostQueue

const bool sycl::_V1::detail::queue_impl::MHostQueue = false
protected

Definition at line 922 of file queue_impl.hpp.

Referenced by get(), is_host(), queue_impl(), submit_impl(), and ~queue_impl().

◆ MInOrderExternalEvent

std::optional<event> sycl::_V1::detail::queue_impl::MInOrderExternalEvent
protected

Definition at line 957 of file queue_impl.hpp.

Referenced by popExternalEvent(), and setExternalEvent().

◆ MInOrderExternalEventMtx

std::mutex sycl::_V1::detail::queue_impl::MInOrderExternalEventMtx
mutableprotected

Definition at line 958 of file queue_impl.hpp.

Referenced by popExternalEvent(), and setExternalEvent().

◆ MInstanceID

uint64_t sycl::_V1::detail::queue_impl::MInstanceID = 0
protected

The instance ID of the trace event for queue object.

Definition at line 948 of file queue_impl.hpp.

Referenced by queue_impl(), and ~queue_impl().

◆ MIsInorder

const bool sycl::_V1::detail::queue_impl::MIsInorder
protected

Definition at line 935 of file queue_impl.hpp.

Referenced by finalizeHandler(), isInOrder(), and queue_impl().

◆ MIsProfilingEnabled

const bool sycl::_V1::detail::queue_impl::MIsProfilingEnabled

Definition at line 963 of file queue_impl.hpp.

◆ MLastEventPtr

EventImplPtr sycl::_V1::detail::queue_impl::MLastEventPtr
protected

◆ MMutex

std::mutex sycl::_V1::detail::queue_impl::MMutex
mutableprotected

◆ MNextAvailableQueueID

std::atomic< unsigned long long > sycl::_V1::detail::queue_impl::MNextAvailableQueueID = 0
staticprotected

Definition at line 977 of file queue_impl.hpp.

◆ MNextQueueIdx

size_t sycl::_V1::detail::queue_impl::MNextQueueIdx = 0
protected

Iterator through MQueues.

Definition at line 920 of file queue_impl.hpp.

Referenced by getExclusiveQueueHandleRef().

◆ MPropList

const property_list sycl::_V1::detail::queue_impl::MPropList
protected

Definition at line 915 of file queue_impl.hpp.

Referenced by createQueue(), get_property(), and has_property().

◆ MQueueID

unsigned long long sycl::_V1::detail::queue_impl::MQueueID
protected

Definition at line 976 of file queue_impl.hpp.

Referenced by getQueueID(), memcpy(), memset(), and queue_impl().

◆ MQueues

std::vector<sycl::detail::pi::PiQueue> sycl::_V1::detail::queue_impl::MQueues
protected

List of queues created for FPGA device from a single SYCL queue.

Definition at line 918 of file queue_impl.hpp.

Referenced by ext_oneapi_empty(), get(), getExclusiveQueueHandleRef(), getHandleRef(), getNative(), queue_impl(), and ~queue_impl().

◆ MStreamID

uint8_t sycl::_V1::detail::queue_impl::MStreamID = 0
protected

The stream under which the traces are emitted from the queue object.

Definition at line 946 of file queue_impl.hpp.

Referenced by queue_impl(), and ~queue_impl().

◆ MStreamsServiceEvents

std::vector<EventImplPtr> sycl::_V1::detail::queue_impl::MStreamsServiceEvents
protected

Definition at line 937 of file queue_impl.hpp.

Referenced by registerStreamServiceEvent(), and wait().

◆ MStreamsServiceEventsMutex

std::mutex sycl::_V1::detail::queue_impl::MStreamsServiceEventsMutex
protected

Definition at line 938 of file queue_impl.hpp.

Referenced by registerStreamServiceEvent(), and wait().

◆ MSupportsDiscardingPiEvents

const bool sycl::_V1::detail::queue_impl::MSupportsDiscardingPiEvents
protected

Definition at line 970 of file queue_impl.hpp.

Referenced by submitMemOpHelper(), and supportsDiscardingPiEvents().

◆ MTraceEvent

void* sycl::_V1::detail::queue_impl::MTraceEvent = nullptr
protected

Definition at line 944 of file queue_impl.hpp.

Referenced by queue_impl(), and ~queue_impl().


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