DPC++ Runtime
Runtime libraries for oneAPI DPC++
commands.hpp
Go to the documentation of this file.
1 //==-------------- commands.hpp - SYCL standard header file ----------------==//
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 <atomic>
12 #include <cstdint>
13 #include <deque>
14 #include <memory>
15 #include <optional>
16 #include <set>
17 #include <unordered_set>
18 #include <vector>
19 
22 #include <CL/sycl/detail/cg.hpp>
23 #include <detail/event_impl.hpp>
25 
27 namespace sycl {
28 namespace detail {
29 
30 class queue_impl;
31 class event_impl;
32 class context_impl;
33 class DispatchHostTask;
34 
35 using QueueImplPtr = std::shared_ptr<detail::queue_impl>;
36 using EventImplPtr = std::shared_ptr<detail::event_impl>;
37 using ContextImplPtr = std::shared_ptr<detail::context_impl>;
38 using StreamImplPtr = std::shared_ptr<detail::stream_impl>;
39 
40 class Command;
41 class AllocaCommand;
42 class AllocaCommandBase;
43 class ReleaseCommand;
44 class ExecCGCommand;
45 class EmptyCommand;
46 
48 
51  enum ResultT {
55  SyclEnqueueFailed
56  };
57  EnqueueResultT(ResultT Result = SyclEnqueueSuccess, Command *Cmd = nullptr,
58  pi_int32 ErrCode = PI_SUCCESS)
59  : MResult(Result), MCmd(Cmd), MErrCode(ErrCode) {}
66 };
67 
69 struct DepDesc {
70  DepDesc(Command *DepCommand, const Requirement *Req,
71  AllocaCommandBase *AllocaCmd)
72  : MDepCommand(DepCommand), MDepRequirement(Req), MAllocaCmd(AllocaCmd) {}
73 
74  friend bool operator<(const DepDesc &Lhs, const DepDesc &Rhs) {
75  return std::tie(Lhs.MDepRequirement, Lhs.MDepCommand) <
77  }
78 
80  Command *MDepCommand = nullptr;
82  const Requirement *MDepRequirement = nullptr;
85  AllocaCommandBase *MAllocaCmd = nullptr;
86 };
87 
95 class Command {
96 public:
97  enum CommandType {
107  HOST_TASK
108  };
109 
110  Command(CommandType Type, QueueImplPtr Queue);
111 
115  [[nodiscard]] Command *addDep(DepDesc NewDep,
116  std::vector<Command *> &ToCleanUp);
117 
121  [[nodiscard]] Command *addDep(EventImplPtr Event,
122  std::vector<Command *> &ToCleanUp);
123 
124  void addUser(Command *NewUser) { MUsers.insert(NewUser); }
125 
127  CommandType getType() const { return MType; }
128 
136  virtual bool enqueue(EnqueueResultT &EnqueueResult, BlockingT Blocking,
137  std::vector<Command *> &ToCleanUp);
138 
139  bool isFinished();
140 
141  bool isSuccessfullyEnqueued() const {
142  return MEnqueueStatus == EnqueueResultT::SyclEnqueueSuccess;
143  }
144 
145  bool isEnqueueBlocked() const {
146  return MEnqueueStatus == EnqueueResultT::SyclEnqueueBlocked;
147  }
148 
149  const QueueImplPtr &getQueue() const { return MQueue; }
150 
151  const QueueImplPtr &getSubmittedQueue() const { return MSubmittedQueue; }
152 
153  const EventImplPtr &getEvent() const { return MEvent; }
154 
155  // Methods needed to support SYCL instrumentation
156 
158  void emitInstrumentationDataProxy();
160  virtual void emitInstrumentationData() = 0;
163  void resolveReleaseDependencies(std::set<Command *> &list);
165  void emitEdgeEventForCommandDependence(
166  Command *Cmd, void *ObjAddr, bool IsCommand,
167  std::optional<access::mode> AccMode = std::nullopt);
169  void emitEdgeEventForEventDependence(Command *Cmd, RT::PiEvent &EventAddr);
171  void emitEnqueuedEventSignal(RT::PiEvent &PiEventAddr);
176  uint64_t makeTraceEventProlog(void *MAddress);
179  void makeTraceEventEpilog();
181  void emitInstrumentation(uint16_t Type, const char *Txt = nullptr);
182 
183  // End Methods needed to support SYCL instrumentation
184 
185  virtual void printDot(std::ostream &Stream) const = 0;
186 
187  virtual const Requirement *getRequirement() const {
188  assert(false && "Internal Error. The command has no stored requirement");
189  return nullptr;
190  }
191 
192  virtual ~Command() { MEvent->cleanDepEventsThroughOneLevel(); }
193 
194  const char *getBlockReason() const;
195 
198  virtual const ContextImplPtr &getWorkerContext() const;
199 
202  virtual const QueueImplPtr &getWorkerQueue() const;
203 
205  virtual bool producesPiEvent() const;
206 
208  virtual bool supportsPostEnqueueCleanup() const;
209 
210 protected:
214 
217  std::vector<EventImplPtr> &MPreparedDepsEvents;
218  std::vector<EventImplPtr> &MPreparedHostDepsEvents;
219 
220  void waitForEvents(QueueImplPtr Queue, std::vector<EventImplPtr> &RawEvents,
221  RT::PiEvent &Event);
222 
223  void waitForPreparedHostEvents() const;
224 
236  [[nodiscard]] Command *processDepEvent(EventImplPtr DepEvent,
237  const DepDesc &Dep,
238  std::vector<Command *> &ToCleanUp);
239 
241  virtual pi_int32 enqueueImp() = 0;
242 
246  std::mutex MEnqueueMtx;
247 
248  friend class DispatchHostTask;
249 
250 public:
251  const std::vector<EventImplPtr> &getPreparedHostDepsEvents() const {
252  return MPreparedHostDepsEvents;
253  }
254 
256  std::vector<DepDesc> MDeps;
258  std::unordered_set<Command *> MUsers;
260  bool MIsBlockable = false;
262  unsigned MLeafCounter = 0;
263 
264  struct Marks {
266  bool MVisited = false;
268  bool MToBeDeleted = false;
269  };
272 
273  enum class BlockReason : int { HostAccessor = 0, HostTask };
274 
275  // Only have reasonable value while MIsBlockable is true
277 
279  std::atomic<EnqueueResultT::ResultT> MEnqueueStatus;
280 
281  // All member variable defined here are needed for the SYCL instrumentation
282  // layer. Do not guard these variables below with XPTI_ENABLE_INSTRUMENTATION
283  // to ensure we have the same object layout when the macro in the library and
284  // SYCL app are not the same.
285 
287  void *MTraceEvent = nullptr;
291  int32_t MStreamID = -1;
294  void *MAddress = nullptr;
296  std::string MAddressString;
298  std::string MCommandNodeType;
300  std::string MCommandName;
302  bool MTraceEventPrologComplete = false;
304  bool MFirstInstance = false;
306  uint64_t MInstanceID = 0;
307 
308  // This flag allows to control whether host event should be set complete
309  // after successfull enqueue of command. Event is considered as host event if
310  // either it's is_host() return true or there is no backend representation
311  // of event (i.e. getHandleRef() return reference to nullptr value).
312  // By default the flag is set to true due to most of host operations are
313  // synchronous. The only asynchronous operation currently is host-task.
314  bool MShouldCompleteEventIfPossible = true;
315 
318  bool MPostEnqueueCleanup = false;
319 };
320 
323 class EmptyCommand : public Command {
324 public:
325  EmptyCommand(QueueImplPtr Queue);
326 
327  void printDot(std::ostream &Stream) const final;
328  const Requirement *getRequirement() const final { return &MRequirements[0]; }
329  void addRequirement(Command *DepCmd, AllocaCommandBase *AllocaCmd,
330  const Requirement *Req);
331 
332  void emitInstrumentationData() override;
333 
334  bool producesPiEvent() const final;
335 
336 private:
337  pi_int32 enqueueImp() final;
338 
339  // Employing deque here as it allows to push_back/emplace_back without
340  // invalidation of pointer or reference to stored data item regardless of
341  // iterator invalidation.
342  std::deque<Requirement> MRequirements;
343 };
344 
347 class ReleaseCommand : public Command {
348 public:
349  ReleaseCommand(QueueImplPtr Queue, AllocaCommandBase *AllocaCmd);
350 
351  void printDot(std::ostream &Stream) const final;
352  void emitInstrumentationData() override;
353  bool producesPiEvent() const final;
354  bool supportsPostEnqueueCleanup() const final;
355 
356 private:
357  pi_int32 enqueueImp() final;
358 
360  AllocaCommandBase *MAllocaCmd = nullptr;
361 };
362 
364 class AllocaCommandBase : public Command {
365 public:
367  AllocaCommandBase *LinkedAllocaCmd);
368 
369  ReleaseCommand *getReleaseCmd() { return &MReleaseCmd; }
370 
371  SYCLMemObjI *getSYCLMemObj() const { return MRequirement.MSYCLMemObj; }
372 
373  virtual void *getMemAllocation() const = 0;
374 
375  const Requirement *getRequirement() const final { return &MRequirement; }
376 
377  void emitInstrumentationData() override;
378 
379  bool producesPiEvent() const final;
380 
381  bool supportsPostEnqueueCleanup() const final;
382 
383  void *MMemAllocation = nullptr;
384 
390  AllocaCommandBase *MLinkedAllocaCmd = nullptr;
392  bool MIsActive = true;
393 
396  bool MIsLeaderAlloca = true;
397 
398 protected:
399  Requirement MRequirement;
400  ReleaseCommand MReleaseCmd;
401 };
402 
406 public:
408  bool InitFromUserData = true,
409  AllocaCommandBase *LinkedAllocaCmd = nullptr);
410 
411  void *getMemAllocation() const final { return MMemAllocation; }
412  void printDot(std::ostream &Stream) const final;
413  void emitInstrumentationData() override;
414 
415 private:
416  pi_int32 enqueueImp() final;
417 
420  bool MInitFromUserData = false;
421 };
422 
425 public:
427  AllocaCommandBase *ParentAlloca,
428  std::vector<Command *> &ToEnqueue,
429  std::vector<Command *> &ToCleanUp);
430 
431  void *getMemAllocation() const final;
432  void printDot(std::ostream &Stream) const final;
433  AllocaCommandBase *getParentAlloca() { return MParentAlloca; }
434  void emitInstrumentationData() override;
435 
436 private:
437  pi_int32 enqueueImp() final;
438 
439  AllocaCommandBase *MParentAlloca = nullptr;
440 };
441 
443 class MapMemObject : public Command {
444 public:
445  MapMemObject(AllocaCommandBase *SrcAllocaCmd, Requirement Req, void **DstPtr,
446  QueueImplPtr Queue, access::mode MapMode);
447 
448  void printDot(std::ostream &Stream) const final;
449  const Requirement *getRequirement() const final { return &MSrcReq; }
450  void emitInstrumentationData() override;
451 
452 private:
453  pi_int32 enqueueImp() final;
454 
455  AllocaCommandBase *MSrcAllocaCmd = nullptr;
456  Requirement MSrcReq;
457  void **MDstPtr = nullptr;
458  access::mode MMapMode;
459 };
460 
462 class UnMapMemObject : public Command {
463 public:
464  UnMapMemObject(AllocaCommandBase *DstAllocaCmd, Requirement Req,
465  void **SrcPtr, QueueImplPtr Queue);
466 
467  void printDot(std::ostream &Stream) const final;
468  const Requirement *getRequirement() const final { return &MDstReq; }
469  void emitInstrumentationData() override;
470  bool producesPiEvent() const final;
471 
472 private:
473  pi_int32 enqueueImp() final;
474 
475  AllocaCommandBase *MDstAllocaCmd = nullptr;
476  Requirement MDstReq;
477  void **MSrcPtr = nullptr;
478 };
479 
482 class MemCpyCommand : public Command {
483 public:
484  MemCpyCommand(Requirement SrcReq, AllocaCommandBase *SrcAllocaCmd,
485  Requirement DstReq, AllocaCommandBase *DstAllocaCmd,
486  QueueImplPtr SrcQueue, QueueImplPtr DstQueue);
487 
488  void printDot(std::ostream &Stream) const final;
489  const Requirement *getRequirement() const final { return &MDstReq; }
490  void emitInstrumentationData() final;
491  const ContextImplPtr &getWorkerContext() const final;
492  const QueueImplPtr &getWorkerQueue() const final;
493  bool producesPiEvent() const final;
494 
495 private:
496  pi_int32 enqueueImp() final;
497 
498  QueueImplPtr MSrcQueue;
499  Requirement MSrcReq;
500  AllocaCommandBase *MSrcAllocaCmd = nullptr;
501  Requirement MDstReq;
502  AllocaCommandBase *MDstAllocaCmd = nullptr;
503 };
504 
507 class MemCpyCommandHost : public Command {
508 public:
509  MemCpyCommandHost(Requirement SrcReq, AllocaCommandBase *SrcAllocaCmd,
510  Requirement DstReq, void **DstPtr, QueueImplPtr SrcQueue,
511  QueueImplPtr DstQueue);
512 
513  void printDot(std::ostream &Stream) const final;
514  const Requirement *getRequirement() const final { return &MDstReq; }
515  void emitInstrumentationData() final;
516  const ContextImplPtr &getWorkerContext() const final;
517  const QueueImplPtr &getWorkerQueue() const final;
518 
519 private:
520  pi_int32 enqueueImp() final;
521 
522  QueueImplPtr MSrcQueue;
523  Requirement MSrcReq;
524  AllocaCommandBase *MSrcAllocaCmd = nullptr;
525  Requirement MDstReq;
526  void **MDstPtr = nullptr;
527 };
528 
530  const QueueImplPtr &Queue, NDRDescT &NDRDesc, std::vector<ArgDesc> &Args,
531  const std::shared_ptr<detail::kernel_bundle_impl> &KernelBundleImplPtr,
532  const std::shared_ptr<detail::kernel_impl> &MSyclKernel,
533  const std::string &KernelName, const detail::OSModuleHandle &OSModuleHandle,
534  std::vector<RT::PiEvent> &RawEvents, RT::PiEvent *OutEvent,
535  const std::function<void *(Requirement *Req)> &getMemAllocationFunc);
536 
539 class ExecCGCommand : public Command {
540 public:
541  ExecCGCommand(std::unique_ptr<detail::CG> CommandGroup, QueueImplPtr Queue);
542 
543  std::vector<StreamImplPtr> getStreams() const;
544  std::vector<std::shared_ptr<const void>> getAuxiliaryResources() const;
545 
546  void clearStreams();
547  void clearAuxiliaryResources();
548 
549  void printDot(std::ostream &Stream) const final;
550  void emitInstrumentationData() final;
551 
552  detail::CG &getCG() const { return *MCommandGroup; }
553 
554  // MEmptyCmd is only employed if this command refers to host-task.
555  // The mechanism of lookup for single EmptyCommand amongst users of
556  // host-task-representing command is unreliable. This unreliability roots in
557  // the cleanup process.
558  EmptyCommand *MEmptyCmd = nullptr;
559 
560  bool producesPiEvent() const final;
561 
562  bool supportsPostEnqueueCleanup() const final;
563 
564 private:
565  pi_int32 enqueueImp() final;
566 
567  AllocaCommandBase *getAllocaForReq(Requirement *Req);
568 
569  std::unique_ptr<detail::CG> MCommandGroup;
570 
571  friend class Command;
572 };
573 
575 public:
577  AllocaCommandBase *SrcAllocaCmd, void **DstPtr);
578 
579  void printDot(std::ostream &Stream) const final;
580  const Requirement *getRequirement() const final { return &MDstReq; }
581  void emitInstrumentationData() final;
582 
583 private:
584  pi_int32 enqueueImp() final;
585 
586  AllocaCommandBase *MSrcAllocaCmd = nullptr;
587  Requirement MDstReq;
588  void **MDstPtr = nullptr;
589 };
590 
591 } // namespace detail
592 } // namespace sycl
593 } // __SYCL_INLINE_NAMESPACE(cl)
cl::sycl::detail::NON_BLOCKING
@ NON_BLOCKING
Definition: commands.hpp:47
cl::sycl::detail::AllocaCommandBase::getReleaseCmd
ReleaseCommand * getReleaseCmd()
Definition: commands.hpp:369
cl::sycl::detail::Command::MEnqueueMtx
std::mutex MEnqueueMtx
Mutex used to protect enqueueing from race conditions.
Definition: commands.hpp:246
cl::sycl::detail::UnMapMemObject
The unmap command removes mapping of host memory onto device memory.
Definition: commands.hpp:462
event_impl.hpp
cl::sycl::detail::ExecCGCommand
The exec CG command enqueues execution of kernel or explicit memory operation.
Definition: commands.hpp:539
cl::sycl::detail::EnqueueResultT::SyclEnqueueReady
@ SyclEnqueueReady
Definition: commands.hpp:52
cl::sycl::detail::Command::MUsers
std::unordered_set< Command * > MUsers
Contains list of commands that depend on the command.
Definition: commands.hpp:258
cg.hpp
cl::sycl::detail::NDRDescT
Definition: cg_types.hpp:41
cl::sycl::detail::EnqueueResultT::MResult
ResultT MResult
Indicates the result of enqueueing.
Definition: commands.hpp:61
cl::sycl::detail::Command::BlockReason
BlockReason
Definition: commands.hpp:273
cl::sycl::detail::ContextImplPtr
std::shared_ptr< detail::context_impl > ContextImplPtr
Definition: memory_manager.hpp:31
cl::sycl::detail::CG
Base class for all types of command groups.
Definition: cg.hpp:144
cl::sycl::detail::Command::Marks
Definition: commands.hpp:264
cl::sycl::detail::EnqueueResultT::EnqueueResultT
EnqueueResultT(ResultT Result=SyclEnqueueSuccess, Command *Cmd=nullptr, pi_int32 ErrCode=PI_SUCCESS)
Definition: commands.hpp:57
cl::sycl::detail::BlockingT
BlockingT
Definition: commands.hpp:47
cl::sycl::detail::kernel_bundle_impl
Definition: kernel_bundle_impl.hpp:50
cl::sycl::detail::Command::getQueue
const QueueImplPtr & getQueue() const
Definition: commands.hpp:149
cl::sycl::detail::HostTask
Definition: cg_types.hpp:229
cl::sycl::detail::Command::MSubmittedQueue
QueueImplPtr MSubmittedQueue
Definition: commands.hpp:212
cl::sycl::detail::DepDesc::DepDesc
DepDesc(Command *DepCommand, const Requirement *Req, AllocaCommandBase *AllocaCmd)
Definition: commands.hpp:70
cl::sycl::detail::MemCpyCommandHost::getRequirement
const Requirement * getRequirement() const final
Definition: commands.hpp:514
cl::sycl::detail::Command::MEnqueueStatus
std::atomic< EnqueueResultT::ResultT > MEnqueueStatus
Describes the status of the command.
Definition: commands.hpp:279
cl::sycl::detail::Command::~Command
virtual ~Command()
Definition: commands.hpp:192
cl::sycl::detail::Command::MDeps
std::vector< DepDesc > MDeps
Contains list of dependencies(edges)
Definition: commands.hpp:256
cl::sycl::detail::AllocaSubBufCommand::getParentAlloca
AllocaCommandBase * getParentAlloca()
Definition: commands.hpp:433
cl::sycl::detail::MemCpyCommand
The mem copy command enqueues memory copy between two instances of memory object.
Definition: commands.hpp:482
cl::sycl::detail::Command::MCommandNodeType
std::string MCommandNodeType
Buffer to build the command node type.
Definition: commands.hpp:298
cl::sycl::detail::MapMemObject
The map command enqueues mapping of device memory onto host memory.
Definition: commands.hpp:443
cl::sycl::detail::Command::CommandType
CommandType
Definition: commands.hpp:97
cl::sycl::detail::enqueueImpKernel
pi_int32 enqueueImpKernel(const QueueImplPtr &Queue, NDRDescT &NDRDesc, std::vector< ArgDesc > &Args, const std::shared_ptr< detail::kernel_bundle_impl > &KernelBundleImplPtr, const std::shared_ptr< detail::kernel_impl > &MSyclKernel, const std::string &KernelName, const detail::OSModuleHandle &OSModuleHandle, std::vector< RT::PiEvent > &RawEvents, RT::PiEvent *OutEvent, const std::function< void *(Requirement *Req)> &getMemAllocationFunc)
Definition: commands.cpp:2108
cl::sycl::detail::Command::isSuccessfullyEnqueued
bool isSuccessfullyEnqueued() const
Definition: commands.hpp:141
cl::sycl::detail::EnqueueResultT::SyclEnqueueSuccess
@ SyclEnqueueSuccess
Definition: commands.hpp:53
cl::sycl::detail::KernelBundleImplPtr
std::shared_ptr< detail::kernel_bundle_impl > KernelBundleImplPtr
Definition: kernel_bundle.hpp:132
sycl
Definition: invoke_simd.hpp:68
cl::sycl::detail::kernel_impl
Definition: kernel_impl.hpp:34
access.hpp
cl::sycl::detail::Command::UNMAP_MEM_OBJ
@ UNMAP_MEM_OBJ
Definition: commands.hpp:104
cl::sycl::detail::EnqueueResultT::MCmd
Command * MCmd
Pointer to the command which failed to enqueue.
Definition: commands.hpp:63
cl::sycl::detail::Command::MPreparedHostDepsEvents
std::vector< EventImplPtr > & MPreparedHostDepsEvents
Definition: commands.hpp:218
cl::sycl::detail::Command::addUser
void addUser(Command *NewUser)
Definition: commands.hpp:124
cl::sycl::detail::Command::getSubmittedQueue
const QueueImplPtr & getSubmittedQueue() const
Definition: commands.hpp:151
cl::sycl::detail::Command::ALLOCA
@ ALLOCA
Definition: commands.hpp:100
cl::sycl::detail::Command::COPY_MEMORY
@ COPY_MEMORY
Definition: commands.hpp:99
cl::sycl::detail::EnqueueResultT
Result of command enqueueing.
Definition: commands.hpp:50
cl::sycl::detail::UnMapMemObject::getRequirement
const Requirement * getRequirement() const final
Definition: commands.hpp:468
cl::sycl::detail::Command::getRequirement
virtual const Requirement * getRequirement() const
Definition: commands.hpp:187
cl::sycl::detail::ExecCGCommand::getCG
detail::CG & getCG() const
Definition: commands.hpp:552
cl::sycl::detail::AccessorImplHost
Definition: accessor_impl.hpp:74
cl::sycl::detail::AllocaCommand::getMemAllocation
void * getMemAllocation() const final
Definition: commands.hpp:411
cl::sycl::detail::DepDesc::MDepRequirement
const Requirement * MDepRequirement
Requirement for the dependency.
Definition: commands.hpp:82
cl::sycl::detail::DepDesc
Dependency between two commands.
Definition: commands.hpp:69
cl::sycl::detail::StreamImplPtr
std::shared_ptr< detail::stream_impl > StreamImplPtr
Definition: commands.hpp:38
cl::sycl::detail::AllocaSubBufCommand
The AllocaSubBuf command enqueues creation of sub-buffer of memory object.
Definition: commands.hpp:424
cl::sycl::detail::Command::MCommandName
std::string MCommandName
Buffer to build the command end-user understandable name.
Definition: commands.hpp:300
cl::sycl::detail::MapMemObject::getRequirement
const Requirement * getRequirement() const final
Definition: commands.hpp:449
cl::sycl::detail::ArgDesc
Definition: cg_types.hpp:27
cl::sycl::detail::AllocaCommandBase::getSYCLMemObj
SYCLMemObjI * getSYCLMemObj() const
Definition: commands.hpp:371
cl::sycl::detail::Command::getType
CommandType getType() const
Definition: commands.hpp:127
cl::sycl::detail::EventImplPtr
std::shared_ptr< detail::event_impl > EventImplPtr
Definition: memory_manager.hpp:30
cl::sycl::detail::Command::MMarks
Marks MMarks
Used for marking the node during graph traversal.
Definition: commands.hpp:271
cl::sycl::detail::AllocaCommandBase
Base class for memory allocation commands.
Definition: commands.hpp:364
cl::sycl::detail::Command
The Command class represents some action that needs to be performed on one or more memory objects.
Definition: commands.hpp:95
cl::sycl::detail::Command::RUN_CG
@ RUN_CG
Definition: commands.hpp:98
cl
We provide new interfaces for matrix muliply in this patch:
Definition: access.hpp:13
cl::sycl::detail::pi::PiEvent
::pi_event PiEvent
Definition: pi.hpp:113
cl::sycl::detail::waitForEvents
static void waitForEvents(const std::vector< EventImplPtr > &Events)
Definition: memory_manager.cpp:113
cl::sycl::detail::Command::getPreparedHostDepsEvents
const std::vector< EventImplPtr > & getPreparedHostDepsEvents() const
Definition: commands.hpp:251
cl::sycl::detail::EnqueueResultT::SyclEnqueueBlocked
@ SyclEnqueueBlocked
Definition: commands.hpp:54
cl::sycl::detail::tie
auto tie(Ts &... Args)
Definition: tuple.hpp:40
cl::sycl::detail::Command::MAP_MEM_OBJ
@ MAP_MEM_OBJ
Definition: commands.hpp:103
cl::sycl::detail::EnqueueResultT::MErrCode
pi_int32 MErrCode
Error code which is set when enqueueing fails.
Definition: commands.hpp:65
program_manager.hpp
cl::sycl::detail::UpdateHostRequirementCommand
Definition: commands.hpp:574
accessor_impl.hpp
cl::sycl::detail::QueueImplPtr
std::shared_ptr< detail::queue_impl > QueueImplPtr
Definition: memory_manager.hpp:29
cl::sycl::detail::Command::MQueue
QueueImplPtr MQueue
Definition: commands.hpp:211
cl::sycl::detail::EnqueueResultT::ResultT
ResultT
Definition: commands.hpp:51
cl::sycl::detail::Command::MAddressString
std::string MAddressString
Buffer to build the address string.
Definition: commands.hpp:296
cl::sycl::detail::Command::UPDATE_REQUIREMENT
@ UPDATE_REQUIREMENT
Definition: commands.hpp:105
cl::sycl::detail::AllocaCommandBase::getRequirement
const Requirement * getRequirement() const final
Definition: commands.hpp:375
cl::sycl::detail::MemCpyCommand::getRequirement
const Requirement * getRequirement() const final
Definition: commands.hpp:489
cl::sycl::detail::OSModuleHandle
intptr_t OSModuleHandle
Uniquely identifies an operating system module (executable or a dynamic library)
Definition: os_util.hpp:48
cl::sycl::detail::Command::MType
CommandType MType
The type of the command.
Definition: commands.hpp:244
cl::sycl::detail::AllocaCommand
The alloca command enqueues allocation of instance of memory object on Host or underlying framework.
Definition: commands.hpp:405
cl::sycl::detail::DispatchHostTask
Definition: commands.cpp:224
cl::sycl::detail::Command::MBlockReason
BlockReason MBlockReason
Definition: commands.hpp:276
cl::sycl::detail::Command::MEvent
EventImplPtr MEvent
Definition: commands.hpp:213
cl::sycl::detail::EmptyCommand::getRequirement
const Requirement * getRequirement() const final
Definition: commands.hpp:328
cl::sycl::detail::Command::RELEASE
@ RELEASE
Definition: commands.hpp:102
std
Definition: accessor.hpp:2617
cl::sycl::detail::pi
Definition: backend_traits_opencl.hpp:193
_pi_event
PI Event mapping to CUevent.
Definition: pi_cuda.hpp:590
cl::sycl::detail::BLOCKING
@ BLOCKING
Definition: commands.hpp:47
cl::sycl::detail::DepDesc::MDepCommand
Command * MDepCommand
The actual dependency command.
Definition: commands.hpp:80
cl::sycl::detail::Command::EMPTY_TASK
@ EMPTY_TASK
Definition: commands.hpp:106
cl::sycl::detail::Command::getEvent
const EventImplPtr & getEvent() const
Definition: commands.hpp:153
cl::sycl::detail::Command::MPreparedDepsEvents
std::vector< EventImplPtr > & MPreparedDepsEvents
Dependency events prepared for waiting by backend.
Definition: commands.hpp:217
cl::sycl::access::mode
mode
Definition: access.hpp:28
cl::sycl::detail::ReleaseCommand
The release command enqueues release of a memory object instance allocated on Host or underlying fram...
Definition: commands.hpp:347
cl::sycl::detail::Command::ALLOCA_SUB_BUF
@ ALLOCA_SUB_BUF
Definition: commands.hpp:101
cl::sycl::detail::EmptyCommand
The empty command does nothing during enqueue.
Definition: commands.hpp:323
cl::sycl::detail::SYCLMemObjI
Definition: sycl_mem_obj_i.hpp:28
cl::sycl::detail::DepDesc::operator<
friend bool operator<(const DepDesc &Lhs, const DepDesc &Rhs)
Definition: commands.hpp:74
pi_int32
int32_t pi_int32
Definition: pi.h:93
cl::sycl::detail::UpdateHostRequirementCommand::getRequirement
const Requirement * getRequirement() const final
Definition: commands.hpp:580
cl::sycl::detail::Command::isEnqueueBlocked
bool isEnqueueBlocked() const
Definition: commands.hpp:145
__SYCL_INLINE_NAMESPACE
#define __SYCL_INLINE_NAMESPACE(X)
Definition: defines_elementary.hpp:12
cl::sycl::detail::MemCpyCommandHost
The mem copy host command enqueues memory copy between two instances of memory object.
Definition: commands.hpp:507