DPC++ Runtime
Runtime libraries for oneAPI DPC++
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  std::vector<std::shared_ptr<const void>> MAuxiliaryResources;
252 
253  CGExecKernel(NDRDescT NDRDesc, std::unique_ptr<HostKernelBase> HKernel,
254  std::shared_ptr<detail::kernel_impl> SyclKernel,
255  std::vector<std::vector<char>> ArgsStorage,
256  std::vector<detail::AccessorImplPtr> AccStorage,
257  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
258  std::vector<Requirement *> Requirements,
259  std::vector<detail::EventImplPtr> Events,
260  std::vector<ArgDesc> Args, std::string KernelName,
262  std::vector<std::shared_ptr<detail::stream_impl>> Streams,
263  std::vector<std::shared_ptr<const void>> AuxiliaryResources,
264  CGTYPE Type, detail::code_location loc = {})
265  : CG(Type, std::move(ArgsStorage), std::move(AccStorage),
266  std::move(SharedPtrStorage), std::move(Requirements),
267  std::move(Events), std::move(loc)),
268  MNDRDesc(std::move(NDRDesc)), MHostKernel(std::move(HKernel)),
269  MSyclKernel(std::move(SyclKernel)), MArgs(std::move(Args)),
270  MKernelName(std::move(KernelName)), MOSModuleHandle(OSModuleHandle),
271  MStreams(std::move(Streams)),
272  MAuxiliaryResources(std::move(AuxiliaryResources)) {
273  assert((getType() == RunOnHostIntel || getType() == Kernel) &&
274  "Wrong type of exec kernel CG.");
275  }
276 
277  std::vector<ArgDesc> getArguments() const { return MArgs; }
278  std::string getKernelName() const { return MKernelName; }
279  std::vector<std::shared_ptr<detail::stream_impl>> getStreams() const {
280  return MStreams;
281  }
282 
283  std::vector<std::shared_ptr<const void>> getAuxiliaryResources() const {
284  return MAuxiliaryResources;
285  }
286 
287  std::shared_ptr<detail::kernel_bundle_impl> getKernelBundle() {
288  const std::shared_ptr<std::vector<ExtendedMemberT>> &ExtendedMembers =
289  getExtendedMembers();
290  if (!ExtendedMembers)
291  return nullptr;
292  for (const ExtendedMemberT &EMember : *ExtendedMembers)
293  if (ExtendedMembersType::HANDLER_KERNEL_BUNDLE == EMember.MType)
294  return std::static_pointer_cast<detail::kernel_bundle_impl>(
295  EMember.MData);
296  return nullptr;
297  }
298 
299  void clearStreams() { MStreams.clear(); }
300  bool hasStreams() { return !MStreams.empty(); }
301 
302  void clearAuxiliaryResources() { MAuxiliaryResources.clear(); }
303  bool hasAuxiliaryResources() { return !MAuxiliaryResources.empty(); }
304 };
305 
307 class CGCopy : public CG {
308  void *MSrc;
309  void *MDst;
310 
311 public:
312  CGCopy(CGTYPE CopyType, void *Src, void *Dst,
313  std::vector<std::vector<char>> ArgsStorage,
314  std::vector<detail::AccessorImplPtr> AccStorage,
315  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
316  std::vector<Requirement *> Requirements,
317  std::vector<detail::EventImplPtr> Events,
318  detail::code_location loc = {})
319  : CG(CopyType, std::move(ArgsStorage), std::move(AccStorage),
320  std::move(SharedPtrStorage), std::move(Requirements),
321  std::move(Events), std::move(loc)),
322  MSrc(Src), MDst(Dst) {}
323  void *getSrc() { return MSrc; }
324  void *getDst() { return MDst; }
325 };
326 
328 class CGFill : public CG {
329 public:
330  std::vector<char> MPattern;
332 
333  CGFill(std::vector<char> Pattern, void *Ptr,
334  std::vector<std::vector<char>> ArgsStorage,
335  std::vector<detail::AccessorImplPtr> AccStorage,
336  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
337  std::vector<Requirement *> Requirements,
338  std::vector<detail::EventImplPtr> Events,
339  detail::code_location loc = {})
340  : CG(Fill, std::move(ArgsStorage), std::move(AccStorage),
341  std::move(SharedPtrStorage), std::move(Requirements),
342  std::move(Events), std::move(loc)),
343  MPattern(std::move(Pattern)), MPtr((Requirement *)Ptr) {}
344  Requirement *getReqToFill() { return MPtr; }
345 };
346 
348 class CGUpdateHost : public CG {
349  Requirement *MPtr;
350 
351 public:
352  CGUpdateHost(void *Ptr, std::vector<std::vector<char>> ArgsStorage,
353  std::vector<detail::AccessorImplPtr> AccStorage,
354  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
355  std::vector<Requirement *> Requirements,
356  std::vector<detail::EventImplPtr> Events,
357  detail::code_location loc = {})
358  : CG(UpdateHost, std::move(ArgsStorage), std::move(AccStorage),
359  std::move(SharedPtrStorage), std::move(Requirements),
360  std::move(Events), std::move(loc)),
361  MPtr((Requirement *)Ptr) {}
362 
363  Requirement *getReqToUpdate() { return MPtr; }
364 };
365 
367 class CGCopyUSM : public CG {
368  void *MSrc;
369  void *MDst;
370  size_t MLength;
371 
372 public:
373  CGCopyUSM(void *Src, void *Dst, size_t Length,
374  std::vector<std::vector<char>> ArgsStorage,
375  std::vector<detail::AccessorImplPtr> AccStorage,
376  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
377  std::vector<Requirement *> Requirements,
378  std::vector<detail::EventImplPtr> Events,
379  detail::code_location loc = {})
380  : CG(CopyUSM, std::move(ArgsStorage), std::move(AccStorage),
381  std::move(SharedPtrStorage), std::move(Requirements),
382  std::move(Events), std::move(loc)),
383  MSrc(Src), MDst(Dst), MLength(Length) {}
384 
385  void *getSrc() { return MSrc; }
386  void *getDst() { return MDst; }
387  size_t getLength() { return MLength; }
388 };
389 
391 class CGFillUSM : public CG {
392  std::vector<char> MPattern;
393  void *MDst;
394  size_t MLength;
395 
396 public:
397  CGFillUSM(std::vector<char> Pattern, void *DstPtr, size_t Length,
398  std::vector<std::vector<char>> ArgsStorage,
399  std::vector<detail::AccessorImplPtr> AccStorage,
400  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
401  std::vector<Requirement *> Requirements,
402  std::vector<detail::EventImplPtr> Events,
403  detail::code_location loc = {})
404  : CG(FillUSM, std::move(ArgsStorage), std::move(AccStorage),
405  std::move(SharedPtrStorage), std::move(Requirements),
406  std::move(Events), std::move(loc)),
407  MPattern(std::move(Pattern)), MDst(DstPtr), MLength(Length) {}
408  void *getDst() { return MDst; }
409  size_t getLength() { return MLength; }
410  int getFill() { return MPattern[0]; }
411 };
412 
414 class CGPrefetchUSM : public CG {
415  void *MDst;
416  size_t MLength;
417 
418 public:
419  CGPrefetchUSM(void *DstPtr, size_t Length,
420  std::vector<std::vector<char>> ArgsStorage,
421  std::vector<detail::AccessorImplPtr> AccStorage,
422  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
423  std::vector<Requirement *> Requirements,
424  std::vector<detail::EventImplPtr> Events,
425  detail::code_location loc = {})
426  : CG(PrefetchUSM, std::move(ArgsStorage), std::move(AccStorage),
427  std::move(SharedPtrStorage), std::move(Requirements),
428  std::move(Events), std::move(loc)),
429  MDst(DstPtr), MLength(Length) {}
430  void *getDst() { return MDst; }
431  size_t getLength() { return MLength; }
432 };
433 
435 class CGAdviseUSM : public CG {
436  void *MDst;
437  size_t MLength;
438 
439 public:
440  CGAdviseUSM(void *DstPtr, size_t Length,
441  std::vector<std::vector<char>> ArgsStorage,
442  std::vector<detail::AccessorImplPtr> AccStorage,
443  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
444  std::vector<Requirement *> Requirements,
445  std::vector<detail::EventImplPtr> Events, CGTYPE Type,
446  detail::code_location loc = {})
447  : CG(Type, std::move(ArgsStorage), std::move(AccStorage),
448  std::move(SharedPtrStorage), std::move(Requirements),
449  std::move(Events), std::move(loc)),
450  MDst(DstPtr), MLength(Length) {}
451  void *getDst() { return MDst; }
452  size_t getLength() { return MLength; }
453 
455  auto ExtendedMembers = getExtendedMembers();
456  if (!ExtendedMembers)
457  return PI_MEM_ADVICE_UNKNOWN;
458  for (const ExtendedMemberT &EM : *ExtendedMembers)
459  if ((ExtendedMembersType::HANDLER_MEM_ADVICE == EM.MType) && EM.MData)
460  return *std::static_pointer_cast<pi_mem_advice>(EM.MData);
461  return PI_MEM_ADVICE_UNKNOWN;
462  }
463 };
464 
465 class CGInteropTask : public CG {
466 public:
467  std::unique_ptr<InteropTask> MInteropTask;
468 
469  CGInteropTask(std::unique_ptr<InteropTask> InteropTask,
470  std::vector<std::vector<char>> ArgsStorage,
471  std::vector<detail::AccessorImplPtr> AccStorage,
472  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
473  std::vector<Requirement *> Requirements,
474  std::vector<detail::EventImplPtr> Events, CGTYPE Type,
475  detail::code_location loc = {})
476  : CG(Type, std::move(ArgsStorage), std::move(AccStorage),
477  std::move(SharedPtrStorage), std::move(Requirements),
478  std::move(Events), std::move(loc)),
479  MInteropTask(std::move(InteropTask)) {}
480 };
481 
482 class CGHostTask : public CG {
483 public:
484  std::unique_ptr<HostTask> MHostTask;
485  // queue for host-interop task
486  std::shared_ptr<detail::queue_impl> MQueue;
487  // context for host-interop task
488  std::shared_ptr<detail::context_impl> MContext;
489  std::vector<ArgDesc> MArgs;
490 
491  CGHostTask(std::unique_ptr<HostTask> HostTask,
492  std::shared_ptr<detail::queue_impl> Queue,
493  std::shared_ptr<detail::context_impl> Context,
494  std::vector<ArgDesc> Args,
495  std::vector<std::vector<char>> ArgsStorage,
496  std::vector<detail::AccessorImplPtr> AccStorage,
497  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
498  std::vector<Requirement *> Requirements,
499  std::vector<detail::EventImplPtr> Events, CGTYPE Type,
500  detail::code_location loc = {})
501  : CG(Type, std::move(ArgsStorage), std::move(AccStorage),
502  std::move(SharedPtrStorage), std::move(Requirements),
503  std::move(Events), std::move(loc)),
504  MHostTask(std::move(HostTask)), MQueue(Queue), MContext(Context),
505  MArgs(std::move(Args)) {}
506 };
507 
508 class CGBarrier : public CG {
509 public:
510  std::vector<detail::EventImplPtr> MEventsWaitWithBarrier;
511 
512  CGBarrier(std::vector<detail::EventImplPtr> EventsWaitWithBarrier,
513  std::vector<std::vector<char>> ArgsStorage,
514  std::vector<detail::AccessorImplPtr> AccStorage,
515  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
516  std::vector<Requirement *> Requirements,
517  std::vector<detail::EventImplPtr> Events, CGTYPE Type,
518  detail::code_location loc = {})
519  : CG(Type, std::move(ArgsStorage), std::move(AccStorage),
520  std::move(SharedPtrStorage), std::move(Requirements),
521  std::move(Events), std::move(loc)),
522  MEventsWaitWithBarrier(std::move(EventsWaitWithBarrier)) {}
523 };
524 
525 } // namespace detail
526 } // namespace sycl
527 } // __SYCL_INLINE_NAMESPACE(cl)
cl::sycl::detail::stream_impl
Definition: stream_impl.hpp:25
cl::sycl::detail::CGCopyUSM::getLength
size_t getLength()
Definition: cg.hpp:387
cl::sycl::detail::ExtendedMembersType
ExtendedMembersType
Definition: cg.hpp:94
cl::sycl::detail::CGExecKernel::clearStreams
void clearStreams()
Definition: cg.hpp:299
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:491
type_traits.hpp
cl::sycl::detail::kernel_bundle_impl
Definition: kernel_bundle_impl.hpp:50
cl::sycl::detail::CGHostTask::MArgs
std::vector< ArgDesc > MArgs
Definition: cg.hpp:489
cl::sycl::detail::CGCopyUSM::getDst
void * getDst()
Definition: cg.hpp:386
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:328
cl::sycl::detail::CGUpdateHost::getReqToUpdate
Requirement * getReqToUpdate()
Definition: cg.hpp:363
cg_types.hpp
cl::sycl::detail::CGExecKernel::MKernelName
std::string MKernelName
Definition: cg.hpp:248
cl::sycl::detail::CGExecKernel::getAuxiliaryResources
std::vector< std::shared_ptr< const void > > getAuxiliaryResources() const
Definition: cg.hpp:283
cl::sycl::detail::CGBarrier::MEventsWaitWithBarrier
std::vector< detail::EventImplPtr > MEventsWaitWithBarrier
Definition: cg.hpp:510
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:469
_pi_mem_advice
_pi_mem_advice
Definition: pi.h:459
cl::sycl::detail::CG::CG_VERSION
CG_VERSION
Definition: cg.hpp:150
cl::sycl::detail::ExtendedMembersType::HANDLER_IMPL
@ HANDLER_IMPL
PI_MEM_ADVICE_UNKNOWN
@ PI_MEM_ADVICE_UNKNOWN
Definition: pi.h:461
helpers.hpp
sycl
Definition: invoke_simd.hpp:68
host_profiling_info.hpp
cl::sycl::detail::CGHostTask::MHostTask
std::unique_ptr< HostTask > MHostTask
Definition: cg.hpp:484
cl::sycl::detail::CGBarrier
Definition: cg.hpp:508
cl::sycl::detail::CGFill::getReqToFill
Requirement * getReqToFill()
Definition: cg.hpp:344
cl::sycl::detail::code_location
Definition: common.hpp:54
cl::sycl::detail::CGExecKernel::clearAuxiliaryResources
void clearAuxiliaryResources()
Definition: cg.hpp:302
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:229
group.hpp
cl::sycl::detail::CGExecKernel::hasAuxiliaryResources
bool hasAuxiliaryResources()
Definition: cg.hpp:303
id.hpp
cl::sycl::detail::CGPrefetchUSM::getDst
void * getDst()
Definition: cg.hpp:430
interop_handle.hpp
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, std::vector< std::shared_ptr< const void >> AuxiliaryResources, CGTYPE Type, detail::code_location loc={})
Definition: cg.hpp:253
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:397
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:435
cl::sycl::detail::CGCopy::getDst
void * getDst()
Definition: cg.hpp:324
cl::sycl::detail::AccessorImplHost
Definition: accessor_impl.hpp:74
cl::sycl::detail::CGExecKernel::getKernelBundle
std::shared_ptr< detail::kernel_bundle_impl > getKernelBundle()
Definition: cg.hpp:287
cl::sycl::detail::CGHostTask::MQueue
std::shared_ptr< detail::queue_impl > MQueue
Definition: cg.hpp:486
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:331
cl::sycl::detail::CGUpdateHost
"Update host" command group class.
Definition: cg.hpp:348
kernel.hpp
cl::sycl::detail::CGFill::MPattern
std::vector< char > MPattern
Definition: cg.hpp:330
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:333
cl::sycl::detail::CGFillUSM::getDst
void * getDst()
Definition: cg.hpp:408
range.hpp
cl::sycl::detail::CGHostTask::MContext
std::shared_ptr< detail::context_impl > MContext
Definition: cg.hpp:488
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:467
cl::sycl::detail::CGExecKernel::MOSModuleHandle
detail::OSModuleHandle MOSModuleHandle
Definition: cg.hpp:249
cl::sycl::detail::CGFillUSM
"Fill USM" command group class.
Definition: cg.hpp:391
cl::sycl::detail::CGCopy::getSrc
void * getSrc()
Definition: cg.hpp:323
cl::sycl::detail::CGHostTask
Definition: cg.hpp:482
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:307
cl::sycl::detail::CGExecKernel::hasStreams
bool hasStreams()
Definition: cg.hpp:300
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:452
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:419
cl::sycl::detail::CGPrefetchUSM
"Prefetch USM" command group class.
Definition: cg.hpp:414
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:352
cl::sycl::detail::queue_impl
Definition: queue_impl.hpp:54
accessor_impl.hpp
cl::sycl::detail::CGPrefetchUSM::getLength
size_t getLength()
Definition: cg.hpp:431
cl::sycl::detail::CGFillUSM::getLength
size_t getLength()
Definition: cg.hpp:409
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:440
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:373
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:512
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:367
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:451
cl::sycl::detail::CGExecKernel::getStreams
std::vector< std::shared_ptr< detail::stream_impl > > getStreams() const
Definition: cg.hpp:279
cl::sycl::detail::CGExecKernel::MAuxiliaryResources
std::vector< std::shared_ptr< const void > > MAuxiliaryResources
Definition: cg.hpp:251
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:312
cl::sycl::detail::CGExecKernel::getKernelName
std::string getKernelName() const
Definition: cg.hpp:278
cl::sycl::detail::CGFillUSM::getFill
int getFill()
Definition: cg.hpp:410
cl::sycl::detail::CGExecKernel::getArguments
std::vector< ArgDesc > getArguments() const
Definition: cg.hpp:277
cl::sycl::detail::CGCopyUSM::getSrc
void * getSrc()
Definition: cg.hpp:385
__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:454
cl::sycl::detail::CGInteropTask
Definition: cg.hpp:465
cl::sycl::detail::CG::getType
CGTYPE getType()
Definition: cg.hpp:197
interop_handler.hpp