DPC++ Runtime
Runtime libraries for oneAPI Data Parallel C++
cg.hpp
Go to the documentation of this file.
1 //==-------------- CG.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 <CL/sycl/accessor.hpp>
21 #include <CL/sycl/group.hpp>
22 #include <CL/sycl/id.hpp>
25 #include <CL/sycl/kernel.hpp>
26 #include <CL/sycl/nd_item.hpp>
27 #include <CL/sycl/range.hpp>
28 
29 #include <memory>
30 #include <string>
31 #include <type_traits>
32 #include <vector>
33 
35 namespace sycl {
36 
37 // Forward declarations
38 class queue;
39 
40 namespace detail {
41 
42 // Periodically there is a need to extend handler and CG classes to hold more
43 // data(members) than it has now. But any modification of the layout of those
44 // classes is an ABI break. To have an ability to have more data the following
45 // approach is implemented:
46 //
47 // Those classes have a member - MSharedPtrStorage which is an std::vector of
48 // std::shared_ptr's and is supposed to hold reference counters of user
49 // provided shared_ptr's.
50 //
51 // The first element of this vector is reused to store a vector of additional
52 // members handler and CG need to have.
53 //
54 // These additional arguments are represented using "ExtendedMemberT" structure
55 // which has a pointer to an arbitrary value and an integer which is used to
56 // understand how the value the pointer points to should be interpreted.
57 //
58 // ======== ======== ========
59 // | | | | ... | | std::vector<std::shared_ptr<void>>
60 // ======== ======== ========
61 // || || ||
62 // || \/ \/
63 // || user user
64 // || data data
65 // \/
66 // ======== ======== ========
67 // | Type | | Type | ... | Type | std::vector<ExtendedMemberT>
68 // | | | | | |
69 // | Ptr | | Ptr | ... | Ptr |
70 // ======== ======== ========
71 //
72 // Prior to this change this vector was supposed to have user's values only, so
73 // it is not legal to expect that the first argument is a special one.
74 // Versioning is implemented to overcome this problem - if the first element of
75 // the MSharedPtrStorage is a pointer to the special vector then CGType value
76 // has version "1" encoded.
77 //
78 // The version of CG type is encoded in the highest byte of the value:
79 //
80 // 0x00000001 - CG type KERNEL version 0
81 // 0x01000001 - CG type KERNEL version 1
82 // ^
83 // |
84 // The byte specifies the version
85 //
86 // A user of this vector should not expect that a specific data is stored at a
87 // specific position, but iterate over all looking for an ExtendedMemberT value
88 // with the desired type.
89 // This allows changing/extending the contents of this vector without changing
90 // the version.
91 //
92 
93 // Used to represent a type of an extended member
94 enum class ExtendedMembersType : unsigned int {
97  // handler_impl is stored in the exended members to avoid breaking ABI.
98  // TODO: This should be made a member of the handler class once ABI can be
99  // broken.
100  HANDLER_IMPL,
101 };
102 
103 // Holds a pointer to an object of an arbitrary type and an ID value which
104 // should be used to understand what type pointer points to.
105 // Used as to extend handler class without introducing new class members which
106 // would change handler layout.
109  std::shared_ptr<void> MData;
110 };
111 
112 static std::shared_ptr<std::vector<ExtendedMemberT>>
113 convertToExtendedMembers(const std::shared_ptr<const void> &SPtr) {
114  return std::const_pointer_cast<std::vector<ExtendedMemberT>>(
115  std::static_pointer_cast<const std::vector<ExtendedMemberT>>(SPtr));
116 }
117 
118 class stream_impl;
119 class queue_impl;
120 class kernel_bundle_impl;
121 
122 // The constant is used to left shift a CG type value to access it's version
123 constexpr unsigned int ShiftBitsForVersion = 24;
124 
125 // Constructs versioned type
126 constexpr unsigned int getVersionedCGType(unsigned int Type,
127  unsigned char Version) {
128  return Type | (static_cast<unsigned int>(Version) << ShiftBitsForVersion);
129 }
130 
131 // Returns the type without version encoded
132 constexpr unsigned char getUnversionedCGType(unsigned int Type) {
133  unsigned int Mask = -1;
134  Mask >>= (sizeof(Mask) * 8 - ShiftBitsForVersion);
135  return Type & Mask;
136 }
137 
138 // Returns the version encoded to the type
139 constexpr unsigned char getCGTypeVersion(unsigned int Type) {
140  return Type >> ShiftBitsForVersion;
141 }
142 
144 class CG {
145 public:
146  // Used to version CG and handler classes. Using unsigned char as the version
147  // is encoded in the highest byte of CGType value. So it is not possible to
148  // encode a value > 255 anyway which should be big enough room for version
149  // bumping.
150  enum class CG_VERSION : unsigned char {
151  V0 = 0,
152  V1 = 1,
153  };
154 
156  enum CGTYPE : unsigned int {
157  None = 0,
158  Kernel = 1,
159  CopyAccToPtr = 2,
160  CopyPtrToAcc = 3,
161  CopyAccToAcc = 4,
162  Barrier = 5,
163  BarrierWaitlist = 6,
164  Fill = 7,
165  UpdateHost = 8,
166  RunOnHostIntel = 9,
167  CopyUSM = 10,
168  FillUSM = 11,
169  PrefetchUSM = 12,
170  CodeplayInteropTask = 13,
171  CodeplayHostTask = 14,
172  AdviseUSM = 15,
173  };
174 
175  CG(CGTYPE Type, std::vector<std::vector<char>> ArgsStorage,
176  std::vector<detail::AccessorImplPtr> AccStorage,
177  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
178  std::vector<Requirement *> Requirements,
179  std::vector<detail::EventImplPtr> Events, detail::code_location loc = {})
180  : MType(Type), MArgsStorage(std::move(ArgsStorage)),
181  MAccStorage(std::move(AccStorage)),
182  MSharedPtrStorage(std::move(SharedPtrStorage)),
183  MRequirements(std::move(Requirements)), MEvents(std::move(Events)) {
184  // Capture the user code-location from Q.submit(), Q.parallel_for()
185  // etc for later use; if code location information is not available,
186  // the file name and function name members will be empty strings
187  if (loc.functionName())
188  MFunctionName = loc.functionName();
189  if (loc.fileName())
190  MFileName = loc.fileName();
191  MLine = loc.lineNumber();
192  MColumn = loc.columnNumber();
193  }
194 
195  CG(CG &&CommandGroup) = default;
196 
197  CGTYPE getType() { return static_cast<CGTYPE>(getUnversionedCGType(MType)); }
198 
200  return static_cast<CG_VERSION>(getCGTypeVersion(MType));
201  }
202 
203  std::shared_ptr<std::vector<ExtendedMemberT>> getExtendedMembers() {
204  if (getCGTypeVersion(MType) == static_cast<unsigned int>(CG_VERSION::V0) ||
205  MSharedPtrStorage.empty())
206  return nullptr;
207 
208  // The first value in shared_ptr storage is supposed to store a vector of
209  // extended members.
210  return convertToExtendedMembers(MSharedPtrStorage[0]);
211  }
212 
213  virtual ~CG() = default;
214 
215 private:
216  CGTYPE MType;
217  // The following storages are needed to ensure that arguments won't die while
218  // we are using them.
220  std::vector<std::vector<char>> MArgsStorage;
222  std::vector<detail::AccessorImplPtr> MAccStorage;
224  std::vector<std::shared_ptr<const void>> MSharedPtrStorage;
225 
226 public:
229  std::vector<Requirement *> MRequirements;
231  std::vector<detail::EventImplPtr> MEvents;
232  // Member variables to capture the user code-location
233  // information from Q.submit(), Q.parallel_for() etc
234  // Storage for function name and source file name
235  std::string MFunctionName, MFileName;
236  // Storage for line and column of code location
237  int32_t MLine, MColumn;
238 };
239 
241 class CGExecKernel : public CG {
242 public:
245  std::unique_ptr<HostKernelBase> MHostKernel;
246  std::shared_ptr<detail::kernel_impl> MSyclKernel;
247  std::vector<ArgDesc> MArgs;
248  std::string MKernelName;
250  std::vector<std::shared_ptr<detail::stream_impl>> MStreams;
251 
252  CGExecKernel(NDRDescT NDRDesc, std::unique_ptr<HostKernelBase> HKernel,
253  std::shared_ptr<detail::kernel_impl> SyclKernel,
254  std::vector<std::vector<char>> ArgsStorage,
255  std::vector<detail::AccessorImplPtr> AccStorage,
256  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
257  std::vector<Requirement *> Requirements,
258  std::vector<detail::EventImplPtr> Events,
259  std::vector<ArgDesc> Args, std::string KernelName,
261  std::vector<std::shared_ptr<detail::stream_impl>> Streams,
262  CGTYPE Type, detail::code_location loc = {})
263  : CG(Type, std::move(ArgsStorage), std::move(AccStorage),
264  std::move(SharedPtrStorage), std::move(Requirements),
265  std::move(Events), std::move(loc)),
266  MNDRDesc(std::move(NDRDesc)), MHostKernel(std::move(HKernel)),
267  MSyclKernel(std::move(SyclKernel)), MArgs(std::move(Args)),
268  MKernelName(std::move(KernelName)), MOSModuleHandle(OSModuleHandle),
269  MStreams(std::move(Streams)) {
270  assert((getType() == RunOnHostIntel || getType() == Kernel) &&
271  "Wrong type of exec kernel CG.");
272  }
273 
274  std::vector<ArgDesc> getArguments() const { return MArgs; }
275  std::string getKernelName() const { return MKernelName; }
276  std::vector<std::shared_ptr<detail::stream_impl>> getStreams() const {
277  return MStreams;
278  }
279 
280  std::shared_ptr<detail::kernel_bundle_impl> getKernelBundle() {
281  const std::shared_ptr<std::vector<ExtendedMemberT>> &ExtendedMembers =
282  getExtendedMembers();
283  if (!ExtendedMembers)
284  return nullptr;
285  for (const ExtendedMemberT &EMember : *ExtendedMembers)
286  if (ExtendedMembersType::HANDLER_KERNEL_BUNDLE == EMember.MType)
287  return std::static_pointer_cast<detail::kernel_bundle_impl>(
288  EMember.MData);
289  return nullptr;
290  }
291 
292  void clearStreams() { MStreams.clear(); }
293 };
294 
296 class CGCopy : public CG {
297  void *MSrc;
298  void *MDst;
299 
300 public:
301  CGCopy(CGTYPE CopyType, void *Src, void *Dst,
302  std::vector<std::vector<char>> ArgsStorage,
303  std::vector<detail::AccessorImplPtr> AccStorage,
304  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
305  std::vector<Requirement *> Requirements,
306  std::vector<detail::EventImplPtr> Events,
307  detail::code_location loc = {})
308  : CG(CopyType, std::move(ArgsStorage), std::move(AccStorage),
309  std::move(SharedPtrStorage), std::move(Requirements),
310  std::move(Events), std::move(loc)),
311  MSrc(Src), MDst(Dst) {}
312  void *getSrc() { return MSrc; }
313  void *getDst() { return MDst; }
314 };
315 
317 class CGFill : public CG {
318 public:
319  std::vector<char> MPattern;
321 
322  CGFill(std::vector<char> Pattern, void *Ptr,
323  std::vector<std::vector<char>> ArgsStorage,
324  std::vector<detail::AccessorImplPtr> AccStorage,
325  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
326  std::vector<Requirement *> Requirements,
327  std::vector<detail::EventImplPtr> Events,
328  detail::code_location loc = {})
329  : CG(Fill, std::move(ArgsStorage), std::move(AccStorage),
330  std::move(SharedPtrStorage), std::move(Requirements),
331  std::move(Events), std::move(loc)),
332  MPattern(std::move(Pattern)), MPtr((Requirement *)Ptr) {}
333  Requirement *getReqToFill() { return MPtr; }
334 };
335 
337 class CGUpdateHost : public CG {
338  Requirement *MPtr;
339 
340 public:
341  CGUpdateHost(void *Ptr, std::vector<std::vector<char>> ArgsStorage,
342  std::vector<detail::AccessorImplPtr> AccStorage,
343  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
344  std::vector<Requirement *> Requirements,
345  std::vector<detail::EventImplPtr> Events,
346  detail::code_location loc = {})
347  : CG(UpdateHost, std::move(ArgsStorage), std::move(AccStorage),
348  std::move(SharedPtrStorage), std::move(Requirements),
349  std::move(Events), std::move(loc)),
350  MPtr((Requirement *)Ptr) {}
351 
352  Requirement *getReqToUpdate() { return MPtr; }
353 };
354 
356 class CGCopyUSM : public CG {
357  void *MSrc;
358  void *MDst;
359  size_t MLength;
360 
361 public:
362  CGCopyUSM(void *Src, void *Dst, size_t Length,
363  std::vector<std::vector<char>> ArgsStorage,
364  std::vector<detail::AccessorImplPtr> AccStorage,
365  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
366  std::vector<Requirement *> Requirements,
367  std::vector<detail::EventImplPtr> Events,
368  detail::code_location loc = {})
369  : CG(CopyUSM, std::move(ArgsStorage), std::move(AccStorage),
370  std::move(SharedPtrStorage), std::move(Requirements),
371  std::move(Events), std::move(loc)),
372  MSrc(Src), MDst(Dst), MLength(Length) {}
373 
374  void *getSrc() { return MSrc; }
375  void *getDst() { return MDst; }
376  size_t getLength() { return MLength; }
377 };
378 
380 class CGFillUSM : public CG {
381  std::vector<char> MPattern;
382  void *MDst;
383  size_t MLength;
384 
385 public:
386  CGFillUSM(std::vector<char> Pattern, void *DstPtr, size_t Length,
387  std::vector<std::vector<char>> ArgsStorage,
388  std::vector<detail::AccessorImplPtr> AccStorage,
389  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
390  std::vector<Requirement *> Requirements,
391  std::vector<detail::EventImplPtr> Events,
392  detail::code_location loc = {})
393  : CG(FillUSM, std::move(ArgsStorage), std::move(AccStorage),
394  std::move(SharedPtrStorage), std::move(Requirements),
395  std::move(Events), std::move(loc)),
396  MPattern(std::move(Pattern)), MDst(DstPtr), MLength(Length) {}
397  void *getDst() { return MDst; }
398  size_t getLength() { return MLength; }
399  int getFill() { return MPattern[0]; }
400 };
401 
403 class CGPrefetchUSM : public CG {
404  void *MDst;
405  size_t MLength;
406 
407 public:
408  CGPrefetchUSM(void *DstPtr, size_t Length,
409  std::vector<std::vector<char>> ArgsStorage,
410  std::vector<detail::AccessorImplPtr> AccStorage,
411  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
412  std::vector<Requirement *> Requirements,
413  std::vector<detail::EventImplPtr> Events,
414  detail::code_location loc = {})
415  : CG(PrefetchUSM, std::move(ArgsStorage), std::move(AccStorage),
416  std::move(SharedPtrStorage), std::move(Requirements),
417  std::move(Events), std::move(loc)),
418  MDst(DstPtr), MLength(Length) {}
419  void *getDst() { return MDst; }
420  size_t getLength() { return MLength; }
421 };
422 
424 class CGAdviseUSM : public CG {
425  void *MDst;
426  size_t MLength;
427 
428 public:
429  CGAdviseUSM(void *DstPtr, size_t Length,
430  std::vector<std::vector<char>> ArgsStorage,
431  std::vector<detail::AccessorImplPtr> AccStorage,
432  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
433  std::vector<Requirement *> Requirements,
434  std::vector<detail::EventImplPtr> Events, CGTYPE Type,
435  detail::code_location loc = {})
436  : CG(Type, std::move(ArgsStorage), std::move(AccStorage),
437  std::move(SharedPtrStorage), std::move(Requirements),
438  std::move(Events), std::move(loc)),
439  MDst(DstPtr), MLength(Length) {}
440  void *getDst() { return MDst; }
441  size_t getLength() { return MLength; }
442 
444  auto ExtendedMembers = getExtendedMembers();
445  if (!ExtendedMembers)
446  return PI_MEM_ADVISE_UNKNOWN;
447  for (const ExtendedMemberT &EM : *ExtendedMembers)
448  if ((ExtendedMembersType::HANDLER_MEM_ADVICE == EM.MType) && EM.MData)
449  return *std::static_pointer_cast<pi_mem_advice>(EM.MData);
450  return PI_MEM_ADVISE_UNKNOWN;
451  }
452 };
453 
454 class CGInteropTask : public CG {
455 public:
456  std::unique_ptr<InteropTask> MInteropTask;
457 
458  CGInteropTask(std::unique_ptr<InteropTask> InteropTask,
459  std::vector<std::vector<char>> ArgsStorage,
460  std::vector<detail::AccessorImplPtr> AccStorage,
461  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
462  std::vector<Requirement *> Requirements,
463  std::vector<detail::EventImplPtr> Events, CGTYPE Type,
464  detail::code_location loc = {})
465  : CG(Type, std::move(ArgsStorage), std::move(AccStorage),
466  std::move(SharedPtrStorage), std::move(Requirements),
467  std::move(Events), std::move(loc)),
468  MInteropTask(std::move(InteropTask)) {}
469 };
470 
471 class CGHostTask : public CG {
472 public:
473  std::unique_ptr<HostTask> MHostTask;
474  // queue for host-interop task
475  std::shared_ptr<detail::queue_impl> MQueue;
476  // context for host-interop task
477  std::shared_ptr<detail::context_impl> MContext;
478  std::vector<ArgDesc> MArgs;
479 
480  CGHostTask(std::unique_ptr<HostTask> HostTask,
481  std::shared_ptr<detail::queue_impl> Queue,
482  std::shared_ptr<detail::context_impl> Context,
483  std::vector<ArgDesc> Args,
484  std::vector<std::vector<char>> ArgsStorage,
485  std::vector<detail::AccessorImplPtr> AccStorage,
486  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
487  std::vector<Requirement *> Requirements,
488  std::vector<detail::EventImplPtr> Events, CGTYPE Type,
489  detail::code_location loc = {})
490  : CG(Type, std::move(ArgsStorage), std::move(AccStorage),
491  std::move(SharedPtrStorage), std::move(Requirements),
492  std::move(Events), std::move(loc)),
493  MHostTask(std::move(HostTask)), MQueue(Queue), MContext(Context),
494  MArgs(std::move(Args)) {}
495 };
496 
497 class CGBarrier : public CG {
498 public:
499  std::vector<detail::EventImplPtr> MEventsWaitWithBarrier;
500 
501  CGBarrier(std::vector<detail::EventImplPtr> EventsWaitWithBarrier,
502  std::vector<std::vector<char>> ArgsStorage,
503  std::vector<detail::AccessorImplPtr> AccStorage,
504  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
505  std::vector<Requirement *> Requirements,
506  std::vector<detail::EventImplPtr> Events, CGTYPE Type,
507  detail::code_location loc = {})
508  : CG(Type, std::move(ArgsStorage), std::move(AccStorage),
509  std::move(SharedPtrStorage), std::move(Requirements),
510  std::move(Events), std::move(loc)),
511  MEventsWaitWithBarrier(std::move(EventsWaitWithBarrier)) {}
512 };
513 
514 } // namespace detail
515 } // namespace sycl
516 } // __SYCL_INLINE_NAMESPACE(cl)
cl::sycl::detail::stream_impl
Definition: stream_impl.hpp:24
cl::sycl::detail::CGCopyUSM::getLength
size_t getLength()
Definition: cg.hpp:376
cl::sycl::detail::ExtendedMembersType
ExtendedMembersType
Definition: cg.hpp:94
cl::sycl::detail::CGExecKernel::clearStreams
void clearStreams()
Definition: cg.hpp:292
cl::sycl::detail::CG::getVersion
CG_VERSION getVersion()
Definition: cg.hpp:199
cl::sycl::detail::NDRDescT
Definition: cg_types.hpp:41
cl::sycl::detail::CG
Base class for all types of command groups.
Definition: cg.hpp:144
cl::sycl::detail::CGExecKernel
"Execute kernel" command group class.
Definition: cg.hpp:241
cl::sycl::detail::CGHostTask::CGHostTask
CGHostTask(std::unique_ptr< HostTask > HostTask, std::shared_ptr< detail::queue_impl > Queue, std::shared_ptr< detail::context_impl > Context, std::vector< ArgDesc > Args, std::vector< std::vector< char >> ArgsStorage, std::vector< detail::AccessorImplPtr > AccStorage, std::vector< std::shared_ptr< const void >> SharedPtrStorage, std::vector< Requirement * > Requirements, std::vector< detail::EventImplPtr > Events, CGTYPE Type, detail::code_location loc={})
Definition: cg.hpp:480
type_traits.hpp
cl::sycl::detail::kernel_bundle_impl
Definition: kernel_bundle_impl.hpp:56
cl::sycl::detail::CGHostTask::MArgs
std::vector< ArgDesc > MArgs
Definition: cg.hpp:478
cl::sycl::detail::CGCopyUSM::getDst
void * getDst()
Definition: cg.hpp:375
cl::sycl::detail::HostTask
Definition: cg_types.hpp:229
cl::sycl::detail::ExtendedMemberT
Definition: cg.hpp:107
cl::sycl::detail::CGFill
"Fill memory" command group class.
Definition: cg.hpp:317
cl::sycl::detail::CGUpdateHost::getReqToUpdate
Requirement * getReqToUpdate()
Definition: cg.hpp:352
cg_types.hpp
cl::sycl::detail::CGExecKernel::MKernelName
std::string MKernelName
Definition: cg.hpp:248
cl::sycl::detail::CGBarrier::MEventsWaitWithBarrier
std::vector< detail::EventImplPtr > MEventsWaitWithBarrier
Definition: cg.hpp:499
cl::sycl::detail::getVersionedCGType
constexpr unsigned int getVersionedCGType(unsigned int Type, unsigned char Version)
Definition: cg.hpp:126
cl::sycl::detail::CGInteropTask::CGInteropTask
CGInteropTask(std::unique_ptr< InteropTask > InteropTask, std::vector< std::vector< char >> ArgsStorage, std::vector< detail::AccessorImplPtr > AccStorage, std::vector< std::shared_ptr< const void >> SharedPtrStorage, std::vector< Requirement * > Requirements, std::vector< detail::EventImplPtr > Events, CGTYPE Type, detail::code_location loc={})
Definition: cg.hpp:458
_pi_mem_advice
_pi_mem_advice
Definition: pi.h:441
cl::sycl::detail::CG::CG_VERSION
CG_VERSION
Definition: cg.hpp:150
cl::sycl::detail::ExtendedMembersType::HANDLER_IMPL
@ HANDLER_IMPL
PI_MEM_ADVISE_UNKNOWN
@ PI_MEM_ADVISE_UNKNOWN
Definition: pi.h:443
helpers.hpp
host_profiling_info.hpp
cl::sycl::detail::CGHostTask::MHostTask
std::unique_ptr< HostTask > MHostTask
Definition: cg.hpp:473
cl::sycl::detail::CGBarrier
Definition: cg.hpp:497
cl::sycl::detail::CGFill::getReqToFill
Requirement * getReqToFill()
Definition: cg.hpp:333
cl::sycl::detail::code_location
Definition: common.hpp:29
cl::sycl::detail::CG::MRequirements
std::vector< Requirement * > MRequirements
List of requirements that specify which memory is needed for the command group to be executed.
Definition: cg.hpp:229
cl::sycl::info::queue
queue
Definition: info_desc.hpp:219
group.hpp
id.hpp
cl::sycl::detail::CGPrefetchUSM::getDst
void * getDst()
Definition: cg.hpp:419
interop_handle.hpp
cl::sycl::detail::CGFillUSM::CGFillUSM
CGFillUSM(std::vector< char > Pattern, void *DstPtr, size_t Length, std::vector< std::vector< char >> ArgsStorage, std::vector< detail::AccessorImplPtr > AccStorage, std::vector< std::shared_ptr< const void >> SharedPtrStorage, std::vector< Requirement * > Requirements, std::vector< detail::EventImplPtr > Events, detail::code_location loc={})
Definition: cg.hpp:386
cl::sycl::detail::CG::CGTYPE
CGTYPE
Type of the command group.
Definition: cg.hpp:156
export.hpp
char
cl::sycl::detail::CGAdviseUSM
"Advise USM" command group class.
Definition: cg.hpp:424
cl::sycl::detail::CGCopy::getDst
void * getDst()
Definition: cg.hpp:313
cl::sycl::detail::AccessorImplHost
Definition: accessor_impl.hpp:76
cl::sycl::detail::CGExecKernel::getKernelBundle
std::shared_ptr< detail::kernel_bundle_impl > getKernelBundle()
Definition: cg.hpp:280
cl::sycl::detail::CGHostTask::MQueue
std::shared_ptr< detail::queue_impl > MQueue
Definition: cg.hpp:475
cl::sycl::detail::getCGTypeVersion
constexpr unsigned char getCGTypeVersion(unsigned int Type)
Definition: cg.hpp:139
cl::sycl::detail::CG::MLine
int32_t MLine
Definition: cg.hpp:237
cl::sycl::detail::CGFill::MPtr
Requirement * MPtr
Definition: cg.hpp:320
cl::sycl::detail::CGUpdateHost
"Update host" command group class.
Definition: cg.hpp:337
kernel.hpp
cl::sycl::detail::CGFill::MPattern
std::vector< char > MPattern
Definition: cg.hpp:319
cl::sycl::detail::CGFill::CGFill
CGFill(std::vector< char > Pattern, void *Ptr, std::vector< std::vector< char >> ArgsStorage, std::vector< detail::AccessorImplPtr > AccStorage, std::vector< std::shared_ptr< const void >> SharedPtrStorage, std::vector< Requirement * > Requirements, std::vector< detail::EventImplPtr > Events, detail::code_location loc={})
Definition: cg.hpp:322
cl::sycl::detail::CGFillUSM::getDst
void * getDst()
Definition: cg.hpp:397
range.hpp
cl::sycl::detail::CGHostTask::MContext
std::shared_ptr< detail::context_impl > MContext
Definition: cg.hpp:477
cl::sycl::detail::CGExecKernel::MNDRDesc
NDRDescT MNDRDesc
Stores ND-range description.
Definition: cg.hpp:244
cl::sycl::detail::CGInteropTask::MInteropTask
std::unique_ptr< InteropTask > MInteropTask
Definition: cg.hpp:456
cl::sycl::detail::CGExecKernel::MOSModuleHandle
detail::OSModuleHandle MOSModuleHandle
Definition: cg.hpp:249
cl::sycl::detail::CGFillUSM
"Fill USM" command group class.
Definition: cg.hpp:380
cl::sycl::detail::CGCopy::getSrc
void * getSrc()
Definition: cg.hpp:312
cl::sycl::detail::CGHostTask
Definition: cg.hpp:471
cl::sycl::detail::CGExecKernel::MArgs
std::vector< ArgDesc > MArgs
Definition: cg.hpp:247
cl::sycl::detail::CG::MFunctionName
std::string MFunctionName
Definition: cg.hpp:235
cl
We provide new interfaces for matrix muliply in this patch:
Definition: access.hpp:13
cl::sycl::detail::CGCopy
"Copy memory" command group class.
Definition: cg.hpp:296
cl::sycl::detail::CGExecKernel::MStreams
std::vector< std::shared_ptr< detail::stream_impl > > MStreams
Definition: cg.hpp:250
cl::sycl::detail::CGAdviseUSM::getLength
size_t getLength()
Definition: cg.hpp:441
cl::sycl::detail::CGPrefetchUSM::CGPrefetchUSM
CGPrefetchUSM(void *DstPtr, size_t Length, std::vector< std::vector< char >> ArgsStorage, std::vector< detail::AccessorImplPtr > AccStorage, std::vector< std::shared_ptr< const void >> SharedPtrStorage, std::vector< Requirement * > Requirements, std::vector< detail::EventImplPtr > Events, detail::code_location loc={})
Definition: cg.hpp:408
cl::sycl::detail::CGPrefetchUSM
"Prefetch USM" command group class.
Definition: cg.hpp:403
cl::sycl::detail::CG::CG
CG(CGTYPE Type, std::vector< std::vector< char >> ArgsStorage, std::vector< detail::AccessorImplPtr > AccStorage, std::vector< std::shared_ptr< const void >> SharedPtrStorage, std::vector< Requirement * > Requirements, std::vector< detail::EventImplPtr > Events, detail::code_location loc={})
Definition: cg.hpp:175
cl::sycl::detail::CGUpdateHost::CGUpdateHost
CGUpdateHost(void *Ptr, std::vector< std::vector< char >> ArgsStorage, std::vector< detail::AccessorImplPtr > AccStorage, std::vector< std::shared_ptr< const void >> SharedPtrStorage, std::vector< Requirement * > Requirements, std::vector< detail::EventImplPtr > Events, detail::code_location loc={})
Definition: cg.hpp:341
cl::sycl::detail::queue_impl
Definition: queue_impl.hpp:53
accessor_impl.hpp
cl::sycl::detail::CGPrefetchUSM::getLength
size_t getLength()
Definition: cg.hpp:420
cl::sycl::detail::CGFillUSM::getLength
size_t getLength()
Definition: cg.hpp:398
accessor.hpp
cl::sycl::detail::CG::getExtendedMembers
std::shared_ptr< std::vector< ExtendedMemberT > > getExtendedMembers()
Definition: cg.hpp:203
cl::sycl::detail::InteropTask
Definition: cg_types.hpp:220
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::CGExecKernel::MSyclKernel
std::shared_ptr< detail::kernel_impl > MSyclKernel
Definition: cg.hpp:246
cl::sycl::detail::ExtendedMemberT::MData
std::shared_ptr< void > MData
Definition: cg.hpp:109
cl::sycl::detail::ExtendedMembersType::HANDLER_KERNEL_BUNDLE
@ HANDLER_KERNEL_BUNDLE
cl::sycl::detail::CGAdviseUSM::CGAdviseUSM
CGAdviseUSM(void *DstPtr, size_t Length, std::vector< std::vector< char >> ArgsStorage, std::vector< detail::AccessorImplPtr > AccStorage, std::vector< std::shared_ptr< const void >> SharedPtrStorage, std::vector< Requirement * > Requirements, std::vector< detail::EventImplPtr > Events, CGTYPE Type, detail::code_location loc={})
Definition: cg.hpp:429
cl::sycl::detail::CGCopyUSM::CGCopyUSM
CGCopyUSM(void *Src, void *Dst, size_t Length, std::vector< std::vector< char >> ArgsStorage, std::vector< detail::AccessorImplPtr > AccStorage, std::vector< std::shared_ptr< const void >> SharedPtrStorage, std::vector< Requirement * > Requirements, std::vector< detail::EventImplPtr > Events, detail::code_location loc={})
Definition: cg.hpp:362
backend_types.hpp
cl::sycl::detail::CGBarrier::CGBarrier
CGBarrier(std::vector< detail::EventImplPtr > EventsWaitWithBarrier, std::vector< std::vector< char >> ArgsStorage, std::vector< detail::AccessorImplPtr > AccStorage, std::vector< std::shared_ptr< const void >> SharedPtrStorage, std::vector< Requirement * > Requirements, std::vector< detail::EventImplPtr > Events, CGTYPE Type, detail::code_location loc={})
Definition: cg.hpp:501
cl::sycl::detail::CGExecKernel::MHostKernel
std::unique_ptr< HostKernelBase > MHostKernel
Definition: cg.hpp:245
kernel_desc.hpp
cl::sycl::detail::CGCopyUSM
"Copy USM" command group class.
Definition: cg.hpp:356
cl::sycl::detail::CGExecKernel::CGExecKernel
CGExecKernel(NDRDescT NDRDesc, std::unique_ptr< HostKernelBase > HKernel, std::shared_ptr< detail::kernel_impl > SyclKernel, std::vector< std::vector< char >> ArgsStorage, std::vector< detail::AccessorImplPtr > AccStorage, std::vector< std::shared_ptr< const void >> SharedPtrStorage, std::vector< Requirement * > Requirements, std::vector< detail::EventImplPtr > Events, std::vector< ArgDesc > Args, std::string KernelName, detail::OSModuleHandle OSModuleHandle, std::vector< std::shared_ptr< detail::stream_impl >> Streams, CGTYPE Type, detail::code_location loc={})
Definition: cg.hpp:252
cl::sycl::detail::ExtendedMembersType::HANDLER_MEM_ADVICE
@ HANDLER_MEM_ADVICE
cl::sycl::detail::ShiftBitsForVersion
constexpr unsigned int ShiftBitsForVersion
Definition: cg.hpp:123
cl::sycl::detail::convertToExtendedMembers
static std::shared_ptr< std::vector< ExtendedMemberT > > convertToExtendedMembers(const std::shared_ptr< const void > &SPtr)
Definition: cg.hpp:113
cl::sycl::detail::CG::MEvents
std::vector< detail::EventImplPtr > MEvents
List of events that order the execution of this CG.
Definition: cg.hpp:231
cl::sycl::detail::getUnversionedCGType
constexpr unsigned char getUnversionedCGType(unsigned int Type)
Definition: cg.hpp:132
common.hpp
nd_item.hpp
cl::sycl::detail::ExtendedMemberT::MType
ExtendedMembersType MType
Definition: cg.hpp:108
cl::sycl::detail::CGAdviseUSM::getDst
void * getDst()
Definition: cg.hpp:440
cl::sycl::detail::CGExecKernel::getStreams
std::vector< std::shared_ptr< detail::stream_impl > > getStreams() const
Definition: cg.hpp:276
cl::sycl::detail::CGCopy::CGCopy
CGCopy(CGTYPE CopyType, void *Src, void *Dst, std::vector< std::vector< char >> ArgsStorage, std::vector< detail::AccessorImplPtr > AccStorage, std::vector< std::shared_ptr< const void >> SharedPtrStorage, std::vector< Requirement * > Requirements, std::vector< detail::EventImplPtr > Events, detail::code_location loc={})
Definition: cg.hpp:301
cl::sycl::detail::CGExecKernel::getKernelName
std::string getKernelName() const
Definition: cg.hpp:275
cl::sycl::detail::CGFillUSM::getFill
int getFill()
Definition: cg.hpp:399
cl::sycl::detail::CGExecKernel::getArguments
std::vector< ArgDesc > getArguments() const
Definition: cg.hpp:274
cl::sycl::detail::CGCopyUSM::getSrc
void * getSrc()
Definition: cg.hpp:374
__SYCL_INLINE_NAMESPACE
#define __SYCL_INLINE_NAMESPACE(X)
Definition: defines_elementary.hpp:12
cl::sycl::detail::CGAdviseUSM::getAdvice
pi_mem_advice getAdvice()
Definition: cg.hpp:443
cl::sycl::detail::CGInteropTask
Definition: cg.hpp:454
cl::sycl::detail::CG::getType
CGTYPE getType()
Definition: cg.hpp:197
interop_handler.hpp