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 <sycl/accessor.hpp>
12 #include <sycl/backend_types.hpp>
13 #include <sycl/detail/cg_types.hpp>
14 #include <sycl/detail/common.hpp>
15 #include <sycl/detail/export.hpp>
16 #include <sycl/detail/helpers.hpp>
20 #include <sycl/group.hpp>
21 #include <sycl/id.hpp>
22 #include <sycl/interop_handle.hpp>
23 #include <sycl/interop_handler.hpp>
24 #include <sycl/kernel.hpp>
25 #include <sycl/nd_item.hpp>
26 #include <sycl/range.hpp>
27 
28 #include <memory>
29 #include <string>
30 #include <type_traits>
31 #include <vector>
32 
33 namespace sycl {
35 
36 // Forward declarations
37 class queue;
38 
39 namespace detail {
40 
41 class event_impl;
42 using EventImplPtr = std::shared_ptr<event_impl>;
43 
44 class stream_impl;
45 class queue_impl;
46 class kernel_bundle_impl;
47 
48 // If there's a need to add new members to CG classes without breaking ABI
49 // compatibility, we can bring back the extended members mechanism. See
50 // https://github.com/intel/llvm/pull/6759
52 class CG {
53 public:
55  enum CGTYPE : unsigned int {
56  None = 0,
57  Kernel = 1,
58  CopyAccToPtr = 2,
59  CopyPtrToAcc = 3,
60  CopyAccToAcc = 4,
61  Barrier = 5,
62  BarrierWaitlist = 6,
63  Fill = 7,
64  UpdateHost = 8,
65  RunOnHostIntel = 9,
66  CopyUSM = 10,
67  FillUSM = 11,
68  PrefetchUSM = 12,
69  CodeplayInteropTask = 13,
70  CodeplayHostTask = 14,
71  AdviseUSM = 15,
72  Copy2DUSM = 16,
73  Fill2DUSM = 17,
74  Memset2DUSM = 18,
75  CopyToDeviceGlobal = 19,
76  CopyFromDeviceGlobal = 20,
77  };
78 
79  CG(CGTYPE Type, std::vector<std::vector<char>> ArgsStorage,
80  std::vector<detail::AccessorImplPtr> AccStorage,
81  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
82  std::vector<AccessorImplHost *> Requirements,
83  std::vector<detail::EventImplPtr> Events, detail::code_location loc = {})
84  : MType(Type), MArgsStorage(std::move(ArgsStorage)),
85  MAccStorage(std::move(AccStorage)),
86  MSharedPtrStorage(std::move(SharedPtrStorage)),
87  MRequirements(std::move(Requirements)), MEvents(std::move(Events)) {
88  // Capture the user code-location from Q.submit(), Q.parallel_for()
89  // etc for later use; if code location information is not available,
90  // the file name and function name members will be empty strings
91  if (loc.functionName())
92  MFunctionName = loc.functionName();
93  if (loc.fileName())
94  MFileName = loc.fileName();
95  MLine = loc.lineNumber();
96  MColumn = loc.columnNumber();
97  }
98 
99  CG(CG &&CommandGroup) = default;
100 
101  CGTYPE getType() { return MType; }
102 
103  std::vector<std::vector<char>> &getArgsStorage() { return MArgsStorage; }
104 
105  std::vector<detail::AccessorImplPtr> &getAccStorage() { return MAccStorage; }
106 
107  virtual ~CG() = default;
108 
109 private:
110  CGTYPE MType;
111  // The following storages are needed to ensure that arguments won't die while
112  // we are using them.
114  std::vector<std::vector<char>> MArgsStorage;
116  std::vector<detail::AccessorImplPtr> MAccStorage;
118  std::vector<std::shared_ptr<const void>> MSharedPtrStorage;
119 
120 public:
123  std::vector<AccessorImplHost *> MRequirements;
125  std::vector<detail::EventImplPtr> MEvents;
126  // Member variables to capture the user code-location
127  // information from Q.submit(), Q.parallel_for() etc
128  // Storage for function name and source file name
129  std::string MFunctionName, MFileName;
130  // Storage for line and column of code location
131  int32_t MLine, MColumn;
132 };
133 
135 class CGExecKernel : public CG {
136 public:
139  std::unique_ptr<HostKernelBase> MHostKernel;
140  std::shared_ptr<detail::kernel_impl> MSyclKernel;
141  std::shared_ptr<detail::kernel_bundle_impl> MKernelBundle;
142  std::vector<ArgDesc> MArgs;
143  std::string MKernelName;
145  std::vector<std::shared_ptr<detail::stream_impl>> MStreams;
146  std::vector<std::shared_ptr<const void>> MAuxiliaryResources;
148 
149  CGExecKernel(NDRDescT NDRDesc, std::unique_ptr<HostKernelBase> HKernel,
150  std::shared_ptr<detail::kernel_impl> SyclKernel,
151  std::shared_ptr<detail::kernel_bundle_impl> KernelBundle,
152  std::vector<std::vector<char>> ArgsStorage,
153  std::vector<detail::AccessorImplPtr> AccStorage,
154  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
155  std::vector<AccessorImplHost *> Requirements,
156  std::vector<detail::EventImplPtr> Events,
157  std::vector<ArgDesc> Args, std::string KernelName,
159  std::vector<std::shared_ptr<detail::stream_impl>> Streams,
160  std::vector<std::shared_ptr<const void>> AuxiliaryResources,
161  CGTYPE Type, RT::PiKernelCacheConfig KernelCacheConfig,
162  detail::code_location loc = {})
163  : CG(Type, std::move(ArgsStorage), std::move(AccStorage),
164  std::move(SharedPtrStorage), std::move(Requirements),
165  std::move(Events), std::move(loc)),
166  MNDRDesc(std::move(NDRDesc)), MHostKernel(std::move(HKernel)),
167  MSyclKernel(std::move(SyclKernel)),
168  MKernelBundle(std::move(KernelBundle)), MArgs(std::move(Args)),
169  MKernelName(std::move(KernelName)), MOSModuleHandle(OSModuleHandle),
170  MStreams(std::move(Streams)),
171  MAuxiliaryResources(std::move(AuxiliaryResources)),
172  MKernelCacheConfig(std::move(KernelCacheConfig)) {
173  assert((getType() == RunOnHostIntel || getType() == Kernel) &&
174  "Wrong type of exec kernel CG.");
175  }
176 
177  std::vector<ArgDesc> getArguments() const { return MArgs; }
178  std::string getKernelName() const { return MKernelName; }
179  std::vector<std::shared_ptr<detail::stream_impl>> getStreams() const {
180  return MStreams;
181  }
182 
183  std::vector<std::shared_ptr<const void>> getAuxiliaryResources() const {
184  return MAuxiliaryResources;
185  }
186 
187  std::shared_ptr<detail::kernel_bundle_impl> getKernelBundle() {
188  return MKernelBundle;
189  }
190 
191  void clearStreams() { MStreams.clear(); }
192  bool hasStreams() { return !MStreams.empty(); }
193 
194  void clearAuxiliaryResources() { MAuxiliaryResources.clear(); }
195  bool hasAuxiliaryResources() { return !MAuxiliaryResources.empty(); }
196 };
197 
199 class CGCopy : public CG {
200  void *MSrc;
201  void *MDst;
202 
203 public:
204  CGCopy(CGTYPE CopyType, void *Src, void *Dst,
205  std::vector<std::vector<char>> ArgsStorage,
206  std::vector<detail::AccessorImplPtr> AccStorage,
207  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
208  std::vector<AccessorImplHost *> Requirements,
209  std::vector<detail::EventImplPtr> Events,
210  detail::code_location loc = {})
211  : CG(CopyType, std::move(ArgsStorage), std::move(AccStorage),
212  std::move(SharedPtrStorage), std::move(Requirements),
213  std::move(Events), std::move(loc)),
214  MSrc(Src), MDst(Dst) {}
215  void *getSrc() { return MSrc; }
216  void *getDst() { return MDst; }
217 };
218 
220 class CGFill : public CG {
221 public:
222  std::vector<char> MPattern;
224 
225  CGFill(std::vector<char> Pattern, void *Ptr,
226  std::vector<std::vector<char>> ArgsStorage,
227  std::vector<detail::AccessorImplPtr> AccStorage,
228  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
229  std::vector<AccessorImplHost *> Requirements,
230  std::vector<detail::EventImplPtr> Events,
231  detail::code_location loc = {})
232  : CG(Fill, std::move(ArgsStorage), std::move(AccStorage),
233  std::move(SharedPtrStorage), std::move(Requirements),
234  std::move(Events), std::move(loc)),
235  MPattern(std::move(Pattern)), MPtr((AccessorImplHost *)Ptr) {}
236  AccessorImplHost *getReqToFill() { return MPtr; }
237 };
238 
240 class CGUpdateHost : public CG {
241  AccessorImplHost *MPtr;
242 
243 public:
244  CGUpdateHost(void *Ptr, std::vector<std::vector<char>> ArgsStorage,
245  std::vector<detail::AccessorImplPtr> AccStorage,
246  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
247  std::vector<AccessorImplHost *> Requirements,
248  std::vector<detail::EventImplPtr> Events,
249  detail::code_location loc = {})
250  : CG(UpdateHost, std::move(ArgsStorage), std::move(AccStorage),
251  std::move(SharedPtrStorage), std::move(Requirements),
252  std::move(Events), std::move(loc)),
253  MPtr((AccessorImplHost *)Ptr) {}
254 
255  AccessorImplHost *getReqToUpdate() { return MPtr; }
256 };
257 
259 class CGCopyUSM : public CG {
260  void *MSrc;
261  void *MDst;
262  size_t MLength;
263 
264 public:
265  CGCopyUSM(void *Src, void *Dst, size_t Length,
266  std::vector<std::vector<char>> ArgsStorage,
267  std::vector<detail::AccessorImplPtr> AccStorage,
268  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
269  std::vector<AccessorImplHost *> Requirements,
270  std::vector<detail::EventImplPtr> Events,
271  detail::code_location loc = {})
272  : CG(CopyUSM, std::move(ArgsStorage), std::move(AccStorage),
273  std::move(SharedPtrStorage), std::move(Requirements),
274  std::move(Events), std::move(loc)),
275  MSrc(Src), MDst(Dst), MLength(Length) {}
276 
277  void *getSrc() { return MSrc; }
278  void *getDst() { return MDst; }
279  size_t getLength() { return MLength; }
280 };
281 
283 class CGFillUSM : public CG {
284  std::vector<char> MPattern;
285  void *MDst;
286  size_t MLength;
287 
288 public:
289  CGFillUSM(std::vector<char> Pattern, void *DstPtr, size_t Length,
290  std::vector<std::vector<char>> ArgsStorage,
291  std::vector<detail::AccessorImplPtr> AccStorage,
292  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
293  std::vector<AccessorImplHost *> Requirements,
294  std::vector<detail::EventImplPtr> Events,
295  detail::code_location loc = {})
296  : CG(FillUSM, std::move(ArgsStorage), std::move(AccStorage),
297  std::move(SharedPtrStorage), std::move(Requirements),
298  std::move(Events), std::move(loc)),
299  MPattern(std::move(Pattern)), MDst(DstPtr), MLength(Length) {}
300  void *getDst() { return MDst; }
301  size_t getLength() { return MLength; }
302  int getFill() { return MPattern[0]; }
303 };
304 
306 class CGPrefetchUSM : public CG {
307  void *MDst;
308  size_t MLength;
309 
310 public:
311  CGPrefetchUSM(void *DstPtr, size_t Length,
312  std::vector<std::vector<char>> ArgsStorage,
313  std::vector<detail::AccessorImplPtr> AccStorage,
314  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
315  std::vector<AccessorImplHost *> Requirements,
316  std::vector<detail::EventImplPtr> Events,
317  detail::code_location loc = {})
318  : CG(PrefetchUSM, std::move(ArgsStorage), std::move(AccStorage),
319  std::move(SharedPtrStorage), std::move(Requirements),
320  std::move(Events), std::move(loc)),
321  MDst(DstPtr), MLength(Length) {}
322  void *getDst() { return MDst; }
323  size_t getLength() { return MLength; }
324 };
325 
327 class CGAdviseUSM : public CG {
328  void *MDst;
329  size_t MLength;
330  pi_mem_advice MAdvice;
331 
332 public:
333  CGAdviseUSM(void *DstPtr, size_t Length, pi_mem_advice Advice,
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<AccessorImplHost *> Requirements,
338  std::vector<detail::EventImplPtr> Events, CGTYPE Type,
339  detail::code_location loc = {})
340  : CG(Type, std::move(ArgsStorage), std::move(AccStorage),
341  std::move(SharedPtrStorage), std::move(Requirements),
342  std::move(Events), std::move(loc)),
343  MDst(DstPtr), MLength(Length), MAdvice(Advice) {}
344  void *getDst() { return MDst; }
345  size_t getLength() { return MLength; }
346  pi_mem_advice getAdvice() { return MAdvice; }
347 };
348 
349 class CGInteropTask : public CG {
350 public:
351  std::unique_ptr<InteropTask> MInteropTask;
352 
353  CGInteropTask(std::unique_ptr<InteropTask> InteropTask,
354  std::vector<std::vector<char>> ArgsStorage,
355  std::vector<detail::AccessorImplPtr> AccStorage,
356  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
357  std::vector<AccessorImplHost *> Requirements,
358  std::vector<detail::EventImplPtr> Events, CGTYPE Type,
359  detail::code_location loc = {})
360  : CG(Type, std::move(ArgsStorage), std::move(AccStorage),
361  std::move(SharedPtrStorage), std::move(Requirements),
362  std::move(Events), std::move(loc)),
363  MInteropTask(std::move(InteropTask)) {}
364 };
365 
366 class CGHostTask : public CG {
367 public:
368  std::unique_ptr<HostTask> MHostTask;
369  // queue for host-interop task
370  std::shared_ptr<detail::queue_impl> MQueue;
371  // context for host-interop task
372  std::shared_ptr<detail::context_impl> MContext;
373  std::vector<ArgDesc> MArgs;
374 
375  CGHostTask(std::unique_ptr<HostTask> HostTask,
376  std::shared_ptr<detail::queue_impl> Queue,
377  std::shared_ptr<detail::context_impl> Context,
378  std::vector<ArgDesc> Args,
379  std::vector<std::vector<char>> ArgsStorage,
380  std::vector<detail::AccessorImplPtr> AccStorage,
381  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
382  std::vector<AccessorImplHost *> Requirements,
383  std::vector<detail::EventImplPtr> Events, CGTYPE Type,
384  detail::code_location loc = {})
385  : CG(Type, std::move(ArgsStorage), std::move(AccStorage),
386  std::move(SharedPtrStorage), std::move(Requirements),
387  std::move(Events), std::move(loc)),
388  MHostTask(std::move(HostTask)), MQueue(Queue), MContext(Context),
389  MArgs(std::move(Args)) {}
390 };
391 
392 class CGBarrier : public CG {
393 public:
394  std::vector<detail::EventImplPtr> MEventsWaitWithBarrier;
395 
396  CGBarrier(std::vector<detail::EventImplPtr> EventsWaitWithBarrier,
397  std::vector<std::vector<char>> ArgsStorage,
398  std::vector<detail::AccessorImplPtr> AccStorage,
399  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
400  std::vector<AccessorImplHost *> Requirements,
401  std::vector<detail::EventImplPtr> Events, CGTYPE Type,
402  detail::code_location loc = {})
403  : CG(Type, std::move(ArgsStorage), std::move(AccStorage),
404  std::move(SharedPtrStorage), std::move(Requirements),
405  std::move(Events), std::move(loc)),
406  MEventsWaitWithBarrier(std::move(EventsWaitWithBarrier)) {}
407 };
408 
410 class CGCopy2DUSM : public CG {
411  void *MSrc;
412  void *MDst;
413  size_t MSrcPitch;
414  size_t MDstPitch;
415  size_t MWidth;
416  size_t MHeight;
417 
418 public:
419  CGCopy2DUSM(void *Src, void *Dst, size_t SrcPitch, size_t DstPitch,
420  size_t Width, size_t Height,
421  std::vector<std::vector<char>> ArgsStorage,
422  std::vector<detail::AccessorImplPtr> AccStorage,
423  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
424  std::vector<AccessorImplHost *> Requirements,
425  std::vector<detail::EventImplPtr> Events,
426  detail::code_location loc = {})
427  : CG(Copy2DUSM, std::move(ArgsStorage), std::move(AccStorage),
428  std::move(SharedPtrStorage), std::move(Requirements),
429  std::move(Events), std::move(loc)),
430  MSrc(Src), MDst(Dst), MSrcPitch(SrcPitch), MDstPitch(DstPitch),
431  MWidth(Width), MHeight(Height) {}
432 
433  void *getSrc() const { return MSrc; }
434  void *getDst() const { return MDst; }
435  size_t getSrcPitch() const { return MSrcPitch; }
436  size_t getDstPitch() const { return MDstPitch; }
437  size_t getWidth() const { return MWidth; }
438  size_t getHeight() const { return MHeight; }
439 };
440 
442 class CGFill2DUSM : public CG {
443  std::vector<char> MPattern;
444  void *MDst;
445  size_t MPitch;
446  size_t MWidth;
447  size_t MHeight;
448 
449 public:
450  CGFill2DUSM(std::vector<char> Pattern, void *DstPtr, size_t Pitch,
451  size_t Width, size_t Height,
452  std::vector<std::vector<char>> ArgsStorage,
453  std::vector<detail::AccessorImplPtr> AccStorage,
454  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
455  std::vector<AccessorImplHost *> Requirements,
456  std::vector<detail::EventImplPtr> Events,
457  detail::code_location loc = {})
458  : CG(Fill2DUSM, std::move(ArgsStorage), std::move(AccStorage),
459  std::move(SharedPtrStorage), std::move(Requirements),
460  std::move(Events), std::move(loc)),
461  MPattern(std::move(Pattern)), MDst(DstPtr), MPitch(Pitch),
462  MWidth(Width), MHeight(Height) {}
463  void *getDst() const { return MDst; }
464  size_t getPitch() const { return MPitch; }
465  size_t getWidth() const { return MWidth; }
466  size_t getHeight() const { return MHeight; }
467  const std::vector<char> &getPattern() const { return MPattern; }
468 };
469 
471 class CGMemset2DUSM : public CG {
472  char MValue;
473  void *MDst;
474  size_t MPitch;
475  size_t MWidth;
476  size_t MHeight;
477 
478 public:
479  CGMemset2DUSM(char Value, void *DstPtr, size_t Pitch, size_t Width,
480  size_t Height, std::vector<std::vector<char>> ArgsStorage,
481  std::vector<detail::AccessorImplPtr> AccStorage,
482  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
483  std::vector<AccessorImplHost *> Requirements,
484  std::vector<detail::EventImplPtr> Events,
485  detail::code_location loc = {})
486  : CG(Memset2DUSM, std::move(ArgsStorage), std::move(AccStorage),
487  std::move(SharedPtrStorage), std::move(Requirements),
488  std::move(Events), std::move(loc)),
489  MValue(Value), MDst(DstPtr), MPitch(Pitch), MWidth(Width),
490  MHeight(Height) {}
491  void *getDst() const { return MDst; }
492  size_t getPitch() const { return MPitch; }
493  size_t getWidth() const { return MWidth; }
494  size_t getHeight() const { return MHeight; }
495  char getValue() const { return MValue; }
496 };
497 
499 class CGCopyToDeviceGlobal : public CG {
500  void *MSrc;
501  void *MDeviceGlobalPtr;
502  bool MIsDeviceImageScoped;
503  size_t MNumBytes;
504  size_t MOffset;
505  detail::OSModuleHandle MOSModuleHandle;
506 
507 public:
509  void *Src, void *DeviceGlobalPtr, bool IsDeviceImageScoped,
510  size_t NumBytes, size_t Offset,
511  std::vector<std::vector<char>> ArgsStorage,
512  std::vector<detail::AccessorImplPtr> AccStorage,
513  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
514  std::vector<AccessorImplHost *> Requirements,
515  std::vector<detail::EventImplPtr> Events,
517  : CG(CopyToDeviceGlobal, std::move(ArgsStorage), std::move(AccStorage),
518  std::move(SharedPtrStorage), std::move(Requirements),
519  std::move(Events), std::move(loc)),
520  MSrc(Src), MDeviceGlobalPtr(DeviceGlobalPtr),
521  MIsDeviceImageScoped(IsDeviceImageScoped), MNumBytes(NumBytes),
522  MOffset(Offset), MOSModuleHandle(OSModuleHandle) {}
523 
524  void *getSrc() { return MSrc; }
525  void *getDeviceGlobalPtr() { return MDeviceGlobalPtr; }
526  bool isDeviceImageScoped() { return MIsDeviceImageScoped; }
527  size_t getNumBytes() { return MNumBytes; }
528  size_t getOffset() { return MOffset; }
529  detail::OSModuleHandle getOSModuleHandle() { return MOSModuleHandle; }
530 };
531 
533 class CGCopyFromDeviceGlobal : public CG {
534  void *MDeviceGlobalPtr;
535  void *MDest;
536  bool MIsDeviceImageScoped;
537  size_t MNumBytes;
538  size_t MOffset;
539  detail::OSModuleHandle MOSModuleHandle;
540 
541 public:
543  void *DeviceGlobalPtr, void *Dest, bool IsDeviceImageScoped,
544  size_t NumBytes, size_t Offset,
545  std::vector<std::vector<char>> ArgsStorage,
546  std::vector<detail::AccessorImplPtr> AccStorage,
547  std::vector<std::shared_ptr<const void>> SharedPtrStorage,
548  std::vector<AccessorImplHost *> Requirements,
549  std::vector<detail::EventImplPtr> Events,
551  : CG(CopyFromDeviceGlobal, std::move(ArgsStorage), std::move(AccStorage),
552  std::move(SharedPtrStorage), std::move(Requirements),
553  std::move(Events), std::move(loc)),
554  MDeviceGlobalPtr(DeviceGlobalPtr), MDest(Dest),
555  MIsDeviceImageScoped(IsDeviceImageScoped), MNumBytes(NumBytes),
556  MOffset(Offset), MOSModuleHandle(OSModuleHandle) {}
557 
558  void *getDeviceGlobalPtr() { return MDeviceGlobalPtr; }
559  void *getDest() { return MDest; }
560  bool isDeviceImageScoped() { return MIsDeviceImageScoped; }
561  size_t getNumBytes() { return MNumBytes; }
562  size_t getOffset() { return MOffset; }
563  detail::OSModuleHandle getOSModuleHandle() { return MOSModuleHandle; }
564 };
565 
566 } // namespace detail
567 } // __SYCL_INLINE_VER_NAMESPACE(_V1)
568 } // namespace sycl
sycl::_V1::detail::CGCopy2DUSM::getHeight
size_t getHeight() const
Definition: cg.hpp:438
sycl::_V1::detail::CGFillUSM::getFill
int getFill()
Definition: cg.hpp:302
sycl::_V1::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< AccessorImplHost * > Requirements, std::vector< detail::EventImplPtr > Events, CGTYPE Type, detail::code_location loc={})
Definition: cg.hpp:375
sycl::_V1::detail::CGCopyFromDeviceGlobal::getOffset
size_t getOffset()
Definition: cg.hpp:562
sycl::_V1::detail::CGInteropTask
Definition: cg.hpp:349
sycl::_V1::detail::CGExecKernel::CGExecKernel
CGExecKernel(NDRDescT NDRDesc, std::unique_ptr< HostKernelBase > HKernel, std::shared_ptr< detail::kernel_impl > SyclKernel, std::shared_ptr< detail::kernel_bundle_impl > KernelBundle, std::vector< std::vector< char >> ArgsStorage, std::vector< detail::AccessorImplPtr > AccStorage, std::vector< std::shared_ptr< const void >> SharedPtrStorage, std::vector< AccessorImplHost * > 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, RT::PiKernelCacheConfig KernelCacheConfig, detail::code_location loc={})
Definition: cg.hpp:149
sycl::_V1::detail::CGCopyToDeviceGlobal::getNumBytes
size_t getNumBytes()
Definition: cg.hpp:527
sycl::_V1::detail::CGExecKernel::MSyclKernel
std::shared_ptr< detail::kernel_impl > MSyclKernel
Definition: cg.hpp:140
sycl::_V1::detail::CGUpdateHost
"Update host" command group class.
Definition: cg.hpp:240
sycl::_V1::detail::CGHostTask::MArgs
std::vector< ArgDesc > MArgs
Definition: cg.hpp:373
sycl::_V1::detail::CGFill2DUSM::CGFill2DUSM
CGFill2DUSM(std::vector< char > Pattern, void *DstPtr, size_t Pitch, size_t Width, size_t Height, std::vector< std::vector< char >> ArgsStorage, std::vector< detail::AccessorImplPtr > AccStorage, std::vector< std::shared_ptr< const void >> SharedPtrStorage, std::vector< AccessorImplHost * > Requirements, std::vector< detail::EventImplPtr > Events, detail::code_location loc={})
Definition: cg.hpp:450
type_traits.hpp
sycl::_V1::detail::CGCopy
"Copy memory" command group class.
Definition: cg.hpp:199
sycl::_V1::detail::CGCopyFromDeviceGlobal
"Copy to device_global" command group class.
Definition: cg.hpp:533
cg_types.hpp
sycl::_V1::detail::AccessorImplHost
Definition: accessor_impl.hpp:42
__SYCL_INLINE_VER_NAMESPACE
#define __SYCL_INLINE_VER_NAMESPACE(X)
Definition: defines_elementary.hpp:11
sycl::_V1::detail::InteropTask
Definition: cg_types.hpp:220
sycl::_V1::detail::pi::PiKernelCacheConfig
::pi_kernel_cache_config PiKernelCacheConfig
Definition: pi.hpp:148
_pi_mem_advice
_pi_mem_advice
Definition: pi.h:465
sycl::_V1::detail::CGFill2DUSM::getPattern
const std::vector< char > & getPattern() const
Definition: cg.hpp:467
sycl::_V1::detail::CGExecKernel::getKernelBundle
std::shared_ptr< detail::kernel_bundle_impl > getKernelBundle()
Definition: cg.hpp:187
sycl::_V1::detail::CGCopyFromDeviceGlobal::getOSModuleHandle
detail::OSModuleHandle getOSModuleHandle()
Definition: cg.hpp:563
sycl::_V1::detail::CGExecKernel::getStreams
std::vector< std::shared_ptr< detail::stream_impl > > getStreams() const
Definition: cg.hpp:179
sycl::_V1::detail::CGFill2DUSM::getWidth
size_t getWidth() const
Definition: cg.hpp:465
sycl::_V1::detail::CGCopyToDeviceGlobal::getDeviceGlobalPtr
void * getDeviceGlobalPtr()
Definition: cg.hpp:525
sycl::_V1::detail::CGCopyUSM
"Copy USM" command group class.
Definition: cg.hpp:259
sycl::_V1::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< AccessorImplHost * > Requirements, std::vector< detail::EventImplPtr > Events, CGTYPE Type, detail::code_location loc={})
Definition: cg.hpp:353
sycl::_V1::detail::CGExecKernel::clearAuxiliaryResources
void clearAuxiliaryResources()
Definition: cg.hpp:194
helpers.hpp
sycl
---— Error handling, matching OpenCL plugin semantics.
Definition: access.hpp:14
host_profiling_info.hpp
sycl::_V1::detail::CGPrefetchUSM
"Prefetch USM" command group class.
Definition: cg.hpp:306
sycl::_V1::detail::CGFillUSM::getDst
void * getDst()
Definition: cg.hpp:300
sycl::_V1::detail::CGCopy2DUSM::getSrcPitch
size_t getSrcPitch() const
Definition: cg.hpp:435
sycl::_V1::detail::CGExecKernel::MNDRDesc
NDRDescT MNDRDesc
Stores ND-range description.
Definition: cg.hpp:138
group.hpp
id.hpp
sycl::_V1::detail::CGMemset2DUSM
"Memset 2D USM" command group class.
Definition: cg.hpp:471
sycl::_V1::detail::CGMemset2DUSM::getWidth
size_t getWidth() const
Definition: cg.hpp:493
sycl::_V1::detail::CGCopyFromDeviceGlobal::getNumBytes
size_t getNumBytes()
Definition: cg.hpp:561
interop_handle.hpp
sycl::_V1::detail::CGFill2DUSM::getHeight
size_t getHeight() const
Definition: cg.hpp:466
sycl::_V1::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< AccessorImplHost * > Requirements, std::vector< detail::EventImplPtr > Events, detail::code_location loc={})
Definition: cg.hpp:225
sycl::_V1::detail::CGCopyToDeviceGlobal::getSrc
void * getSrc()
Definition: cg.hpp:524
export.hpp
sycl::_V1::detail::CGHostTask::MContext
std::shared_ptr< detail::context_impl > MContext
Definition: cg.hpp:372
sycl::_V1::detail::CGHostTask::MQueue
std::shared_ptr< detail::queue_impl > MQueue
Definition: cg.hpp:370
sycl::_V1::detail::CG::MLine
int32_t MLine
Definition: cg.hpp:131
sycl::_V1::detail::CGFillUSM
"Fill USM" command group class.
Definition: cg.hpp:283
sycl::_V1::detail::CGInteropTask::MInteropTask
std::unique_ptr< InteropTask > MInteropTask
Definition: cg.hpp:351
sycl::_V1::detail::CGCopy2DUSM::CGCopy2DUSM
CGCopy2DUSM(void *Src, void *Dst, size_t SrcPitch, size_t DstPitch, size_t Width, size_t Height, std::vector< std::vector< char >> ArgsStorage, std::vector< detail::AccessorImplPtr > AccStorage, std::vector< std::shared_ptr< const void >> SharedPtrStorage, std::vector< AccessorImplHost * > Requirements, std::vector< detail::EventImplPtr > Events, detail::code_location loc={})
Definition: cg.hpp:419
sycl::_V1::detail::CGMemset2DUSM::getHeight
size_t getHeight() const
Definition: cg.hpp:494
sycl::_V1::detail::stream_impl
Definition: stream_impl.hpp:25
kernel.hpp
sycl::_V1::detail::CGFill2DUSM
"Fill 2D USM" command group class.
Definition: cg.hpp:442
sycl::_V1::detail::CGExecKernel::MKernelName
std::string MKernelName
Definition: cg.hpp:143
sycl::_V1::detail::CGFill::MPtr
AccessorImplHost * MPtr
Definition: cg.hpp:223
sycl::_V1::detail::CGCopy::getDst
void * getDst()
Definition: cg.hpp:216
sycl::_V1::detail::CGAdviseUSM
"Advise USM" command group class.
Definition: cg.hpp:327
sycl::_V1::detail::CGCopyToDeviceGlobal::getOSModuleHandle
detail::OSModuleHandle getOSModuleHandle()
Definition: cg.hpp:529
range.hpp
sycl::_V1::detail::CGCopy2DUSM
"Copy 2D USM" command group class.
Definition: cg.hpp:410
sycl::_V1::detail::CGCopy2DUSM::getSrc
void * getSrc() const
Definition: cg.hpp:433
sycl::_V1::detail::CGExecKernel::getAuxiliaryResources
std::vector< std::shared_ptr< const void > > getAuxiliaryResources() const
Definition: cg.hpp:183
sycl::_V1::detail::CGExecKernel::getArguments
std::vector< ArgDesc > getArguments() const
Definition: cg.hpp:177
sycl::_V1::detail::CGHostTask::MHostTask
std::unique_ptr< HostTask > MHostTask
Definition: cg.hpp:368
sycl::_V1::detail::CG::MEvents
std::vector< detail::EventImplPtr > MEvents
List of events that order the execution of this CG.
Definition: cg.hpp:125
sycl::_V1::detail::CGCopy::getSrc
void * getSrc()
Definition: cg.hpp:215
sycl::_V1::detail::HostTask
Definition: cg_types.hpp:228
sycl::_V1::detail::CGExecKernel::clearStreams
void clearStreams()
Definition: cg.hpp:191
sycl::_V1::detail::CGFill2DUSM::getPitch
size_t getPitch() const
Definition: cg.hpp:464
sycl::_V1::detail::CGAdviseUSM::getLength
size_t getLength()
Definition: cg.hpp:345
common.hpp
sycl::_V1::detail::CGCopyToDeviceGlobal::getOffset
size_t getOffset()
Definition: cg.hpp:528
sycl::_V1::detail::CGMemset2DUSM::getValue
char getValue() const
Definition: cg.hpp:495
sycl::_V1::detail::OSModuleHandle
intptr_t OSModuleHandle
Uniquely identifies an operating system module (executable or a dynamic library)
Definition: os_util.hpp:48
sycl::_V1::detail::CGFill::MPattern
std::vector< char > MPattern
Definition: cg.hpp:222
sycl::_V1::detail::EventImplPtr
std::shared_ptr< event_impl > EventImplPtr
Definition: cg.hpp:42
sycl::_V1::detail::CG::getAccStorage
std::vector< detail::AccessorImplPtr > & getAccStorage()
Definition: cg.hpp:105
sycl::_V1::detail::CG::getType
CGTYPE getType()
Definition: cg.hpp:101
sycl::_V1::detail::CGMemset2DUSM::getDst
void * getDst() const
Definition: cg.hpp:491
sycl::_V1::detail::CGExecKernel
"Execute kernel" command group class.
Definition: cg.hpp:135
sycl::_V1::detail::CGExecKernel::hasAuxiliaryResources
bool hasAuxiliaryResources()
Definition: cg.hpp:195
sycl::_V1::detail::queue_impl
Definition: queue_impl.hpp:59
sycl::_V1::detail::CGExecKernel::MKernelCacheConfig
RT::PiKernelCacheConfig MKernelCacheConfig
Definition: cg.hpp:147
sycl::_V1::detail::CGExecKernel::getKernelName
std::string getKernelName() const
Definition: cg.hpp:178
sycl::_V1::detail::CGFill::getReqToFill
AccessorImplHost * getReqToFill()
Definition: cg.hpp:236
accessor.hpp
sycl::_V1::detail::CGMemset2DUSM::getPitch
size_t getPitch() const
Definition: cg.hpp:492
sycl::_V1::detail::NDRDescT
Definition: cg_types.hpp:41
sycl::_V1::detail::CGCopyFromDeviceGlobal::CGCopyFromDeviceGlobal
CGCopyFromDeviceGlobal(void *DeviceGlobalPtr, void *Dest, bool IsDeviceImageScoped, size_t NumBytes, size_t Offset, std::vector< std::vector< char >> ArgsStorage, std::vector< detail::AccessorImplPtr > AccStorage, std::vector< std::shared_ptr< const void >> SharedPtrStorage, std::vector< AccessorImplHost * > Requirements, std::vector< detail::EventImplPtr > Events, detail::OSModuleHandle OSModuleHandle, detail::code_location loc={})
Definition: cg.hpp:542
sycl::_V1::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< AccessorImplHost * > Requirements, std::vector< detail::EventImplPtr > Events, detail::code_location loc={})
Definition: cg.hpp:311
sycl::_V1::detail::CGHostTask
Definition: cg.hpp:366
sycl::_V1::detail::CG::CGTYPE
CGTYPE
Type of the command group.
Definition: cg.hpp:55
sycl::_V1::detail::CGCopyToDeviceGlobal::CGCopyToDeviceGlobal
CGCopyToDeviceGlobal(void *Src, void *DeviceGlobalPtr, bool IsDeviceImageScoped, size_t NumBytes, size_t Offset, std::vector< std::vector< char >> ArgsStorage, std::vector< detail::AccessorImplPtr > AccStorage, std::vector< std::shared_ptr< const void >> SharedPtrStorage, std::vector< AccessorImplHost * > Requirements, std::vector< detail::EventImplPtr > Events, detail::OSModuleHandle OSModuleHandle, detail::code_location loc={})
Definition: cg.hpp:508
sycl::_V1::detail::CG::MFunctionName
std::string MFunctionName
Definition: cg.hpp:129
sycl::_V1::detail::code_location
Definition: common.hpp:66
backend_types.hpp
sycl::_V1::detail::CGAdviseUSM::getAdvice
pi_mem_advice getAdvice()
Definition: cg.hpp:346
sycl::_V1::detail::CGBarrier::MEventsWaitWithBarrier
std::vector< detail::EventImplPtr > MEventsWaitWithBarrier
Definition: cg.hpp:394
sycl::_V1::detail::CGCopyFromDeviceGlobal::getDest
void * getDest()
Definition: cg.hpp:559
sycl::_V1::detail::CGCopyUSM::getSrc
void * getSrc()
Definition: cg.hpp:277
kernel_desc.hpp
sycl::_V1::detail::CGFill
"Fill memory" command group class.
Definition: cg.hpp:220
sycl::_V1::detail::CGCopy2DUSM::getDst
void * getDst() const
Definition: cg.hpp:434
sycl::_V1::detail::CG::getArgsStorage
std::vector< std::vector< char > > & getArgsStorage()
Definition: cg.hpp:103
sycl::_V1::detail::CGAdviseUSM::CGAdviseUSM
CGAdviseUSM(void *DstPtr, size_t Length, pi_mem_advice Advice, std::vector< std::vector< char >> ArgsStorage, std::vector< detail::AccessorImplPtr > AccStorage, std::vector< std::shared_ptr< const void >> SharedPtrStorage, std::vector< AccessorImplHost * > Requirements, std::vector< detail::EventImplPtr > Events, CGTYPE Type, detail::code_location loc={})
Definition: cg.hpp:333
sycl::_V1::detail::CGCopyToDeviceGlobal::isDeviceImageScoped
bool isDeviceImageScoped()
Definition: cg.hpp:526
sycl::_V1::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< AccessorImplHost * > Requirements, std::vector< detail::EventImplPtr > Events, detail::code_location loc={})
Definition: cg.hpp:244
sycl::_V1::detail::CGCopy2DUSM::getWidth
size_t getWidth() const
Definition: cg.hpp:437
sycl::_V1::detail::CGCopyToDeviceGlobal
"Copy to device_global" command group class.
Definition: cg.hpp:499
sycl::_V1::detail::CGAdviseUSM::getDst
void * getDst()
Definition: cg.hpp:344
sycl::_V1::detail::CGMemset2DUSM::CGMemset2DUSM
CGMemset2DUSM(char Value, void *DstPtr, size_t Pitch, size_t Width, size_t Height, std::vector< std::vector< char >> ArgsStorage, std::vector< detail::AccessorImplPtr > AccStorage, std::vector< std::shared_ptr< const void >> SharedPtrStorage, std::vector< AccessorImplHost * > Requirements, std::vector< detail::EventImplPtr > Events, detail::code_location loc={})
Definition: cg.hpp:479
sycl::_V1::detail::CGExecKernel::MStreams
std::vector< std::shared_ptr< detail::stream_impl > > MStreams
Definition: cg.hpp:145
sycl::_V1::detail::CGExecKernel::MAuxiliaryResources
std::vector< std::shared_ptr< const void > > MAuxiliaryResources
Definition: cg.hpp:146
sycl::_V1::detail::WorkSizeGuarantees::None
@ None
sycl::_V1::detail::CGFillUSM::getLength
size_t getLength()
Definition: cg.hpp:301
sycl::_V1::detail::CGCopy2DUSM::getDstPitch
size_t getDstPitch() const
Definition: cg.hpp:436
sycl::_V1::detail::CGFill2DUSM::getDst
void * getDst() const
Definition: cg.hpp:463
sycl::_V1::detail::CGPrefetchUSM::getDst
void * getDst()
Definition: cg.hpp:322
sycl::_V1::detail::kernel_bundle_impl
Definition: kernel_bundle_impl.hpp:48
nd_item.hpp
sycl::_V1::detail::CGCopyUSM::getDst
void * getDst()
Definition: cg.hpp:278
sycl::_V1::detail::CGExecKernel::MKernelBundle
std::shared_ptr< detail::kernel_bundle_impl > MKernelBundle
Definition: cg.hpp:141
sycl::_V1::detail::CGCopyFromDeviceGlobal::getDeviceGlobalPtr
void * getDeviceGlobalPtr()
Definition: cg.hpp:558
sycl::_V1::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< AccessorImplHost * > Requirements, std::vector< detail::EventImplPtr > Events, detail::code_location loc={})
Definition: cg.hpp:265
sycl::_V1::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< AccessorImplHost * > Requirements, std::vector< detail::EventImplPtr > Events, detail::code_location loc={})
Definition: cg.hpp:289
sycl::_V1::detail::CG
Base class for all types of command groups.
Definition: cg.hpp:52
sycl::_V1::detail::CGBarrier
Definition: cg.hpp:392
sycl::_V1::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< AccessorImplHost * > Requirements, std::vector< detail::EventImplPtr > Events, detail::code_location loc={})
Definition: cg.hpp:79
sycl::_V1::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< AccessorImplHost * > Requirements, std::vector< detail::EventImplPtr > Events, detail::code_location loc={})
Definition: cg.hpp:204
sycl::_V1::detail::CG::MRequirements
std::vector< AccessorImplHost * > MRequirements
List of requirements that specify which memory is needed for the command group to be executed.
Definition: cg.hpp:123
sycl::_V1::detail::CGExecKernel::MHostKernel
std::unique_ptr< HostKernelBase > MHostKernel
Definition: cg.hpp:139
sycl::_V1::detail::CGUpdateHost::getReqToUpdate
AccessorImplHost * getReqToUpdate()
Definition: cg.hpp:255
sycl::_V1::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< AccessorImplHost * > Requirements, std::vector< detail::EventImplPtr > Events, CGTYPE Type, detail::code_location loc={})
Definition: cg.hpp:396
sycl::_V1::detail::CGCopyFromDeviceGlobal::isDeviceImageScoped
bool isDeviceImageScoped()
Definition: cg.hpp:560
sycl::_V1::detail::CGExecKernel::hasStreams
bool hasStreams()
Definition: cg.hpp:192
sycl::_V1::detail::CGExecKernel::MArgs
std::vector< ArgDesc > MArgs
Definition: cg.hpp:142
sycl::_V1::detail::CGCopyUSM::getLength
size_t getLength()
Definition: cg.hpp:279
sycl::_V1::detail::CGPrefetchUSM::getLength
size_t getLength()
Definition: cg.hpp:323
sycl::_V1::detail::CGExecKernel::MOSModuleHandle
detail::OSModuleHandle MOSModuleHandle
Definition: cg.hpp:144
interop_handler.hpp