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