DPC++ Runtime
Runtime libraries for oneAPI DPC++
queue_impl.hpp
Go to the documentation of this file.
1 //==------------------ queue_impl.hpp - SYCL queue -------------------------==//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #pragma once
10 
11 #include <detail/config.hpp>
12 #include <detail/context_impl.hpp>
13 #include <detail/device_impl.hpp>
14 #include <detail/event_impl.hpp>
16 #include <detail/kernel_impl.hpp>
17 #include <detail/plugin.hpp>
19 #include <detail/thread_pool.hpp>
20 #include <sycl/context.hpp>
23 #include <sycl/device.hpp>
24 #include <sycl/event.hpp>
25 #include <sycl/exception.hpp>
26 #include <sycl/exception_list.hpp>
27 #include <sycl/handler.hpp>
30 #include <sycl/property_list.hpp>
31 #include <sycl/stl.hpp>
32 
33 #include <utility>
34 
35 namespace sycl {
37 namespace detail {
38 
39 using ContextImplPtr = std::shared_ptr<detail::context_impl>;
40 using DeviceImplPtr = std::shared_ptr<detail::device_impl>;
41 
43 static constexpr size_t MaxNumQueues = 256;
44 
47 enum class CUDAContextT : char { primary, custom };
48 
50 constexpr CUDAContextT DefaultContextType = CUDAContextT::custom;
51 
53 
54 class queue_impl {
55 public:
56  // \return a default context for the platform if it includes the device
57  // passed and default contexts are enabled, a new context otherwise.
61  context{createSyclObjFromImpl<device>(Device), {}, {}});
62 
63  ContextImplPtr DefaultContext = detail::getSyclObjImpl(
64  Device->get_platform().ext_oneapi_get_default_context());
65  if (DefaultContext->isDeviceValid(Device))
66  return DefaultContext;
68  context{createSyclObjFromImpl<device>(Device), {}, {}});
69  }
77  queue_impl(const DeviceImplPtr &Device, const async_handler &AsyncHandler,
78  const property_list &PropList)
79  : queue_impl(Device, getDefaultOrNew(Device), AsyncHandler, PropList){};
80 
91  const async_handler &AsyncHandler, const property_list &PropList)
92  : MDevice(Device), MContext(Context), MAsyncHandler(AsyncHandler),
93  MPropList(PropList), MHostQueue(MDevice->is_host()),
94  MAssertHappenedBuffer(range<1>{1}),
95  MIsInorder(has_property<property::queue::in_order>()),
96  MDiscardEvents(
97  has_property<ext::oneapi::property::queue::discard_events>()),
98  MIsProfilingEnabled(has_property<property::queue::enable_profiling>()),
99  MHasDiscardEventsSupport(MDiscardEvents &&
100  (MHostQueue ? true : MIsInorder)) {
101  if (has_property<ext::oneapi::property::queue::discard_events>() &&
102  has_property<property::queue::enable_profiling>()) {
103  throw sycl::exception(make_error_code(errc::invalid),
104  "Queue cannot be constructed with both of "
105  "discard_events and enable_profiling.");
106  }
107  if (!Context->isDeviceValid(Device)) {
108  if (!Context->is_host() &&
109  Context->getPlugin().getBackend() == backend::opencl)
110  throw sycl::invalid_object_error(
111  "Queue cannot be constructed with the given context and device "
112  "since the device is not a member of the context (descendants of "
113  "devices from the context are not supported on OpenCL yet).",
114  PI_ERROR_INVALID_DEVICE);
115  throw sycl::invalid_object_error(
116  "Queue cannot be constructed with the given context and device "
117  "since the device is neither a member of the context nor a "
118  "descendant of its member.",
119  PI_ERROR_INVALID_DEVICE);
120  }
121  if (!MHostQueue) {
122  const QueueOrder QOrder =
123  MIsInorder ? QueueOrder::Ordered : QueueOrder::OOO;
124  MQueues.push_back(createQueue(QOrder));
125  }
126  }
127 
135  const async_handler &AsyncHandler)
136  : MContext(Context), MAsyncHandler(AsyncHandler), MPropList(),
137  MHostQueue(false), MAssertHappenedBuffer(range<1>{1}),
138  MIsInorder(has_property<property::queue::in_order>()),
139  MDiscardEvents(
140  has_property<ext::oneapi::property::queue::discard_events>()),
141  MIsProfilingEnabled(has_property<property::queue::enable_profiling>()),
142  MHasDiscardEventsSupport(MDiscardEvents &&
143  (MHostQueue ? true : MIsInorder)) {
144  if (has_property<ext::oneapi::property::queue::discard_events>() &&
145  has_property<property::queue::enable_profiling>()) {
146  throw sycl::exception(make_error_code(errc::invalid),
147  "Queue cannot be constructed with both of "
148  "discard_events and enable_profiling.");
149  }
150 
151  MQueues.push_back(pi::cast<RT::PiQueue>(PiQueue));
152 
153  RT::PiDevice DevicePI{};
154  const detail::plugin &Plugin = getPlugin();
155  // TODO catch an exception and put it to list of asynchronous exceptions
156  Plugin.call<PiApiKind::piQueueGetInfo>(
157  MQueues[0], PI_QUEUE_INFO_DEVICE, sizeof(DevicePI), &DevicePI, nullptr);
158  MDevice = MContext->findMatchingDeviceImpl(DevicePI);
159  if (MDevice == nullptr)
160  throw sycl::exception(
161  make_error_code(errc::invalid),
162  "Device provided by native Queue not found in Context.");
163  }
164 
166  throw_asynchronous();
167  if (!MHostQueue) {
169  }
170  }
171 
173  cl_command_queue get() {
174  if (MHostQueue) {
175  throw invalid_object_error(
176  "This instance of queue doesn't support OpenCL interoperability",
177  PI_ERROR_INVALID_QUEUE);
178  }
179  getPlugin().call<PiApiKind::piQueueRetain>(MQueues[0]);
180  return pi::cast<cl_command_queue>(MQueues[0]);
181  }
182 
185  return createSyclObjFromImpl<context>(MContext);
186  }
187 
188  const plugin &getPlugin() const { return MContext->getPlugin(); }
189 
190  const ContextImplPtr &getContextImplPtr() const { return MContext; }
191 
192  const DeviceImplPtr &getDeviceImplPtr() const { return MDevice; }
193 
195  device get_device() const { return createSyclObjFromImpl<device>(MDevice); }
196 
198  bool is_host() const { return MHostQueue; }
199 
201  bool has_discard_events_support() const { return MHasDiscardEventsSupport; }
202 
203  bool isInOrder() const { return MIsInorder; }
204 
208  template <typename Param> typename Param::return_type get_info() const;
209 
210  using SubmitPostProcessF = std::function<void(bool, bool, event &)>;
211 
225  event submit(const std::function<void(handler &)> &CGF,
226  const std::shared_ptr<queue_impl> &Self,
227  const std::shared_ptr<queue_impl> &SecondQueue,
228  const detail::code_location &Loc,
229  const SubmitPostProcessF *PostProcess = nullptr) {
230  try {
231  return submit_impl(CGF, Self, Self, SecondQueue, Loc, PostProcess);
232  } catch (...) {
233  return SecondQueue->submit_impl(CGF, SecondQueue, Self, SecondQueue, Loc,
234  PostProcess);
235  }
236  }
237 
246  event submit(const std::function<void(handler &)> &CGF,
247  const std::shared_ptr<queue_impl> &Self,
248  const detail::code_location &Loc,
249  const SubmitPostProcessF *PostProcess = nullptr) {
250  return submit_impl(CGF, Self, Self, nullptr, Loc, PostProcess);
251  }
252 
258  void wait(const detail::code_location &Loc = {});
259 
261  exception_list getExceptionList() const { return MExceptions; }
262 
264  void wait_and_throw(const detail::code_location &Loc = {}) {
265  wait(Loc);
266  throw_asynchronous();
267  }
268 
277  if (!MAsyncHandler)
278  return;
279 
280  exception_list Exceptions;
281  {
282  std::lock_guard<std::mutex> Lock(MMutex);
283  std::swap(Exceptions, MExceptions);
284  }
285  // Unlock the mutex before calling user-provided handler to avoid
286  // potential deadlock if the same queue is somehow referenced in the
287  // handler.
288  if (Exceptions.size())
289  MAsyncHandler(std::move(Exceptions));
290  }
291 
297  RT::PiQueueProperties CreationFlags = 0;
298 
299  if (Order == QueueOrder::OOO) {
301  }
302  if (MPropList.has_property<property::queue::enable_profiling>()) {
303  CreationFlags |= PI_QUEUE_PROFILING_ENABLE;
304  }
305  if (MPropList.has_property<
307  CreationFlags |= __SYCL_PI_CUDA_USE_DEFAULT_STREAM;
308  }
309  if (MPropList
310  .has_property<ext::oneapi::property::queue::discard_events>()) {
311  // Pass this flag to the Level Zero plugin to be able to check it from
312  // queue property.
313  CreationFlags |= PI_EXT_ONEAPI_QUEUE_DISCARD_EVENTS;
314  }
315  // Track that priority settings are not ambiguous.
316  bool PrioritySeen = false;
317  if (MPropList
318  .has_property<ext::oneapi::property::queue::priority_normal>()) {
319  // Normal is the default priority, don't pass anything.
320  PrioritySeen = true;
321  }
322  if (MPropList.has_property<ext::oneapi::property::queue::priority_low>()) {
323  if (PrioritySeen) {
324  throw sycl::exception(
325  make_error_code(errc::invalid),
326  "Queue cannot be constructed with different priorities.");
327  }
328  CreationFlags |= PI_EXT_ONEAPI_QUEUE_PRIORITY_LOW;
329  PrioritySeen = true;
330  }
331  if (MPropList.has_property<ext::oneapi::property::queue::priority_high>()) {
332  if (PrioritySeen) {
333  throw sycl::exception(
334  make_error_code(errc::invalid),
335  "Queue cannot be constructed with different priorities.");
336  }
337  CreationFlags |= PI_EXT_ONEAPI_QUEUE_PRIORITY_HIGH;
338  PrioritySeen = true;
339  }
340  RT::PiQueue Queue{};
341  RT::PiContext Context = MContext->getHandleRef();
342  RT::PiDevice Device = MDevice->getHandleRef();
343  const detail::plugin &Plugin = getPlugin();
344 
345  assert(Plugin.getBackend() == MDevice->getPlugin().getBackend());
347  Context, Device, CreationFlags, &Queue);
348 
349  // If creating out-of-order queue failed and this property is not
350  // supported (for example, on FPGA), it will return
351  // PI_ERROR_INVALID_QUEUE_PROPERTIES and will try to create in-order queue.
352  if (MSupportOOO && Error == PI_ERROR_INVALID_QUEUE_PROPERTIES) {
353  MSupportOOO = false;
354  Queue = createQueue(QueueOrder::Ordered);
355  } else {
356  Plugin.checkPiResult(Error);
357  }
358 
359  return Queue;
360  }
361 
365  RT::PiQueue *PIQ = nullptr;
366  bool ReuseQueue = false;
367  {
368  std::lock_guard<std::mutex> Lock(MMutex);
369 
370  // To achieve parallelism for FPGA with in order execution model with
371  // possibility of two kernels to share data with each other we shall
372  // create a queue for every kernel enqueued.
373  if (MQueues.size() < MaxNumQueues) {
374  MQueues.push_back({});
375  PIQ = &MQueues.back();
376  } else {
377  // If the limit of OpenCL queues is going to be exceeded - take the
378  // earliest used queue, wait until it finished and then reuse it.
379  PIQ = &MQueues[MNextQueueIdx];
380  MNextQueueIdx = (MNextQueueIdx + 1) % MaxNumQueues;
381  ReuseQueue = true;
382  }
383  }
384 
385  if (!ReuseQueue)
386  *PIQ = createQueue(QueueOrder::Ordered);
387  else
389 
390  return *PIQ;
391  }
392 
396  if (MSupportOOO)
397  return MQueues[0];
398 
399  return getExclusiveQueueHandleRef();
400  }
401 
404  template <typename propertyT> bool has_property() const noexcept {
405  return MPropList.has_property<propertyT>();
406  }
407 
411  template <typename propertyT> propertyT get_property() const {
412  return MPropList.get_property<propertyT>();
413  }
414 
424  event memset(const std::shared_ptr<queue_impl> &Self, void *Ptr, int Value,
425  size_t Count, const std::vector<event> &DepEvents);
436  event memcpy(const std::shared_ptr<queue_impl> &Self, void *Dest,
437  const void *Src, size_t Count,
438  const std::vector<event> &DepEvents);
449  event mem_advise(const std::shared_ptr<queue_impl> &Self, const void *Ptr,
450  size_t Length, pi_mem_advice Advice,
451  const std::vector<event> &DepEvents);
452 
456  void reportAsyncException(const std::exception_ptr &ExceptionPtr) {
457  std::lock_guard<std::mutex> Lock(MMutex);
458  MExceptions.PushBack(ExceptionPtr);
459  }
460 
462  return GlobalHandler::instance().getHostTaskThreadPool();
463  }
464 
468  pi_native_handle getNative() const;
469 
471  return MAssertHappenedBuffer;
472  }
473 
475  std::lock_guard<std::mutex> Lock(MMutex);
476  MStreamsServiceEvents.push_back(Event);
477  }
478 
479  bool ext_oneapi_empty() const;
480 
481 protected:
482  // template is needed for proper unit testing
483  template <typename HandlerType = handler>
484  void finalizeHandler(HandlerType &Handler, const CG::CGTYPE &Type,
485  event &EventRet) {
486  if (MIsInorder) {
487 
488  auto IsExpDepManaged = [](const CG::CGTYPE &Type) {
489  return (Type == CG::CGTYPE::CodeplayHostTask ||
490  Type == CG::CGTYPE::CodeplayInteropTask);
491  };
492 
493  // Accessing and changing of an event isn't atomic operation.
494  // Hence, here is the lock for thread-safety.
495  std::lock_guard<std::mutex> Lock{MLastEventMtx};
496 
497  if (MLastCGType == CG::CGTYPE::None)
498  MLastCGType = Type;
499  // Also handles case when sync model changes. E.g. Last is host, new is
500  // kernel.
501  bool NeedSeparateDependencyMgmt =
502  IsExpDepManaged(Type) || IsExpDepManaged(MLastCGType);
503 
504  if (NeedSeparateDependencyMgmt)
505  Handler.depends_on(MLastEvent);
506 
507  EventRet = Handler.finalize();
508 
509  MLastEvent = EventRet;
510  MLastCGType = Type;
511  } else
512  EventRet = Handler.finalize();
513  }
514 
515 protected:
526  event submit_impl(const std::function<void(handler &)> &CGF,
527  const std::shared_ptr<queue_impl> &Self,
528  const std::shared_ptr<queue_impl> &PrimaryQueue,
529  const std::shared_ptr<queue_impl> &SecondaryQueue,
530  const detail::code_location &Loc,
531  const SubmitPostProcessF *PostProcess) {
532  handler Handler(Self, PrimaryQueue, SecondaryQueue, MHostQueue);
533  Handler.saveCodeLoc(Loc);
534  CGF(Handler);
535 
536  // Scheduler will later omit events, that are not required to execute tasks.
537  // Host and interop tasks, however, are not submitted to low-level runtimes
538  // and require separate dependency management.
539  const CG::CGTYPE Type = Handler.getType();
540  event Event = detail::createSyclObjFromImpl<event>(
541  std::make_shared<detail::event_impl>());
542 
543  if (PostProcess) {
544  bool IsKernel = Type == CG::Kernel;
545  bool KernelUsesAssert = false;
546 
547  if (IsKernel)
548  // Kernel only uses assert if it's non interop one
549  KernelUsesAssert = !(Handler.MKernel && Handler.MKernel->isInterop()) &&
550  ProgramManager::getInstance().kernelUsesAssert(
551  Handler.MOSModuleHandle, Handler.MKernelName);
552 
553  finalizeHandler(Handler, Type, Event);
554 
555  (*PostProcess)(IsKernel, KernelUsesAssert, Event);
556  } else
557  finalizeHandler(Handler, Type, Event);
558 
559  addEvent(Event);
560  return Event;
561  }
562 
563  // When instrumentation is enabled emits trace event for wait begin and
564  // returns the telemetry event generated for the wait
565  void *instrumentationProlog(const detail::code_location &CodeLoc,
566  std::string &Name, int32_t StreamID,
567  uint64_t &iid);
568  // Uses events generated by the Prolog and emits wait done event
569  void instrumentationEpilog(void *TelementryEvent, std::string &Name,
570  int32_t StreamID, uint64_t IId);
571 
577  void addSharedEvent(const event &Event);
578 
582  void addEvent(const event &Event);
583 
585  mutable std::mutex MMutex;
586 
589 
591  std::vector<std::weak_ptr<event_impl>> MEventsWeak;
592 
596  std::vector<event> MEventsShared;
600 
602  std::vector<RT::PiQueue> MQueues;
604  size_t MNextQueueIdx = 0;
605 
606  const bool MHostQueue = false;
607  // Assume OOO support by default.
608  bool MSupportOOO = true;
609 
610  // Buffer to store assert failure descriptor
612 
613  // This event is employed for enhanced dependency tracking with in-order queue
614  // Access to the event should be guarded with MLastEventMtx
615  event MLastEvent;
616  mutable std::mutex MLastEventMtx;
617  // Used for in-order queues in pair with MLastEvent
618  // Host tasks are explicitly synchronized in RT, pi tasks - implicitly by
619  // backend. Using type to setup explicit sync between host and pi tasks.
620  CG::CGTYPE MLastCGType = CG::CGTYPE::None;
621 
622  const bool MIsInorder;
623 
624  std::vector<EventImplPtr> MStreamsServiceEvents;
625 
626 public:
627  // Queue constructed with the discard_events property
628  const bool MDiscardEvents;
630 
631 protected:
632  // This flag says if we can discard events based on a queue "setup" which will
633  // be common for all operations submitted to the queue. This is a must
634  // condition for discarding, but even if it's true, in some cases, we won't be
635  // able to discard events, because the final decision is made right before the
636  // operation itself.
638 };
639 
640 } // namespace detail
641 } // __SYCL_INLINE_VER_NAMESPACE(_V1)
642 } // namespace sycl
Defines a shared array that can be used by kernels in queues.
Definition: buffer.hpp:146
The context class represents a SYCL context on which kernel functions may be executed.
Definition: context.hpp:41
CGTYPE
Type of the command group.
Definition: cg.hpp:55
The plugin class provides a unified interface to the underlying low-level runtimes for the device-agn...
Definition: plugin.hpp:90
void call(ArgsT... Args) const
Calls the API, traces the call, checks the result.
Definition: plugin.hpp:217
backend getBackend(void) const
Definition: plugin.hpp:229
void checkPiResult(RT::PiResult pi_result) const
Checks return value from PI calls.
Definition: plugin.hpp:116
RT::PiResult call_nocheck(ArgsT... Args) const
Calls the PiApi, traces the call, and returns the result.
Definition: plugin.hpp:170
const plugin & getPlugin() const
Definition: queue_impl.hpp:188
const property_list MPropList
Definition: queue_impl.hpp:599
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 d...
Definition: queue_impl.hpp:225
std::vector< EventImplPtr > MStreamsServiceEvents
Definition: queue_impl.hpp:624
void wait_and_throw(const detail::code_location &Loc={})
Definition: queue_impl.hpp:264
Param::return_type get_info() const
Queries SYCL queue for information.
buffer< AssertHappened, 1 > MAssertHappenedBuffer
Definition: queue_impl.hpp:611
void registerStreamServiceEvent(const EventImplPtr &Event)
Definition: queue_impl.hpp:474
std::vector< std::weak_ptr< event_impl > > MEventsWeak
These events are tracked, but not owned, by the queue.
Definition: queue_impl.hpp:591
queue_impl(RT::PiQueue PiQueue, const ContextImplPtr &Context, const async_handler &AsyncHandler)
Constructs a SYCL queue from plugin interoperability handle.
Definition: queue_impl.hpp:134
bool has_property() const noexcept
Definition: queue_impl.hpp:404
RT::PiQueue & getExclusiveQueueHandleRef()
Definition: queue_impl.hpp:364
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 d...
Definition: queue_impl.hpp:246
std::vector< event > MEventsShared
Events without data dependencies (such as USM) need an owner, additionally, USM operations are not ad...
Definition: queue_impl.hpp:596
std::mutex MMutex
Protects all the fields that can be changed by class' methods.
Definition: queue_impl.hpp:585
std::vector< RT::PiQueue > MQueues
List of queues created for FPGA device from a single SYCL queue.
Definition: queue_impl.hpp:602
buffer< AssertHappened, 1 > & getAssertHappenedBuffer()
Definition: queue_impl.hpp:470
bool has_discard_events_support() const
Definition: queue_impl.hpp:201
std::function< void(bool, bool, event &)> SubmitPostProcessF
Definition: queue_impl.hpp:210
const ContextImplPtr MContext
Definition: queue_impl.hpp:588
void throw_asynchronous()
Performs a blocking wait for the completion of all enqueued tasks in the queue.
Definition: queue_impl.hpp:276
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.
Definition: queue_impl.hpp:90
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.
Definition: queue_impl.hpp:526
const DeviceImplPtr & getDeviceImplPtr() const
Definition: queue_impl.hpp:192
const async_handler MAsyncHandler
Definition: queue_impl.hpp:598
exception_list getExceptionList() const
Definition: queue_impl.hpp:261
void reportAsyncException(const std::exception_ptr &ExceptionPtr)
Puts exception to the list of asynchronous ecxeptions.
Definition: queue_impl.hpp:456
const ContextImplPtr & getContextImplPtr() const
Definition: queue_impl.hpp:190
void finalizeHandler(HandlerType &Handler, const CG::CGTYPE &Type, event &EventRet)
Definition: queue_impl.hpp:484
RT::PiQueue createQueue(QueueOrder Order)
Creates PI queue.
Definition: queue_impl.hpp:296
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.
Definition: queue_impl.hpp:77
static ContextImplPtr getDefaultOrNew(const DeviceImplPtr &Device)
Definition: queue_impl.hpp:58
propertyT get_property() const
Definition: queue_impl.hpp:411
The SYCL device class encapsulates a single SYCL device on which kernels may be executed.
Definition: device.hpp:49
An event object can be used to synchronize memory transfers, enqueues of kernels and signaling barrie...
Definition: event.hpp:40
A list of asynchronous exceptions.
Command group handler class.
Definition: handler.hpp:310
Objects of the property_list class are containers for the SYCL properties.
Defines the iteration domain of either a single work-group in a parallel dispatch,...
Definition: range.hpp:24
#define __SYCL_PI_CUDA_USE_DEFAULT_STREAM
#define __SYCL_INLINE_VER_NAMESPACE(X)
::pi_device PiDevice
Definition: pi.hpp:110
::pi_queue PiQueue
Definition: pi.hpp:117
const plugin & getPlugin()
Definition: pi.cpp:509
::pi_context PiContext
Definition: pi.hpp:114
::pi_queue_properties PiQueueProperties
Definition: pi.hpp:118
::pi_result PiResult
Definition: pi.hpp:108
void finalizeHandler(handler &CGH)
Definition: reduction.hpp:822
CUDAContextT
Possible CUDA context types supported by PI CUDA backend TODO: Implement this as a property once ther...
Definition: queue_impl.hpp:47
std::shared_ptr< sycl::detail::context_impl > ContextImplPtr
Definition: event_impl.hpp:30
decltype(Obj::impl) getSyclObjImpl(const Obj &SyclObject)
Definition: common.hpp:248
std::shared_ptr< event_impl > EventImplPtr
Definition: cg.hpp:42
std::shared_ptr< device_impl > DeviceImplPtr
static constexpr size_t MaxNumQueues
Sets max number of queues supported by FPGA RT.
Definition: queue_impl.hpp:43
void memcpy(void *Dst, const void *Src, std::size_t Size)
constexpr CUDAContextT DefaultContextType
Default context type created for CUDA backend.
Definition: queue_impl.hpp:50
std::function< void(sycl::exception_list)> async_handler
std::error_code make_error_code(sycl::errc E) noexcept
Constructs an error code using e and sycl_category()
Definition: exception.cpp:91
---— Error handling, matching OpenCL plugin semantics.
Definition: access.hpp:14
pi_result piQueueFinish(pi_queue command_queue)
constexpr pi_queue_properties PI_EXT_ONEAPI_QUEUE_PRIORITY_LOW
Definition: pi.h:590
uintptr_t pi_native_handle
Definition: pi.h:111
@ PI_QUEUE_INFO_DEVICE
Definition: pi.h:332
_pi_mem_advice
Definition: pi.h:429
constexpr pi_queue_properties PI_QUEUE_PROFILING_ENABLE
Definition: pi.h:586
pi_result piQueueRelease(pi_queue command_queue)
constexpr pi_queue_properties PI_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE
Definition: pi.h:585
constexpr pi_queue_properties PI_EXT_ONEAPI_QUEUE_DISCARD_EVENTS
Definition: pi.h:589
pi_result piQueueCreate(pi_context context, pi_device device, pi_queue_properties properties, pi_queue *queue)
constexpr pi_queue_properties PI_EXT_ONEAPI_QUEUE_PRIORITY_HIGH
Definition: pi.h:591
pi_result piQueueGetInfo(pi_queue command_queue, pi_queue_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
pi_result piQueueRetain(pi_queue command_queue)
@ Device