DPC++ Runtime
Runtime libraries for oneAPI DPC++
pi_cuda.cpp
Go to the documentation of this file.
1 //==---------- pi_cuda.cpp - CUDA Plugin -----------------------------------==//
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 
13 
14 #include <pi_cuda.hpp>
16 #include <sycl/detail/defines.hpp>
17 #include <sycl/detail/pi.hpp>
18 
19 // Forward declarations
20 struct cuda_tracing_context_t_;
21 
22 void enableCUDATracing(cuda_tracing_context_t_ *ctx);
23 void disableCUDATracing(cuda_tracing_context_t_ *ctx);
24 cuda_tracing_context_t_ *createCUDATracingContext();
25 void freeCUDATracingContext(cuda_tracing_context_t_ *Ctx);
26 
27 //-- PI API implementation
28 extern "C" {
29 
31  pi_uint32 *NumPlatforms) {
32  return pi2ur::piPlatformsGet(NumEntries, Platforms, NumPlatforms);
33 }
34 
36  size_t ParamValueSize, void *ParamValue,
37  size_t *ParamValueSizeRet) {
38  return pi2ur::piPlatformGetInfo(Platform, ParamName, ParamValueSize,
39  ParamValue, ParamValueSizeRet);
40 }
41 
43  pi_native_handle *NativeHandle) {
44  return pi2ur::piextPlatformGetNativeHandle(Platform, NativeHandle);
45 }
46 
48  pi_platform *Platform) {
49  return pi2ur::piextPlatformCreateWithNativeHandle(NativeHandle, Platform);
50 }
51 
53  return pi2ur::piPluginGetLastError(message);
54 }
55 
57  const char *frontend_option,
58  const char **backend_option) {
59  return pi2ur::piPluginGetBackendOption(platform, frontend_option,
60  backend_option);
61 }
62 
64  pi_uint32 NumEntries, pi_device *Devices,
65  pi_uint32 *NumDevices) {
66  return pi2ur::piDevicesGet(Platform, DeviceType, NumEntries, Devices,
67  NumDevices);
68 }
69 
71  return pi2ur::piDeviceRetain(Device);
72 }
73 
75  return pi2ur::piDeviceRelease(Device);
76 }
77 
79  size_t ParamValueSize, void *ParamValue,
80  size_t *ParamValueSizeRet) {
81  return pi2ur::piDeviceGetInfo(Device, ParamName, ParamValueSize, ParamValue,
82  ParamValueSizeRet);
83 }
84 
86  const pi_device_partition_property *Properties,
87  pi_uint32 NumDevices, pi_device *OutDevices,
88  pi_uint32 *OutNumDevices) {
89  return pi2ur::piDevicePartition(Device, Properties, NumDevices, OutDevices,
90  OutNumDevices);
91 }
92 
94  pi_uint32 NumBinaries,
95  pi_uint32 *SelectedBinaryInd) {
96  return pi2ur::piextDeviceSelectBinary(Device, Binaries, NumBinaries,
97  SelectedBinaryInd);
98 }
99 
101  pi_native_handle *NativeHandle) {
102 
103  return pi2ur::piextDeviceGetNativeHandle(Device, NativeHandle);
104 }
105 
107  pi_platform Platform,
108  pi_device *Device) {
109 
110  return pi2ur::piextDeviceCreateWithNativeHandle(NativeHandle, Platform,
111  Device);
112 }
113 
115  pi_uint32 NumDevices, const pi_device *Devices,
116  void (*PFnNotify)(const char *ErrInfo,
117  const void *PrivateInfo, size_t CB,
118  void *UserData),
119  void *UserData, pi_context *RetContext) {
120  return pi2ur::piContextCreate(Properties, NumDevices, Devices, PFnNotify,
121  UserData, RetContext);
122 }
123 
125  size_t ParamValueSize, void *ParamValue,
126  size_t *ParamValueSizeRet) {
127 
128  return pi2ur::piContextGetInfo(Context, ParamName, ParamValueSize, ParamValue,
129  ParamValueSizeRet);
130 }
131 
134  void *UserData) {
135  return pi2ur::piextContextSetExtendedDeleter(Context, Function, UserData);
136 }
137 
139  pi_native_handle *NativeHandle) {
140  return pi2ur::piextContextGetNativeHandle(Context, NativeHandle);
141 }
142 
144  pi_uint32 NumDevices,
145  const pi_device *Devices,
146  bool OwnNativeHandle,
147  pi_context *RetContext) {
149  NativeHandle, NumDevices, Devices, OwnNativeHandle, RetContext);
150 }
151 
153 
154  return pi2ur::piContextRetain(Context);
155 }
156 
158  return pi2ur::piContextRelease(Context);
159 }
160 
162  pi_queue_properties Flags, pi_queue *Queue) {
163  pi_queue_properties Properties[] = {PI_QUEUE_FLAGS, Flags, 0};
164  return piextQueueCreate(Context, Device, Properties, Queue);
165 }
166 
168  pi_queue_properties *Properties, pi_queue *Queue) {
169  return pi2ur::piextQueueCreate(Context, Device, Properties, Queue);
170 }
171 
173  size_t ParamValueSize, void *ParamValue,
174  size_t *ParamValueSizeRet) {
175 
176  return pi2ur::piQueueGetInfo(Queue, ParamName, ParamValueSize, ParamValue,
177  ParamValueSizeRet);
178 }
179 
181 
183  return pi2ur::piQueueRelease(Queue);
184 }
185 
187 
189 
191  pi_native_handle *NativeHandle,
192  int32_t *NativeHandleDesc) {
193 
194  return pi2ur::piextQueueGetNativeHandle(Queue, NativeHandle,
195  NativeHandleDesc);
196 }
197 
199  int32_t NativeHandleDesc,
200  pi_context Context, pi_device Device,
201  bool OwnNativeHandle,
202  pi_queue_properties *Properties,
203  pi_queue *Queue) {
204 
206  NativeHandle, NativeHandleDesc, Context, Device, OwnNativeHandle,
207  Properties, Queue);
208 }
209 
211  void *HostPtr, pi_mem *RetMem,
212  const pi_mem_properties *properties) {
213  return pi2ur::piMemBufferCreate(Context, Flags, Size, HostPtr, RetMem,
214  properties);
215 }
216 
217 pi_result piMemGetInfo(pi_mem Mem, pi_mem_info ParamName, size_t ParamValueSize,
218  void *ParamValue, size_t *ParamValueSizeRet) {
219  return pi2ur::piMemGetInfo(Mem, ParamName, ParamValueSize, ParamValue,
220  ParamValueSizeRet);
221 }
222 
224 
226 
228  const pi_image_format *ImageFormat,
229  const pi_image_desc *ImageDesc, void *HostPtr,
230  pi_mem *RetImage) {
231 
232  return pi2ur::piMemImageCreate(Context, Flags, ImageFormat, ImageDesc,
233  HostPtr, RetImage);
234 }
235 
237  pi_native_handle *NativeHandle) {
238  return pi2ur::piextMemGetNativeHandle(Mem, Dev, NativeHandle);
239 }
240 
242  pi_context Context,
243  bool ownNativeHandle, pi_mem *Mem) {
244  return pi2ur::piextMemCreateWithNativeHandle(NativeHandle, Context,
245  ownNativeHandle, Mem);
246 }
247 
248 pi_result piProgramCreate(pi_context Context, const void *ILBytes,
249  size_t Length, pi_program *Program) {
250  return pi2ur::piProgramCreate(Context, ILBytes, Length, Program);
251 }
252 
254  pi_context Context, pi_uint32 NumDevices, const pi_device *DeviceList,
255  const size_t *Lengths, const unsigned char **Binaries,
256  size_t NumMetadataEntries, const pi_device_binary_property *Metadata,
257  pi_int32 *BinaryStatus, pi_program *Program) {
258 
259  return pi2ur::piProgramCreateWithBinary(Context, NumDevices, DeviceList,
260  Lengths, Binaries, NumMetadataEntries,
261  Metadata, BinaryStatus, Program);
262 }
263 
265  pi_native_handle NativeHandle, pi_context Context, bool OwnNativeHandle,
266  const pi_image_format *ImageFormat, const pi_image_desc *ImageDesc,
267  pi_mem *Img) {
269  NativeHandle, Context, OwnNativeHandle, ImageFormat, ImageDesc, Img);
270 }
271 
273  size_t ParamValueSize, void *ParamValue,
274  size_t *ParamValueSizeRet) {
275 
276  return pi2ur::piProgramGetInfo(Program, ParamName, ParamValueSize, ParamValue,
277  ParamValueSizeRet);
278 }
279 
281  const pi_device *DeviceList, const char *Options,
282  pi_uint32 NumInputPrograms,
283  const pi_program *InputPrograms,
284  void (*PFnNotify)(pi_program Program, void *UserData),
285  void *UserData, pi_program *RetProgram) {
286  return pi2ur::piProgramLink(Context, NumDevices, DeviceList, Options,
287  NumInputPrograms, InputPrograms, PFnNotify,
288  UserData, RetProgram);
289 }
290 
292  pi_program Program, pi_uint32 NumDevices, const pi_device *DeviceList,
293  const char *Options, pi_uint32 NumInputHeaders,
294  const pi_program *InputHeaders, const char **HeaderIncludeNames,
295  void (*PFnNotify)(pi_program Program, void *UserData), void *UserData) {
296 
297  return pi2ur::piProgramCompile(Program, NumDevices, DeviceList, Options,
298  NumInputHeaders, InputHeaders,
299  HeaderIncludeNames, PFnNotify, UserData);
300 }
301 
303  const pi_device *DeviceList, const char *Options,
304  void (*PFnNotify)(pi_program Program, void *UserData),
305  void *UserData) {
306  return pi2ur::piProgramBuild(Program, NumDevices, DeviceList, Options,
307  PFnNotify, UserData);
308 }
309 
311  pi_program_build_info ParamName,
312  size_t ParamValueSize, void *ParamValue,
313  size_t *ParamValueSizeRet) {
314 
315  return pi2ur::piProgramGetBuildInfo(Program, Device, ParamName,
316  ParamValueSize, ParamValue,
317  ParamValueSizeRet);
318 }
319 
321  return pi2ur::piProgramRetain(Program);
322 }
323 
325  return pi2ur::piProgramRelease(Program);
326 }
327 
329  pi_native_handle *NativeHandle) {
330  return pi2ur::piextProgramGetNativeHandle(Program, NativeHandle);
331 }
332 
334  pi_context Context,
335  bool OwnNativeHandle,
336  pi_program *Program) {
337  return pi2ur::piextProgramCreateWithNativeHandle(NativeHandle, Context,
338  OwnNativeHandle, Program);
339 }
340 
341 pi_result piKernelCreate(pi_program Program, const char *KernelName,
342  pi_kernel *RetKernel) {
343 
344  return pi2ur::piKernelCreate(Program, KernelName, RetKernel);
345 }
346 
347 pi_result piKernelSetArg(pi_kernel Kernel, pi_uint32 ArgIndex, size_t ArgSize,
348  const void *ArgValue) {
349 
350  return pi2ur::piKernelSetArg(Kernel, ArgIndex, ArgSize, ArgValue);
351 }
352 
354  const pi_mem_obj_property *ArgProperties,
355  const pi_mem *ArgValue) {
356  return pi2ur::piextKernelSetArgMemObj(Kernel, ArgIndex, ArgProperties,
357  ArgValue);
358 }
359 
361  const pi_sampler *ArgValue) {
362 
363  return pi2ur::piextKernelSetArgSampler(Kernel, ArgIndex, ArgValue);
364 }
365 
367  size_t ParamValueSize, void *ParamValue,
368  size_t *ParamValueSizeRet) {
369 
370  return pi2ur::piKernelGetInfo(Kernel, ParamName, ParamValueSize, ParamValue,
371  ParamValueSizeRet);
372 }
373 
375  pi_device Device,
376  pi_image_format *ImageFormat,
377  pi_image_desc *ImageDesc,
378  pi_image_mem_handle *RetMem) {
379  return pi2ur::piextMemImageAllocate(Context, Device, ImageFormat, ImageDesc,
380  RetMem);
381 }
382 
384  pi_context Context, pi_device Device, pi_image_mem_handle ImgMem,
385  pi_image_format *ImageFormat, pi_image_desc *ImageDesc,
386  pi_image_handle *RetHandle) {
387  return pi2ur::piextMemUnsampledImageCreate(Context, Device, ImgMem,
388  ImageFormat, ImageDesc, RetHandle);
389 }
390 
392  pi_context Context, pi_device Device, pi_image_mem_handle ImgMem,
393  pi_image_format *ImageFormat, pi_image_desc *ImageDesc, pi_sampler Sampler,
394  pi_image_handle *RetHandle) {
395  return pi2ur::piextMemSampledImageCreate(Context, Device, ImgMem, ImageFormat,
396  ImageDesc, Sampler, RetHandle);
397 }
398 
400  pi_context Context, const pi_sampler_properties *SamplerProperties,
401  float MinMipmapLevelClamp, float MaxMipmapLevelClamp, float MaxAnisotropy,
402  pi_sampler *RetSampler) {
404  Context, SamplerProperties, MinMipmapLevelClamp, MaxMipmapLevelClamp,
405  MaxAnisotropy, RetSampler);
406 }
407 
409  pi_device Device,
410  pi_image_mem_handle MipMem,
411  unsigned int Level,
412  pi_image_mem_handle *RetMem) {
413  return pi2ur::piextMemMipmapGetLevel(Context, Device, MipMem, Level, RetMem);
414 }
415 
416 __SYCL_EXPORT pi_result piextMemImageFree(pi_context Context, pi_device Device,
417  pi_image_mem_handle MemoryHandle) {
418  return pi2ur::piextMemImageFree(Context, Device, MemoryHandle);
419 }
420 
421 __SYCL_EXPORT pi_result piextMemMipmapFree(pi_context Context, pi_device Device,
422  pi_image_mem_handle MemoryHandle) {
423  return pi2ur::piextMemMipmapFree(Context, Device, MemoryHandle);
424 }
425 
427  pi_queue Queue, void *DstPtr, const void *SrcPtr,
428  const pi_image_desc *SrcImageDesc, const pi_image_desc *DestImageDesc,
429  const pi_image_format *SrcImageFormat,
430  const pi_image_format *DestImageFormat, const pi_image_copy_flags Flags,
431  pi_image_offset SrcOffset, pi_image_offset DstOffset,
432  pi_image_region CopyExtent, pi_uint32 NumEventsInWaitList,
433  const pi_event *EventWaitList, pi_event *Event) {
435  Queue, DstPtr, SrcPtr, SrcImageDesc, DestImageDesc, SrcImageFormat,
436  DestImageFormat, Flags, SrcOffset, DstOffset, CopyExtent,
437  NumEventsInWaitList, EventWaitList, Event);
438 }
439 
441  pi_context Context, pi_device Device, pi_image_handle Handle) {
442  return pi2ur::piextMemUnsampledImageHandleDestroy(Context, Device, Handle);
443 }
444 
446  pi_context Context, pi_device Device, pi_image_handle Handle) {
447  return pi2ur::piextMemSampledImageHandleDestroy(Context, Device, Handle);
448 }
449 
451  pi_image_mem_handle MemHandle,
452  pi_image_info ParamName,
453  void *ParamValue,
454  size_t *ParamValueSizeRet) {
455  return pi2ur::piextMemImageGetInfo(Context, MemHandle, ParamName, ParamValue,
456  ParamValueSizeRet);
457 }
458 
460  pi_context Context, pi_device Device, pi_external_mem_descriptor *MemDesc,
461  pi_interop_mem_handle *RetHandle) {
462  return pi2ur::piextImportExternalMemory(Context, Device, MemDesc, RetHandle);
463 }
464 
466  pi_context Context, pi_device Device, pi_image_format *ImageFormat,
467  pi_image_desc *ImageDesc, pi_interop_mem_handle MemHandle,
468  pi_image_mem_handle *RetMem) {
469  return pi2ur::piextMemMapExternalArray(Context, Device, ImageFormat,
470  ImageDesc, MemHandle, RetMem);
471 }
472 
474  pi_device Device,
475  pi_interop_mem_handle ExtMem) {
476  return pi2ur::piextMemReleaseInterop(Context, Device, ExtMem);
477 }
478 
479 __SYCL_EXPORT pi_result
482  pi_interop_semaphore_handle *RetHandle) {
483  return pi2ur::piextImportExternalSemaphore(Context, Device, SemDesc,
484  RetHandle);
485 }
486 
487 __SYCL_EXPORT pi_result
489  pi_interop_semaphore_handle SemHandle) {
490  return pi2ur::piextReleaseExternalSemaphore(Context, Device, SemHandle);
491 }
492 
494  pi_queue Queue, pi_interop_semaphore_handle SemHandle, bool HasWaitValue,
495  pi_uint64 WaitValue, pi_uint32 NumEventsInWaitList,
496  const pi_event *EventWaitList, pi_event *Event) {
497  return pi2ur::piextWaitExternalSemaphore(Queue, SemHandle, HasWaitValue,
498  WaitValue, NumEventsInWaitList,
499  EventWaitList, Event);
500 }
501 
503  pi_queue Queue, pi_interop_semaphore_handle SemHandle, bool HasSignalValue,
504  pi_uint64 SignalValue, pi_uint32 NumEventsInWaitList,
505  const pi_event *EventWaitList, pi_event *Event) {
506  return pi2ur::piextSignalExternalSemaphore(Queue, SemHandle, HasSignalValue,
507  SignalValue, NumEventsInWaitList,
508  EventWaitList, Event);
509 }
510 
512  pi_kernel_group_info ParamName,
513  size_t ParamValueSize, void *ParamValue,
514  size_t *ParamValueSizeRet) {
515  return pi2ur::piKernelGetGroupInfo(Kernel, Device, ParamName, ParamValueSize,
516  ParamValue, ParamValueSizeRet);
517 }
518 
520  pi_kernel_sub_group_info ParamName,
521  size_t InputValueSize, const void *InputValue,
522  size_t ParamValueSize, void *ParamValue,
523  size_t *ParamValueSizeRet) {
525  Kernel, Device, ParamName, InputValueSize, InputValue, ParamValueSize,
526  ParamValue, ParamValueSizeRet);
527 }
528 
530 
531  return pi2ur::piKernelRetain(Kernel);
532 }
533 
535 
536  return pi2ur::piKernelRelease(Kernel);
537 }
538 
539 pi_result
541  const size_t *GlobalWorkOffset,
542  const size_t *GlobalWorkSize, const size_t *LocalWorkSize,
543  pi_uint32 NumEventsInWaitList,
544  const pi_event *EventWaitList, pi_event *OutEvent) {
546  Queue, Kernel, WorkDim, GlobalWorkOffset, GlobalWorkSize, LocalWorkSize,
547  NumEventsInWaitList, EventWaitList, OutEvent);
548 }
549 
551  pi_queue Queue, pi_kernel Kernel, pi_uint32 WorkDim,
552  const size_t *GlobalWorkSize, const size_t *LocalWorkSize,
553  pi_uint32 NumPropsInLaunchPropList,
554  const pi_launch_property *LaunchPropList, pi_uint32 NumEventsInWaitList,
555  const pi_event *EventsWaitList, pi_event *OutEvent) {
556 
558  Queue, Kernel, WorkDim, GlobalWorkSize, LocalWorkSize,
559  NumPropsInLaunchPropList, LaunchPropList, NumEventsInWaitList,
560  EventsWaitList, OutEvent);
561 }
562 
564  pi_queue Queue, pi_kernel Kernel, pi_uint32 WorkDim,
565  const size_t *GlobalWorkOffset, const size_t *GlobalWorkSize,
566  const size_t *LocalWorkSize, pi_uint32 NumEventsInWaitList,
567  const pi_event *EventWaitList, pi_event *OutEvent) {
569  Queue, Kernel, WorkDim, GlobalWorkOffset, GlobalWorkSize, LocalWorkSize,
570  NumEventsInWaitList, EventWaitList, OutEvent);
571 }
572 
574  pi_context Context,
575  pi_program Program,
576  bool OwnNativeHandle,
577  pi_kernel *Kernel) {
578 
580  NativeHandle, Context, Program, OwnNativeHandle, Kernel);
581 }
582 
584  pi_native_handle *NativeHandle) {
585  return pi2ur::piextKernelGetNativeHandle(Kernel, NativeHandle);
586 }
587 
589  pi_kernel Kernel, size_t LocalWorkSize, size_t DynamicSharedMemorySize,
590  pi_uint32 *GroupCountRet) {
592  Kernel, LocalWorkSize, DynamicSharedMemorySize, GroupCountRet);
593 }
594 
596  return pi2ur::piEventCreate(Context, RetEvent);
597 }
598 
600  size_t ParamValueSize, void *ParamValue,
601  size_t *ParamValueSizeRet) {
602  return pi2ur::piEventGetInfo(Event, ParamName, ParamValueSize, ParamValue,
603  ParamValueSizeRet);
604 }
605 
607  size_t ParamValueSize, void *ParamValue,
608  size_t *ParamValueSizeRet) {
609 
610  return pi2ur::piEventGetProfilingInfo(Event, ParamName, ParamValueSize,
611  ParamValue, ParamValueSizeRet);
612 }
613 
614 pi_result piEventsWait(pi_uint32 NumEvents, const pi_event *EventList) {
615  return pi2ur::piEventsWait(NumEvents, EventList);
616 }
617 
618 pi_result piEventSetCallback(pi_event Event, pi_int32 CommandExecCallbackType,
619  void (*PFnNotify)(pi_event Event,
620  pi_int32 EventCommandStatus,
621  void *UserData),
622  void *UserData) {
623  return pi2ur::piEventSetCallback(Event, CommandExecCallbackType, PFnNotify,
624  UserData);
625 }
626 
627 pi_result piEventSetStatus(pi_event Event, pi_int32 ExecutionStatus) {
628  return pi2ur::piEventSetStatus(Event, ExecutionStatus);
629 }
630 
632 
634  return pi2ur::piEventRelease(Event);
635 }
636 
638  pi_native_handle *NativeHandle) {
639 
640  return pi2ur::piextEventGetNativeHandle(Event, NativeHandle);
641 }
642 
644  pi_context Context,
645  bool OwnNativeHandle,
646  pi_event *Event) {
647  return pi2ur::piextEventCreateWithNativeHandle(NativeHandle, Context,
648  OwnNativeHandle, Event);
649 }
650 
652  pi_uint32 NumEventsInWaitList,
653  const pi_event *EventWaitList,
654  pi_event *Event) {
656  Queue, Blocking, NumEventsInWaitList, EventWaitList, Event);
657 }
658 
660  const pi_sampler_properties *SamplerProperties,
661  pi_sampler *RetSampler) {
662  return pi2ur::piSamplerCreate(Context, SamplerProperties, RetSampler);
663 }
664 
666  size_t ParamValueSize, void *ParamValue,
667  size_t *ParamValueSizeRet) {
668 
669  return pi2ur::piSamplerGetInfo(Sampler, ParamName, ParamValueSize, ParamValue,
670  ParamValueSizeRet);
671 }
672 
674  return pi2ur::piSamplerRetain(Sampler);
675 }
676 
678  return pi2ur::piSamplerRelease(Sampler);
679 }
680 
681 pi_result piEnqueueEventsWait(pi_queue Queue, pi_uint32 NumEventsInWaitList,
682  const pi_event *EventWaitList,
683  pi_event *OutEvent) {
684 
685  return pi2ur::piEnqueueEventsWait(Queue, NumEventsInWaitList, EventWaitList,
686  OutEvent);
687 }
688 
690  pi_uint32 NumEventsInWaitList,
691  const pi_event *EventWaitList,
692  pi_event *OutEvent) {
693 
694  return pi2ur::piEnqueueEventsWaitWithBarrier(Queue, NumEventsInWaitList,
695  EventWaitList, OutEvent);
696 }
697 
699  pi_bool BlockingRead, size_t Offset,
700  size_t Size, void *Dst,
701  pi_uint32 NumEventsInWaitList,
702  const pi_event *EventWaitList,
703  pi_event *Event) {
704 
705  return pi2ur::piEnqueueMemBufferRead(Queue, Src, BlockingRead, Offset, Size,
706  Dst, NumEventsInWaitList, EventWaitList,
707  Event);
708 }
709 
711  pi_queue Queue, pi_mem Buffer, pi_bool BlockingRead,
712  pi_buff_rect_offset BufferOffset, pi_buff_rect_offset HostOffset,
713  pi_buff_rect_region Region, size_t BufferRowPitch, size_t BufferSlicePitch,
714  size_t HostRowPitch, size_t HostSlicePitch, void *Ptr,
715  pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList,
716  pi_event *Event) {
717 
719  Queue, Buffer, BlockingRead, BufferOffset, HostOffset, Region,
720  BufferRowPitch, BufferSlicePitch, HostRowPitch, HostSlicePitch, Ptr,
721  NumEventsInWaitList, EventWaitList, Event);
722 }
723 
725  pi_bool BlockingWrite, size_t Offset,
726  size_t Size, const void *Ptr,
727  pi_uint32 NumEventsInWaitList,
728  const pi_event *EventWaitList,
729  pi_event *Event) {
730 
731  return pi2ur::piEnqueueMemBufferWrite(Queue, Buffer, BlockingWrite, Offset,
732  Size, Ptr, NumEventsInWaitList,
733  EventWaitList, Event);
734 }
735 
737  pi_queue Queue, pi_mem Buffer, pi_bool BlockingWrite,
738  pi_buff_rect_offset BufferOffset, pi_buff_rect_offset HostOffset,
739  pi_buff_rect_region Region, size_t BufferRowPitch, size_t BufferSlicePitch,
740  size_t HostRowPitch, size_t HostSlicePitch, const void *Ptr,
741  pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList,
742  pi_event *Event) {
743 
745  Queue, Buffer, BlockingWrite, BufferOffset, HostOffset, Region,
746  BufferRowPitch, BufferSlicePitch, HostRowPitch, HostSlicePitch, Ptr,
747  NumEventsInWaitList, EventWaitList, Event);
748 }
749 
751  size_t SrcOffset, size_t DstOffset,
752  size_t Size, pi_uint32 NumEventsInWaitList,
753  const pi_event *EventWaitList,
754  pi_event *Event) {
755 
756  return pi2ur::piEnqueueMemBufferCopy(Queue, SrcMem, DstMem, SrcOffset,
757  DstOffset, Size, NumEventsInWaitList,
758  EventWaitList, Event);
759 }
760 
762  pi_queue Queue, pi_mem SrcMem, pi_mem DstMem, pi_buff_rect_offset SrcOrigin,
763  pi_buff_rect_offset DstOrigin, pi_buff_rect_region Region,
764  size_t SrcRowPitch, size_t SrcSlicePitch, size_t DstRowPitch,
765  size_t DstSlicePitch, pi_uint32 NumEventsInWaitList,
766  const pi_event *EventWaitList, pi_event *Event) {
767 
769  Queue, SrcMem, DstMem, SrcOrigin, DstOrigin, Region, SrcRowPitch,
770  SrcSlicePitch, DstRowPitch, DstSlicePitch, NumEventsInWaitList,
771  EventWaitList, Event);
772 }
773 
775  const void *Pattern, size_t PatternSize,
776  size_t Offset, size_t Size,
777  pi_uint32 NumEventsInWaitList,
778  const pi_event *EventWaitList,
779  pi_event *Event) {
780 
781  return pi2ur::piEnqueueMemBufferFill(Queue, Buffer, Pattern, PatternSize,
782  Offset, Size, NumEventsInWaitList,
783  EventWaitList, Event);
784 }
785 
787  pi_map_flags MapFlags, size_t Offset,
788  size_t Size, pi_uint32 NumEventsInWaitList,
789  const pi_event *EventWaitList,
790  pi_event *OutEvent, void **RetMap) {
791 
792  return pi2ur::piEnqueueMemBufferMap(Queue, Mem, BlockingMap, MapFlags, Offset,
793  Size, NumEventsInWaitList, EventWaitList,
794  OutEvent, RetMap);
795 }
796 
797 pi_result piEnqueueMemUnmap(pi_queue Queue, pi_mem Mem, void *MappedPtr,
798  pi_uint32 NumEventsInWaitList,
799  const pi_event *EventWaitList, pi_event *OutEvent) {
800 
801  return pi2ur::piEnqueueMemUnmap(Queue, Mem, MappedPtr, NumEventsInWaitList,
802  EventWaitList, OutEvent);
803 }
804 
806  size_t ParamValueSize, void *ParamValue,
807  size_t *ParamValueSizeRet) {
808 
809  return pi2ur::piMemImageGetInfo(Image, ParamName, ParamValueSize, ParamValue,
810  ParamValueSizeRet);
811 }
812 
814  pi_bool BlockingRead, pi_image_offset Origin,
815  pi_image_region Region, size_t RowPitch,
816  size_t SlicePitch, void *Ptr,
817  pi_uint32 NumEventsInWaitList,
818  const pi_event *EventWaitList,
819  pi_event *Event) {
821  Queue, Image, BlockingRead, Origin, Region, RowPitch, SlicePitch, Ptr,
822  NumEventsInWaitList, EventWaitList, Event);
823 }
824 
826  pi_bool BlockingWrite, pi_image_offset Origin,
827  pi_image_region Region, size_t InputRowPitch,
828  size_t InputSlicePitch, const void *Ptr,
829  pi_uint32 NumEventsInWaitList,
830  const pi_event *EventWaitList,
831  pi_event *Event) {
832 
834  Queue, Image, BlockingWrite, Origin, Region, InputRowPitch,
835  InputSlicePitch, Ptr, NumEventsInWaitList, EventWaitList, Event);
836 }
837 
838 pi_result
839 piEnqueueMemImageCopy(pi_queue Queue, pi_mem SrcImage, pi_mem DstImage,
840  pi_image_offset SrcOrigin, pi_image_offset DstOrigin,
841  pi_image_region Region, pi_uint32 NumEventsInWaitList,
842  const pi_event *EventWaitList, pi_event *Event) {
843  return pi2ur::piEnqueueMemImageCopy(Queue, SrcImage, DstImage, SrcOrigin,
844  DstOrigin, Region, NumEventsInWaitList,
845  EventWaitList, Event);
846 }
847 
849  const void *FillColor, const size_t *Origin,
850  const size_t *Region,
851  pi_uint32 NumEventsInWaitList,
852  const pi_event *EventWaitList,
853  pi_event *Event) {
854 
855  return pi2ur::piEnqueueMemImageFill(Queue, Image, FillColor, Origin, Region,
856  NumEventsInWaitList, EventWaitList,
857  Event);
858 }
859 
861  pi_buffer_create_type BufferCreateType,
862  void *BufferCreateInfo, pi_mem *RetMem) {
863 
864  return pi2ur::piMemBufferPartition(Buffer, Flags, BufferCreateType,
865  BufferCreateInfo, RetMem);
866 }
867 
869  const char *FunctionName,
870  pi_uint64 *FunctionPointerRet) {
871  return pi2ur::piextGetDeviceFunctionPointer(Device, Program, FunctionName,
872  FunctionPointerRet);
873 }
874 
876  const char *GlobalVariableName,
877  size_t *GlobalVariableSize,
878  void **GlobalVariablePointerRet) {
880  Device, Program, GlobalVariableName, GlobalVariableSize,
881  GlobalVariablePointerRet);
882 }
883 
884 pi_result piextUSMDeviceAlloc(void **ResultPtr, pi_context Context,
885  pi_device Device,
886  pi_usm_mem_properties *Properties, size_t Size,
888 
889  return pi2ur::piextUSMDeviceAlloc(ResultPtr, Context, Device, Properties,
890  Size, Alignment);
891 }
892 
893 pi_result piextUSMSharedAlloc(void **ResultPtr, pi_context Context,
894  pi_device Device,
895  pi_usm_mem_properties *Properties, size_t Size,
897 
898  return pi2ur::piextUSMSharedAlloc(ResultPtr, Context, Device, Properties,
899  Size, Alignment);
900 }
901 
903  void **ResultPtr, size_t *ResultPitch, pi_context Context, pi_device Device,
904  pi_usm_mem_properties *Properties, size_t WidthInBytes, size_t Height,
905  unsigned int ElementSizeBytes) {
906 
907  return pi2ur::piextUSMPitchedAlloc(ResultPtr, ResultPitch, Context, Device,
908  Properties, WidthInBytes, Height,
909  ElementSizeBytes);
910 }
911 
912 pi_result piextUSMHostAlloc(void **ResultPtr, pi_context Context,
913  pi_usm_mem_properties *Properties, size_t Size,
915  return pi2ur::piextUSMHostAlloc(ResultPtr, Context, Properties, Size,
916  Alignment);
917 }
918 
919 pi_result piextUSMFree(pi_context Context, void *Ptr) {
920 
921  return pi2ur::piextUSMFree(Context, Ptr);
922 }
923 
925  size_t ArgSize, const void *ArgValue) {
926  return pi2ur::piextKernelSetArgPointer(Kernel, ArgIndex, ArgSize, ArgValue);
927 }
928 
929 pi_result piextUSMEnqueueFill(pi_queue Queue, void *Ptr, const void *Pattern,
930  size_t PatternSize, size_t Count,
931  pi_uint32 NumEventsInWaitlist,
932  const pi_event *EventsWaitlist, pi_event *Event) {
933  return pi2ur::piextUSMEnqueueFill(Queue, Ptr, Pattern, PatternSize, Count,
934  NumEventsInWaitlist, EventsWaitlist, Event);
935 }
936 
937 pi_result piextUSMEnqueueMemcpy(pi_queue Queue, pi_bool Blocking, void *DstPtr,
938  const void *SrcPtr, size_t Size,
939  pi_uint32 NumEventsInWaitlist,
940  const pi_event *EventsWaitlist,
941  pi_event *Event) {
942 
943  return pi2ur::piextUSMEnqueueMemcpy(Queue, Blocking, DstPtr, SrcPtr, Size,
944  NumEventsInWaitlist, EventsWaitlist,
945  Event);
946 }
947 
948 pi_result piextUSMEnqueuePrefetch(pi_queue Queue, const void *Ptr, size_t Size,
950  pi_uint32 NumEventsInWaitList,
951  const pi_event *EventWaitList,
952  pi_event *OutEvent) {
953 
955  Queue, Ptr, Size, Flags, NumEventsInWaitList, EventWaitList, OutEvent);
956 }
957 
959  size_t Length, pi_mem_advice Advice,
960  pi_event *OutEvent) {
961 
962  return pi2ur::piextUSMEnqueueMemAdvise(Queue, Ptr, Length, Advice, OutEvent);
963 }
964 
965 __SYCL_EXPORT pi_result piextUSMEnqueueFill2D(pi_queue Queue, void *Ptr,
966  size_t Pitch, size_t PatternSize,
967  const void *Pattern, size_t Width,
968  size_t Height,
969  pi_uint32 NumEventsWaitList,
970  const pi_event *EventsWaitList,
971  pi_event *Event) {
972 
973  return pi2ur::piextUSMEnqueueFill2D(Queue, Ptr, Pitch, PatternSize, Pattern,
974  Width, Height, NumEventsWaitList,
975  EventsWaitList, Event);
976 }
977 
978 __SYCL_EXPORT pi_result piextUSMEnqueueMemset2D(pi_queue Queue, void *Ptr,
979  size_t Pitch, int Value,
980  size_t Width, size_t Height,
981  pi_uint32 NumEventsWaitList,
982  const pi_event *EventsWaitlist,
983  pi_event *Event) {
984 
985  return pi2ur::piextUSMEnqueueMemset2D(Queue, Ptr, Pitch, Value, Width, Height,
986  NumEventsWaitList, EventsWaitlist,
987  Event);
988 }
989 
991  pi_queue Queue, pi_bool Blocking, void *DstPtr, size_t DstPitch,
992  const void *SrcPtr, size_t SrcPitch, size_t Width, size_t Height,
993  pi_uint32 NumEventsInWaitlist, const pi_event *EventWaitlist,
994  pi_event *Event) {
995 
997  Queue, Blocking, DstPtr, DstPitch, SrcPtr, SrcPitch, Width, Height,
998  NumEventsInWaitlist, EventWaitlist, Event);
999 }
1000 
1002  pi_mem_alloc_info ParamName,
1003  size_t ParamValueSize, void *ParamValue,
1004  size_t *ParamValueSizeRet) {
1005  return pi2ur::piextUSMGetMemAllocInfo(Context, Ptr, ParamName, ParamValueSize,
1006  ParamValue, ParamValueSizeRet);
1007 }
1008 
1009 pi_result piextUSMImport(const void *HostPtr, size_t Size, pi_context Context) {
1010  return pi2ur::piextUSMImport(HostPtr, Size, Context);
1011 }
1012 
1013 pi_result piextUSMRelease(const void *HostPtr, pi_context Context) {
1014  return pi2ur::piextUSMRelease(HostPtr, Context);
1015 }
1016 
1018  pi_queue Queue, pi_program Program, const char *Name, pi_bool BlockingWrite,
1019  size_t Count, size_t Offset, const void *Src, pi_uint32 NumEventsInWaitList,
1020  const pi_event *EventsWaitList, pi_event *Event) {
1022  Queue, Program, Name, BlockingWrite, Count, Offset, Src,
1023  NumEventsInWaitList, EventsWaitList, Event);
1024 }
1025 
1027  pi_queue Queue, pi_program Program, const char *Name, pi_bool BlockingRead,
1028  size_t Count, size_t Offset, void *Dst, pi_uint32 NumEventsInWaitList,
1029  const pi_event *EventsWaitList, pi_event *Event) {
1031  Queue, Program, Name, BlockingRead, Count, Offset, Dst,
1032  NumEventsInWaitList, EventsWaitList, Event);
1033 
1034  return PI_SUCCESS;
1035 }
1036 
1038  const char *PipeSymbol, pi_bool Blocking,
1039  void *Ptr, size_t Size,
1040  pi_uint32 NumEventsInWaitList,
1041  const pi_event *EventsWaitList,
1042  pi_event *Event) {
1043  (void)Queue;
1044  (void)Program;
1045  (void)PipeSymbol;
1046  (void)Blocking;
1047  (void)Ptr;
1048  (void)Size;
1049  (void)NumEventsInWaitList;
1050  (void)EventsWaitList;
1051  (void)Event;
1052  PI_ASSERT(Queue, PI_ERROR_INVALID_QUEUE);
1053  die("piextEnqueueReadHostPipe: not implemented");
1054  return {};
1055 }
1056 
1058  const char *PipeSymbol, pi_bool Blocking,
1059  void *Ptr, size_t Size,
1060  pi_uint32 NumEventsInWaitList,
1061  const pi_event *EventsWaitList,
1062  pi_event *Event) {
1063  (void)Queue;
1064  (void)Program;
1065  (void)PipeSymbol;
1066  (void)Blocking;
1067  (void)Ptr;
1068  (void)Size;
1069  (void)NumEventsInWaitList;
1070  (void)EventsWaitList;
1071  (void)Event;
1072  PI_ASSERT(Queue, PI_ERROR_INVALID_QUEUE);
1073  die("piextEnqueueWriteHostPipe: not implemented");
1074  return {};
1075 }
1076 
1078  size_t ParamValueSize, const void *ParamValue) {
1079 
1080  return pi2ur::piKernelSetExecInfo(Kernel, ParamName, ParamValueSize,
1081  ParamValue);
1082 }
1083 
1085  pi_uint32 SpecID, size_t Size,
1086  const void *SpecValue) {
1087  return pi2ur::piextProgramSetSpecializationConstant(Prog, SpecID, Size,
1088  SpecValue);
1089 }
1090 
1091 // Command buffer extension
1093  const pi_ext_command_buffer_desc *Desc,
1094  pi_ext_command_buffer *RetCommandBuffer) {
1095  return pi2ur::piextCommandBufferCreate(Context, Device, Desc,
1096  RetCommandBuffer);
1097 }
1098 
1100  return pi2ur::piextCommandBufferRetain(CommandBuffer);
1101 }
1102 
1104  return pi2ur::piextCommandBufferRelease(CommandBuffer);
1105 }
1106 
1108  return pi2ur::piextCommandBufferFinalize(CommandBuffer);
1109 }
1110 
1112  pi_ext_command_buffer CommandBuffer, pi_kernel Kernel, pi_uint32 WorkDim,
1113  const size_t *GlobalWorkOffset, const size_t *GlobalWorkSize,
1114  const size_t *LocalWorkSize, pi_uint32 NumSyncPointsInWaitList,
1115  const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint,
1116  pi_ext_command_buffer_command *Command) {
1118  CommandBuffer, Kernel, WorkDim, GlobalWorkOffset, GlobalWorkSize,
1119  LocalWorkSize, NumSyncPointsInWaitList, SyncPointWaitList, SyncPoint,
1120  Command);
1121 }
1122 
1124  pi_ext_command_buffer CommandBuffer, void *DstPtr, const void *SrcPtr,
1125  size_t Size, pi_uint32 NumSyncPointsInWaitList,
1126  const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint) {
1127  return pi2ur::piextCommandBufferMemcpyUSM(CommandBuffer, DstPtr, SrcPtr, Size,
1128  NumSyncPointsInWaitList,
1129  SyncPointWaitList, SyncPoint);
1130 }
1131 
1133  pi_ext_command_buffer CommandBuffer, pi_mem SrcMem, pi_mem DstMem,
1134  size_t SrcOffset, size_t DstOffset, size_t Size,
1135  pi_uint32 NumSyncPointsInWaitList,
1136  const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint) {
1138  CommandBuffer, SrcMem, DstMem, SrcOffset, DstOffset, Size,
1139  NumSyncPointsInWaitList, SyncPointWaitList, SyncPoint);
1140 }
1141 
1143  pi_ext_command_buffer CommandBuffer, pi_mem SrcMem, pi_mem DstMem,
1144  pi_buff_rect_offset SrcOrigin, pi_buff_rect_offset DstOrigin,
1145  pi_buff_rect_region Region, size_t SrcRowPitch, size_t SrcSlicePitch,
1146  size_t DstRowPitch, size_t DstSlicePitch, pi_uint32 NumSyncPointsInWaitList,
1147  const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint) {
1149  CommandBuffer, SrcMem, DstMem, SrcOrigin, DstOrigin, Region, SrcRowPitch,
1150  SrcSlicePitch, DstRowPitch, DstSlicePitch, NumSyncPointsInWaitList,
1151  SyncPointWaitList, SyncPoint);
1152 }
1153 
1155  pi_ext_command_buffer CommandBuffer, pi_mem Buffer, size_t Offset,
1156  size_t Size, void *Dst, pi_uint32 NumSyncPointsInWaitList,
1157  const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint) {
1159  CommandBuffer, Buffer, Offset, Size, Dst, NumSyncPointsInWaitList,
1160  SyncPointWaitList, SyncPoint);
1161 }
1162 
1164  pi_ext_command_buffer CommandBuffer, pi_mem Buffer,
1165  pi_buff_rect_offset BufferOffset, pi_buff_rect_offset HostOffset,
1166  pi_buff_rect_region Region, size_t BufferRowPitch, size_t BufferSlicePitch,
1167  size_t HostRowPitch, size_t HostSlicePitch, void *Ptr,
1168  pi_uint32 NumSyncPointsInWaitList,
1169  const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint) {
1171  CommandBuffer, Buffer, BufferOffset, HostOffset, Region, BufferRowPitch,
1172  BufferSlicePitch, HostRowPitch, HostSlicePitch, Ptr,
1173  NumSyncPointsInWaitList, SyncPointWaitList, SyncPoint);
1174 }
1175 
1177  pi_ext_command_buffer CommandBuffer, pi_mem Buffer, size_t Offset,
1178  size_t Size, const void *Ptr, pi_uint32 NumSyncPointsInWaitList,
1179  const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint) {
1181  CommandBuffer, Buffer, Offset, Size, Ptr, NumSyncPointsInWaitList,
1182  SyncPointWaitList, SyncPoint);
1183 }
1184 
1186  pi_ext_command_buffer CommandBuffer, pi_mem Buffer,
1187  pi_buff_rect_offset BufferOffset, pi_buff_rect_offset HostOffset,
1188  pi_buff_rect_region Region, size_t BufferRowPitch, size_t BufferSlicePitch,
1189  size_t HostRowPitch, size_t HostSlicePitch, const void *Ptr,
1190  pi_uint32 NumSyncPointsInWaitList,
1191  const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint) {
1193  CommandBuffer, Buffer, BufferOffset, HostOffset, Region, BufferRowPitch,
1194  BufferSlicePitch, HostRowPitch, HostSlicePitch, Ptr,
1195  NumSyncPointsInWaitList, SyncPointWaitList, SyncPoint);
1196 }
1197 
1199  pi_ext_command_buffer CommandBuffer, pi_mem Buffer, const void *Pattern,
1200  size_t PatternSize, size_t Offset, size_t Size,
1201  pi_uint32 NumSyncPointsInWaitList,
1202  const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint) {
1204  CommandBuffer, Buffer, Pattern, PatternSize, Offset, Size,
1205  NumSyncPointsInWaitList, SyncPointWaitList, SyncPoint);
1206 }
1207 
1209  void *Ptr, const void *Pattern,
1210  size_t PatternSize, size_t Size,
1211  pi_uint32 NumSyncPointsInWaitList,
1212  const pi_ext_sync_point *SyncPointWaitList,
1213  pi_ext_sync_point *SyncPoint) {
1215  CommandBuffer, Ptr, Pattern, PatternSize, Size, NumSyncPointsInWaitList,
1216  SyncPointWaitList, SyncPoint);
1217 }
1218 
1220  pi_ext_command_buffer CommandBuffer, const void *Ptr, size_t Size,
1221  pi_usm_migration_flags Flags, pi_uint32 NumSyncPointsInWaitList,
1222  const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint) {
1223  return pi2ur::piextCommandBufferPrefetchUSM(CommandBuffer, Ptr, Size, Flags,
1224  NumSyncPointsInWaitList,
1225  SyncPointWaitList, SyncPoint);
1226 }
1227 
1229  pi_ext_command_buffer CommandBuffer, const void *Ptr, size_t Length,
1230  pi_mem_advice Advice, pi_uint32 NumSyncPointsInWaitList,
1231  const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint) {
1232  return pi2ur::piextCommandBufferAdviseUSM(CommandBuffer, Ptr, Length, Advice,
1233  NumSyncPointsInWaitList,
1234  SyncPointWaitList, SyncPoint);
1235 }
1236 
1238  pi_queue Queue,
1239  pi_uint32 NumEventsInWaitList,
1240  const pi_event *EventWaitList,
1241  pi_event *Event) {
1243  CommandBuffer, Queue, NumEventsInWaitList, EventWaitList, Event);
1244 }
1245 
1249  return pi2ur::piextCommandBufferUpdateKernelLaunch(Command, Desc);
1250 }
1251 
1252 pi_result
1255 }
1256 
1257 pi_result
1260 }
1261 
1262 pi_result piextPluginGetOpaqueData(void *opaque_data_param,
1263  void **opaque_data_return) {
1264  return pi2ur::piextPluginGetOpaqueData(opaque_data_param, opaque_data_return);
1265 }
1266 
1267 pi_result piTearDown(void *PluginParameter) {
1268  return pi2ur::piTearDown(PluginParameter);
1269 }
1270 
1271 pi_result piGetDeviceAndHostTimer(pi_device Device, uint64_t *DeviceTime,
1272  uint64_t *HostTime) {
1273  return pi2ur::piGetDeviceAndHostTimer(Device, DeviceTime, HostTime);
1274 }
1275 
1277  pi_device peer_device) {
1278 
1279  return pi2ur::piextEnablePeerAccess(command_device, peer_device);
1280 }
1281 
1283  pi_device peer_device) {
1284 
1285  return pi2ur::piextDisablePeerAccess(command_device, peer_device);
1286 }
1287 
1289  pi_device peer_device, pi_peer_attr attr,
1290  size_t ParamValueSize, void *ParamValue,
1291  size_t *ParamValueSizeRet) {
1292  return pi2ur::piextPeerAccessGetInfo(command_device, peer_device, attr,
1293  ParamValueSize, ParamValue,
1294  ParamValueSizeRet);
1295 }
1296 
1297 pi_result
1300  size_t param_value_size, void *param_value,
1301  size_t *param_value_size_ret) {
1302  return pi2ur::piextVirtualMemGranularityGetInfo(context, device, param_name,
1303  param_value_size, param_value,
1304  param_value_size_ret);
1305 }
1306 
1308  size_t mem_size,
1309  pi_physical_mem *ret_physical_mem) {
1310  return pi2ur::piextPhysicalMemCreate(context, device, mem_size,
1311  ret_physical_mem);
1312 }
1313 
1315  return pi2ur::piextPhysicalMemRetain(physical_mem);
1316 }
1317 
1319  return pi2ur::piextPhysicalMemRelease(physical_mem);
1320 }
1321 
1322 pi_result piextVirtualMemReserve(pi_context context, const void *start,
1323  size_t range_size, void **ret_ptr) {
1324  return pi2ur::piextVirtualMemReserve(context, start, range_size, ret_ptr);
1325 }
1326 
1327 pi_result piextVirtualMemFree(pi_context context, const void *ptr,
1328  size_t range_size) {
1329  return pi2ur::piextVirtualMemFree(context, ptr, range_size);
1330 }
1331 
1332 pi_result piextVirtualMemMap(pi_context context, const void *ptr,
1333  size_t range_size, pi_physical_mem physical_mem,
1334  size_t offset, pi_virtual_access_flags flags) {
1335  return pi2ur::piextVirtualMemMap(context, ptr, range_size, physical_mem,
1336  offset, flags);
1337 }
1338 
1339 pi_result piextVirtualMemUnmap(pi_context context, const void *ptr,
1340  size_t range_size) {
1341  return pi2ur::piextVirtualMemUnmap(context, ptr, range_size);
1342 }
1343 
1345  size_t range_size,
1346  pi_virtual_access_flags flags) {
1347  return pi2ur::piextVirtualMemSetAccess(context, ptr, range_size, flags);
1348 }
1349 
1351  size_t range_size,
1352  pi_virtual_mem_info param_name,
1353  size_t param_value_size, void *param_value,
1354  size_t *param_value_size_ret) {
1355  return pi2ur::piextVirtualMemGetInfo(context, ptr, range_size, param_name,
1356  param_value_size, param_value,
1357  param_value_size_ret);
1358 }
1359 
1360 pi_result
1362  void *Data, pi_uint32 NumMems, const pi_mem *Mems,
1363  pi_uint32 NumEventsInWaitList,
1364  const pi_event *EventWaitList, pi_event *Event) {
1365  return pi2ur::piextEnqueueNativeCommand(Queue, Fn, Data, NumMems, Mems,
1366  NumEventsInWaitList, EventWaitList,
1367  Event);
1368 }
1369 
1371 
1373  // Check that the major version matches in PiVersion and SupportedVersion
1375 
1376  // PI interface supports higher version or the same version.
1377  size_t PluginVersionSize = sizeof(PluginInit->PluginVersion);
1378  if (strlen(SupportedVersion) >= PluginVersionSize)
1379  return PI_ERROR_INVALID_VALUE;
1380  strncpy(PluginInit->PluginVersion, SupportedVersion, PluginVersionSize);
1381 
1382  // Set whole function table to zero to make it easier to detect if
1383  // functions are not set up below.
1384  std::memset(&(PluginInit->PiFunctionTable), 0,
1385  sizeof(PluginInit->PiFunctionTable));
1386 
1387  cuda_tracing_context_t_ *Ctx = createCUDATracingContext();
1388  enableCUDATracing(Ctx);
1389 
1390 // Forward calls to CUDA RT.
1391 #define _PI_API(api) \
1392  (PluginInit->PiFunctionTable).api = (decltype(&::api))(&api);
1393 #include <sycl/detail/pi.def>
1394 #undef _PI_API
1395 
1396  return PI_SUCCESS;
1397 }
1398 
1399 #ifdef _WIN32
1400 #define __SYCL_PLUGIN_DLL_NAME "pi_cuda.dll"
1401 #include "../common_win_pi_trace/common_win_pi_trace.hpp"
1402 #undef __SYCL_PLUGIN_DLL_NAME
1403 #endif
1404 
1405 } // extern "C"
pi_result piextWaitExternalSemaphore(pi_queue Queue, pi_interop_semaphore_handle SemHandle, bool HasWaitValue, pi_uint64 WaitValue, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *Event)
Definition: pi2ur.hpp:5642
pi_result piEnqueueMemImageFill(pi_queue Queue, pi_mem Image, const void *FillColor, const size_t *Origin, const size_t *Region, pi_uint32 NumEventsInWaitList, const pi_event *EventsWaitList, pi_event *Event)
Definition: pi2ur.hpp:2192
pi_result piextCommandBufferMemBufferWriteRect(pi_ext_command_buffer CommandBuffer, pi_mem Buffer, pi_buff_rect_offset BufferOffset, pi_buff_rect_offset HostOffset, pi_buff_rect_region Region, size_t BufferRowPitch, size_t BufferSlicePitch, size_t HostRowPitch, size_t HostSlicePitch, const void *Ptr, pi_uint32 NumSyncPointsInWaitList, const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint)
Definition: pi2ur.hpp:4775
pi_result piProgramGetInfo(pi_program Program, pi_program_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi2ur.hpp:1995
pi_result piextPhysicalMemRetain(pi_physical_mem PhysicalMem)
Definition: pi2ur.hpp:5737
pi_result piextUSMEnqueueFill2D(pi_queue Queue, void *Ptr, size_t Pitch, size_t PatternSize, const void *Pattern, size_t Width, size_t Height, pi_uint32 NumEventsWaitList, const pi_event *EventsWaitList, pi_event *Event)
USM 2D Fill API.
Definition: pi2ur.hpp:3538
pi_result piKernelSetExecInfo(pi_kernel Kernel, pi_kernel_exec_info ParamName, size_t ParamValueSize, const void *ParamValue)
Definition: pi2ur.hpp:2363
pi_result piPlatformGetInfo(pi_platform Platform, pi_platform_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi2ur.hpp:900
pi_result piextUSMEnqueuePrefetch(pi_queue Queue, const void *Ptr, size_t Size, pi_usm_migration_flags Flags, pi_uint32 NumEventsInWaitList, const pi_event *EventsWaitList, pi_event *OutEvent)
Hint to migrate memory to the device.
Definition: pi2ur.hpp:3439
pi_result piextUSMGetMemAllocInfo(pi_context Context, const void *Ptr, pi_mem_alloc_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi2ur.hpp:3576
pi_result piKernelGetGroupInfo(pi_kernel Kernel, pi_device Device, pi_kernel_group_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi2ur.hpp:2485
pi_result piextEnqueueKernelLaunchCustom(pi_queue Queue, pi_kernel Kernel, pi_uint32 WorkDim, const size_t *GlobalWorkSize, const size_t *LocalWorkSize, pi_uint32 NumPropsInLaunchPropList, const pi_launch_property *LaunchPropList, pi_uint32 NumEventsInWaitList, const pi_event *EventsWaitList, pi_event *OutEvent)
Definition: pi2ur.hpp:3781
pi_result piQueueGetInfo(pi_queue Queue, pi_queue_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi2ur.hpp:1852
pi_result piMemRetain(pi_mem Mem)
Definition: pi2ur.hpp:3410
pi_result piPlatformsGet(pi_uint32 NumEntries, pi_platform *Platforms, pi_uint32 *NumPlatforms)
Definition: pi2ur.hpp:848
pi_result piEnqueueEventsWait(pi_queue Queue, pi_uint32 NumEventsInWaitList, const pi_event *EventsWaitList, pi_event *OutEvent)
Definition: pi2ur.hpp:4203
pi_result piextKernelSuggestMaxCooperativeGroupCount(pi_kernel Kernel, size_t LocalWorkSize, size_t DynamicSharedMemorySize, pi_uint32 *GroupCountRet)
Definition: pi2ur.hpp:2677
pi_result piextVirtualMemSetAccess(pi_context Context, const void *Ptr, size_t RangeSize, pi_virtual_access_flags Flags)
Definition: pi2ur.hpp:5784
pi_result piEnqueueMemUnmap(pi_queue Queue, pi_mem Mem, void *MappedPtr, pi_uint32 NumEventsInWaitList, const pi_event *EventsWaitList, pi_event *OutEvent)
Definition: pi2ur.hpp:3921
pi_result piextDeviceGetNativeHandle(pi_device Device, pi_native_handle *NativeHandle)
Definition: pi2ur.hpp:1368
pi_result piextMemSampledImageCreate(pi_context Context, pi_device Device, pi_image_mem_handle ImgMem, pi_image_format *ImageFormat, pi_image_desc *ImageDesc, pi_sampler Sampler, pi_image_handle *RetHandle)
Definition: pi2ur.hpp:5122
pi_result piextCommandBufferUpdateKernelLaunch(pi_ext_command_buffer_command command, pi_ext_command_buffer_update_kernel_launch_desc *desc)
Definition: pi2ur.hpp:4939
pi_result piProgramRelease(pi_program Program)
Definition: pi2ur.hpp:2563
pi_result piextCommandBufferPrefetchUSM(pi_ext_command_buffer CommandBuffer, const void *Ptr, size_t Size, pi_usm_migration_flags Flags, pi_uint32 NumSyncPointsInWaitList, const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint)
Definition: pi2ur.hpp:4855
pi_result piEnqueueMemImageWrite(pi_queue Queue, pi_mem Image, pi_bool BlockingWrite, pi_image_offset Origin, pi_image_region Region, size_t InputRowPitch, size_t InputSlicePitch, const void *Ptr, pi_uint32 NumEventsInWaitList, const pi_event *EventsWaitList, pi_event *OutEvent)
Definition: pi2ur.hpp:3833
pi_result piPluginGetBackendOption(pi_platform Platform, const char *FrontendOption, const char **PlatformOption)
Definition: pi2ur.hpp:960
pi_result piextVirtualMemMap(pi_context Context, const void *Ptr, size_t RangeSize, pi_physical_mem PhysicalMem, size_t Offset, pi_virtual_access_flags Flags)
Definition: pi2ur.hpp:5804
pi_result piextCommandBufferNDRangeKernel(pi_ext_command_buffer CommandBuffer, pi_kernel Kernel, pi_uint32 WorkDim, const size_t *GlobalWorkOffset, const size_t *GlobalWorkSize, const size_t *LocalWorkSize, pi_uint32 NumSyncPointsInWaitList, const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint, pi_ext_command_buffer_command *Command)
Definition: pi2ur.hpp:4647
pi_result piextPluginGetOpaqueData(void *opaque_data_param, void **opaque_data_return)
Definition: pi2ur.hpp:953
pi_result piKernelCreate(pi_program Program, const char *KernelName, pi_kernel *RetKernel)
Definition: pi2ur.hpp:2175
pi_result piextUSMImport(const void *HostPtr, size_t Size, pi_context Context)
Definition: pi2ur.hpp:3618
pi_result piEnqueueKernelLaunch(pi_queue Queue, pi_kernel Kernel, pi_uint32 WorkDim, const size_t *GlobalWorkOffset, const size_t *GlobalWorkSize, const size_t *LocalWorkSize, pi_uint32 NumEventsInWaitList, const pi_event *EventsWaitList, pi_event *OutEvent)
Definition: pi2ur.hpp:3733
pi_result piEventSetStatus(pi_event Event, pi_int32 ExecutionStatus)
Definition: pi2ur.hpp:4412
pi_result piEventSetCallback(pi_event Event, pi_int32 CommandExecCallbackType, void(*PFnNotify)(pi_event Event, pi_int32 EventCommandStatus, void *UserData), void *UserData)
Definition: pi2ur.hpp:4399
pi_result piextVirtualMemUnmap(pi_context Context, const void *Ptr, size_t RangeSize)
Definition: pi2ur.hpp:5829
pi_result piSamplerCreate(pi_context Context, const pi_sampler_properties *SamplerProperties, pi_sampler *RetSampler)
Definition: pi2ur.hpp:4459
pi_result piSamplerGetInfo(pi_sampler Sampler, pi_sampler_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi2ur.hpp:4520
pi_result piextMemUnsampledImageHandleDestroy(pi_context Context, pi_device Device, pi_image_handle Handle)
Definition: pi2ur.hpp:5371
pi_result piextKernelSetArgSampler(pi_kernel Kernel, pi_uint32 ArgIndex, const pi_sampler *ArgValue)
Definition: pi2ur.hpp:4558
pi_result piextQueueCreateWithNativeHandle(pi_native_handle NativeHandle, int32_t NativeHandleDesc, pi_context Context, pi_device Device, bool OwnNativeHandle, pi_queue_properties *Properties, pi_queue *Queue)
Definition: pi2ur.hpp:1766
pi_result piextVirtualMemFree(pi_context Context, const void *Ptr, size_t RangeSize)
Definition: pi2ur.hpp:5771
pi_result piMemImageGetInfo(pi_mem Image, pi_image_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi2ur.hpp:3641
pi_result piextCommandBufferMemBufferWrite(pi_ext_command_buffer CommandBuffer, pi_mem Buffer, size_t Offset, size_t Size, const void *Ptr, pi_uint32 NumSyncPointsInWaitList, const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint)
Definition: pi2ur.hpp:4806
pi_result piextMemMapExternalArray(pi_context Context, pi_device Device, pi_image_format *ImageFormat, pi_image_desc *ImageDesc, pi_interop_mem_handle MemHandle, pi_image_mem_handle *RetMem)
Definition: pi2ur.hpp:5518
pi_result piProgramCreateWithBinary(pi_context Context, pi_uint32 NumDevices, const pi_device *DeviceList, const size_t *Lengths, const unsigned char **Binaries, size_t NumMetadataEntries, const pi_device_binary_property *Metadata, pi_int32 *BinaryStatus, pi_program *Program)
Definition: pi2ur.hpp:1949
pi_result piextProgramGetNativeHandle(pi_program Program, pi_native_handle *NativeHandle)
Definition: pi2ur.hpp:2408
pi_result piKernelGetInfo(pi_kernel Kernel, pi_kernel_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi2ur.hpp:2443
pi_result piextEventGetNativeHandle(pi_event Event, pi_native_handle *NativeHandle)
Definition: pi2ur.hpp:4308
pi_result piEnqueueEventsWaitWithBarrier(pi_queue Queue, pi_uint32 NumEventsInWaitList, const pi_event *EventsWaitList, pi_event *OutEvent)
Definition: pi2ur.hpp:4184
pi_result piextMemMipmapFree(pi_context Context, pi_device Device, pi_image_mem_handle MemoryHandle)
Definition: pi2ur.hpp:5291
pi_result piextPlatformGetNativeHandle(pi_platform Platform, pi_native_handle *NativeHandle)
Definition: pi2ur.hpp:861
pi_result piextPhysicalMemRelease(pi_physical_mem PhysicalMem)
Definition: pi2ur.hpp:5748
pi_result piSamplerRelease(pi_sampler Sampler)
Definition: pi2ur.hpp:4580
pi_result piMemBufferCreate(pi_context Context, pi_mem_flags Flags, size_t Size, void *HostPtr, pi_mem *RetMem, const pi_mem_properties *properties)
Definition: pi2ur.hpp:2762
pi_result piEnqueueMemBufferWrite(pi_queue Queue, pi_mem Buffer, pi_bool BlockingWrite, size_t Offset, size_t Size, const void *Ptr, pi_uint32 NumEventsInWaitList, const pi_event *EventsWaitList, pi_event *OutEvent)
Definition: pi2ur.hpp:4102
pi_result piextCommandBufferMemBufferReadRect(pi_ext_command_buffer CommandBuffer, pi_mem Buffer, pi_buff_rect_offset BufferOffset, pi_buff_rect_offset HostOffset, pi_buff_rect_region Region, size_t BufferRowPitch, size_t BufferSlicePitch, size_t HostRowPitch, size_t HostSlicePitch, void *Ptr, pi_uint32 NumSyncPointsInWaitList, const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint)
Definition: pi2ur.hpp:4728
pi_result piDevicesGet(pi_platform Platform, pi_device_type DeviceType, pi_uint32 NumEntries, pi_device *Devices, pi_uint32 *NumDevices)
Definition: pi2ur.hpp:976
pi_result piextEnqueueDeviceGlobalVariableWrite(pi_queue Queue, pi_program Program, const char *Name, pi_bool BlockingWrite, size_t Count, size_t Offset, const void *Src, pi_uint32 NumEventsInWaitList, const pi_event *EventsWaitList, pi_event *OutEvent)
API for writing data from host to a device global variable.
Definition: pi2ur.hpp:2703
pi_result piextEventCreateWithNativeHandle(pi_native_handle NativeHandle, pi_context Context, bool OwnNativeHandle, pi_event *Event)
Definition: pi2ur.hpp:4376
pi_result piEventGetProfilingInfo(pi_event Event, pi_profiling_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi2ur.hpp:4323
pi_result piKernelRetain(pi_kernel Kernel)
Definition: pi2ur.hpp:2541
pi_result piextKernelSetArgMemObj(pi_kernel Kernel, pi_uint32 ArgIndex, const pi_mem_obj_property *ArgProperties, const pi_mem *ArgValue)
Definition: pi2ur.hpp:2248
pi_result piextQueueGetNativeHandle(pi_queue Queue, pi_native_handle *NativeHandle, int32_t *NativeHandleDesc)
Definition: pi2ur.hpp:1811
pi_result piextBindlessImageSamplerCreate(pi_context Context, const pi_sampler_properties *SamplerProperties, float MinMipmapLevelClamp, float MaxMipmapLevelClamp, float MaxAnisotropy, pi_sampler *RetSampler)
Definition: pi2ur.hpp:5149
pi_result piextUSMDeviceAlloc(void **ResultPtr, pi_context Context, pi_device Device, pi_usm_mem_properties *Properties, size_t Size, pi_uint32 Alignment)
Definition: pi2ur.hpp:3284
pi_result piProgramGetBuildInfo(pi_program Program, pi_device Device, pi_program_build_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi2ur.hpp:2623
pi_result piQueueFlush(pi_queue Queue)
Definition: pi2ur.hpp:1913
pi_result piextKernelSetArgPointer(pi_kernel Kernel, pi_uint32 ArgIndex, size_t, const void *ArgValue)
Definition: pi2ur.hpp:2575
pi_result piEnqueueTimestampRecordingExp(pi_queue Queue, pi_bool Blocking, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *Event)
Definition: pi2ur.hpp:4437
pi_result piProgramLink(pi_context Context, pi_uint32 NumDevices, const pi_device *DeviceList, const char *Options, pi_uint32 NumInputPrograms, const pi_program *InputPrograms, void(*PFnNotify)(pi_program Program, void *UserData), void *UserData, pi_program *RetProgram)
Definition: pi2ur.hpp:2055
pi_result piSamplerRetain(pi_sampler Sampler)
Definition: pi2ur.hpp:4569
pi_result piextDeviceSelectBinary(pi_device Device, pi_device_binary *Binaries, pi_uint32 NumBinaries, pi_uint32 *SelectedBinaryInd)
Definition: pi2ur.hpp:1489
pi_result piextContextSetExtendedDeleter(pi_context Context, pi_context_extended_deleter Function, void *UserData)
Definition: pi2ur.hpp:1568
pi_result piextCommandBufferMemBufferRead(pi_ext_command_buffer CommandBuffer, pi_mem Src, size_t Offset, size_t Size, void *Dst, pi_uint32 NumSyncPointsInWaitList, const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint)
Definition: pi2ur.hpp:4758
pi_result piextReleaseExternalSemaphore(pi_context Context, pi_device Device, pi_interop_semaphore_handle SemHandle)
Definition: pi2ur.hpp:5626
pi_result piextGetDeviceFunctionPointer(pi_device Device, pi_program Program, const char *FunctionName, pi_uint64 *FunctionPointerRet)
Definition: pi2ur.hpp:2211
pi_result piEnqueueMemBufferCopyRect(pi_queue Queue, pi_mem SrcMem, pi_mem DstMem, pi_buff_rect_offset SrcOrigin, pi_buff_rect_offset DstOrigin, pi_buff_rect_region Region, size_t SrcRowPitch, size_t SrcSlicePitch, size_t DstRowPitch, size_t DstSlicePitch, pi_uint32 NumEventsInWaitList, const pi_event *EventsWaitList, pi_event *OutEvent)
Definition: pi2ur.hpp:3989
pi_result piextMemMipmapGetLevel(pi_context Context, pi_device Device, pi_image_mem_handle MipMem, unsigned int Level, pi_image_mem_handle *RetMem)
Definition: pi2ur.hpp:5256
pi_result piGetDeviceAndHostTimer(pi_device Device, uint64_t *DeviceTime, uint64_t *HostTime)
Definition: pi2ur.hpp:1481
pi_result piEventGetInfo(pi_event Event, pi_event_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi2ur.hpp:4279
pi_result piMemBufferPartition(pi_mem Buffer, pi_mem_flags Flags, pi_buffer_create_type BufferCreateType, void *BufferCreateInfo, pi_mem *RetMem)
Definition: pi2ur.hpp:3171
pi_result piEnqueueMemBufferCopy(pi_queue Queue, pi_mem SrcMem, pi_mem DstMem, size_t SrcOffset, size_t DstOffset, size_t Size, pi_uint32 NumEventsInWaitList, const pi_event *EventsWaitList, pi_event *OutEvent)
Definition: pi2ur.hpp:4023
pi_result piContextCreate(const pi_context_properties *Properties, pi_uint32 NumDevices, const pi_device *Devices, void(*PFnNotify)(const char *ErrInfo, const void *PrivateInfo, size_t CB, void *UserData), void *UserData, pi_context *RetContext)
Definition: pi2ur.hpp:1548
pi_result piextUSMPitchedAlloc(void **ResultPtr, size_t *ResultPitch, pi_context Context, pi_device Device, pi_usm_mem_properties *Properties, size_t WidthInBytes, size_t Height, unsigned int ElementSizeBytes)
Definition: pi2ur.hpp:3318
pi_result piextUSMRelease(const void *HostPtr, pi_context Context)
Definition: pi2ur.hpp:3630
pi_result piEventRelease(pi_event Event)
Definition: pi2ur.hpp:4428
pi_result piKernelGetSubGroupInfo(pi_kernel Kernel, pi_device Device, pi_kernel_sub_group_info ParamName, size_t InputValueSize, const void *InputValue, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi2ur.hpp:2586
pi_result piQueueRetain(pi_queue Queue)
Definition: pi2ur.hpp:1902
pi_result piextCommandBufferReleaseCommand(pi_ext_command_buffer_command command)
Definition: pi2ur.hpp:5005
pi_result piDeviceRelease(pi_device Device)
Definition: pi2ur.hpp:1014
pi_result piContextRetain(pi_context Context)
Definition: pi2ur.hpp:1670
pi_result piextMemImageAllocate(pi_context Context, pi_device Device, pi_image_format *ImageFormat, pi_image_desc *ImageDesc, pi_image_mem_handle *RetMem)
Definition: pi2ur.hpp:5073
pi_result piextUSMHostAlloc(void **ResultPtr, pi_context Context, pi_usm_mem_properties *Properties, size_t Size, pi_uint32 Alignment)
Definition: pi2ur.hpp:2837
pi_result piextCommandBufferRetain(pi_ext_command_buffer CommandBuffer)
Definition: pi2ur.hpp:4618
pi_result piDeviceGetInfo(pi_device Device, pi_device_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi2ur.hpp:1039
pi_result piextMemImageGetInfo(pi_context Context, pi_image_mem_handle MemHandle, pi_image_info ParamName, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi2ur.hpp:5422
pi_result piextImportExternalMemory(pi_context Context, pi_device Device, pi_external_mem_descriptor *MemDescriptor, pi_interop_mem_handle *RetHandle)
Definition: pi2ur.hpp:5453
pi_result piextVirtualMemGetInfo(pi_context Context, const void *Ptr, size_t RangeSize, pi_virtual_mem_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi2ur.hpp:5842
pi_result piextCommandBufferAdviseUSM(pi_ext_command_buffer CommandBuffer, const void *Ptr, size_t Length, pi_mem_advice Advice, pi_uint32 NumSyncPointsInWaitList, const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint)
Definition: pi2ur.hpp:4876
pi_result piextKernelCreateWithNativeHandle(pi_native_handle NativeHandle, pi_context Context, pi_program Program, bool OwnNativeHandle, pi_kernel *Kernel)
Definition: pi2ur.hpp:2332
pi_result piextMemSampledImageHandleDestroy(pi_context Context, pi_device Device, pi_image_handle Handle)
Definition: pi2ur.hpp:5386
pi_result piEnqueueMemBufferFill(pi_queue Queue, pi_mem Buffer, const void *Pattern, size_t PatternSize, size_t Offset, size_t Size, pi_uint32 NumEventsInWaitList, const pi_event *EventsWaitList, pi_event *OutEvent)
Definition: pi2ur.hpp:3943
pi_result piextDeviceCreateWithNativeHandle(pi_native_handle NativeHandle, pi_platform Platform, pi_device *Device)
Definition: pi2ur.hpp:1382
pi_result piextUSMEnqueueMemcpy2D(pi_queue Queue, pi_bool Blocking, void *DstPtr, size_t DstPitch, const void *SrcPtr, size_t SrcPitch, size_t Width, size_t Height, pi_uint32 NumEventsInWaitList, const pi_event *EventsWaitList, pi_event *OutEvent)
USM 2D Memcpy API.
Definition: pi2ur.hpp:3700
pi_result piEnqueueMemBufferMap(pi_queue Queue, pi_mem Mem, pi_bool BlockingMap, pi_map_flags MapFlags, size_t Offset, size_t Size, pi_uint32 NumEventsInWaitList, const pi_event *EventsWaitList, pi_event *OutEvent, void **RetMap)
Definition: pi2ur.hpp:3888
pi_result piextCommandBufferRetainCommand(pi_ext_command_buffer_command command)
Definition: pi2ur.hpp:4997
pi_result piextEnqueueCommandBuffer(pi_ext_command_buffer CommandBuffer, pi_queue Queue, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *Event)
Definition: pi2ur.hpp:4919
pi_result piextCommandBufferCreate(pi_context Context, pi_device Device, const pi_ext_command_buffer_desc *Desc, pi_ext_command_buffer *RetCommandBuffer)
Definition: pi2ur.hpp:4598
pi_result piextEnqueueCooperativeKernelLaunch(pi_queue Queue, pi_kernel Kernel, pi_uint32 WorkDim, const size_t *GlobalWorkOffset, const size_t *GlobalWorkSize, const size_t *LocalWorkSize, pi_uint32 NumEventsInWaitList, const pi_event *EventsWaitList, pi_event *OutEvent)
Definition: pi2ur.hpp:3757
pi_result piextUSMEnqueueMemset2D(pi_queue Queue, void *Ptr, size_t Pitch, int Value, size_t Width, size_t Height, pi_uint32 NumEventsWaitList, const pi_event *EventsWaitList, pi_event *Event)
Definition: pi2ur.hpp:3557
pi_result piEnqueueMemImageCopy(pi_queue Queue, pi_mem SrcImage, pi_mem DstImage, pi_image_offset SrcOrigin, pi_image_offset DstOrigin, pi_image_region Region, pi_uint32 NumEventsInWaitList, const pi_event *EventsWaitList, pi_event *OutEvent)
Definition: pi2ur.hpp:3233
pi_result piextMemImageCreateWithNativeHandle(pi_native_handle NativeHandle, pi_context Context, bool OwnNativeHandle, const pi_image_format *ImageFormat, const pi_image_desc *ImageDesc, pi_mem *RetImage)
Definition: pi2ur.hpp:3143
pi_result piextQueueCreate(pi_context Context, pi_device Device, pi_queue_properties *Properties, pi_queue *Queue)
Definition: pi2ur.hpp:1689
pi_result piextProgramCreateWithNativeHandle(pi_native_handle NativeHandle, pi_context Context, bool OwnNativeHandle, pi_program *Program)
Definition: pi2ur.hpp:2424
pi_result piextImportExternalSemaphore(pi_context Context, pi_device Device, pi_external_semaphore_descriptor *SemDescriptor, pi_interop_semaphore_handle *RetHandle)
Definition: pi2ur.hpp:5559
pi_result piextUSMFree(pi_context Context, void *Ptr)
Definition: pi2ur.hpp:3403
pi_result piextEnqueueDeviceGlobalVariableRead(pi_queue Queue, pi_program Program, const char *Name, pi_bool BlockingRead, size_t Count, size_t Offset, void *Dst, pi_uint32 NumEventsInWaitList, const pi_event *EventsWaitList, pi_event *OutEvent)
API reading data from a device global variable to host.
Definition: pi2ur.hpp:2735
pi_result piEventCreate(pi_context Context, pi_event *RetEvent)
Definition: pi2ur.hpp:4361
pi_result piextKernelGetNativeHandle(pi_kernel Kernel, pi_native_handle *NativeHandle)
Definition: pi2ur.hpp:2663
pi_result piQueueFinish(pi_queue Queue)
Definition: pi2ur.hpp:1841
pi_result piextCommandBufferMemBufferFill(pi_ext_command_buffer CommandBuffer, pi_mem Buffer, const void *Pattern, size_t PatternSize, size_t Offset, size_t Size, pi_uint32 NumSyncPointsInWaitList, const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint)
Definition: pi2ur.hpp:4824
pi_result piContextRelease(pi_context Context)
Definition: pi2ur.hpp:1678
pi_result piextUSMEnqueueFill(pi_queue Queue, void *Ptr, const void *Pattern, size_t PatternSize, size_t Count, pi_uint32 NumEventsInWaitList, const pi_event *EventsWaitList, pi_event *OutEvent)
Definition: pi2ur.hpp:3965
pi_result piextPlatformCreateWithNativeHandle(pi_native_handle NativeHandle, pi_platform *Platform)
Definition: pi2ur.hpp:878
pi_result piextMemReleaseInterop(pi_context Context, pi_device Device, pi_interop_mem_handle ExtMem)
Definition: pi2ur.hpp:5543
pi_result piKernelSetArg(pi_kernel Kernel, pi_uint32 ArgIndex, size_t ArgSize, const void *ArgValue)
Definition: pi2ur.hpp:2303
pi_result piEventRetain(pi_event Event)
Definition: pi2ur.hpp:4419
pi_result piextVirtualMemGranularityGetInfo(pi_context Context, pi_device Device, pi_virtual_mem_granularity_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi2ur.hpp:5689
pi_result piextContextGetNativeHandle(pi_context Context, pi_native_handle *NativeHandle)
Definition: pi2ur.hpp:1577
pi_result piMemRelease(pi_mem Mem)
Definition: pi2ur.hpp:3420
pi_result piextMemImageCopy(pi_queue Queue, void *DstPtr, const void *SrcPtr, const pi_image_desc *SrcImageDesc, const pi_image_desc *DstImageDesc, const pi_image_format *SrcImageFormat, const pi_image_format *DstImageFormat, const pi_image_copy_flags Flags, pi_image_offset SrcOffset, pi_image_offset DstOffset, pi_image_region CopyExtent, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *Event)
Definition: pi2ur.hpp:5324
pi_result piextUSMEnqueueMemcpy(pi_queue Queue, pi_bool Blocking, void *DstPtr, const void *SrcPtr, size_t Size, pi_uint32 NumEventsInWaitList, const pi_event *EventsWaitList, pi_event *OutEvent)
Definition: pi2ur.hpp:4048
pi_result piextCommandBufferFinalize(pi_ext_command_buffer CommandBuffer)
Definition: pi2ur.hpp:4638
pi_result piPluginGetLastError(char **Message)
Definition: pi2ur.hpp:1022
pi_result piEnqueueMemImageRead(pi_queue Queue, pi_mem Image, pi_bool BlockingRead, pi_image_offset Origin, pi_image_region Region, size_t RowPitch, size_t SlicePitch, void *Ptr, pi_uint32 NumEventsInWaitList, const pi_event *EventsWaitList, pi_event *OutEvent)
Definition: pi2ur.hpp:3862
pi_result piKernelRelease(pi_kernel Kernel)
Definition: pi2ur.hpp:2552
pi_result piextMemImageFree(pi_context Context, pi_device Device, pi_image_mem_handle MemoryHandle)
Definition: pi2ur.hpp:5275
pi_result piextMemUnsampledImageCreate(pi_context Context, pi_device Device, pi_image_mem_handle ImgMem, pi_image_format *ImageFormat, pi_image_desc *ImageDesc, pi_image_handle *RetHandle)
Definition: pi2ur.hpp:5096
pi_result piextContextCreateWithNativeHandle(pi_native_handle NativeHandle, pi_uint32 NumDevices, const pi_device *Devices, bool OwnNativeHandle, pi_context *RetContext)
Definition: pi2ur.hpp:1588
pi_result piextPeerAccessGetInfo(pi_device command_device, pi_device peer_device, pi_peer_attr attr, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
Definition: pi2ur.hpp:5039
pi_result piQueueRelease(pi_queue Queue)
Definition: pi2ur.hpp:1831
pi_result piextCommandBufferRelease(pi_ext_command_buffer CommandBuffer)
Definition: pi2ur.hpp:4628
pi_result piContextGetInfo(pi_context Context, pi_context_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi2ur.hpp:1615
pi_result piextCommandBufferMemBufferCopy(pi_ext_command_buffer CommandBuffer, pi_mem SrcMem, pi_mem DstMem, size_t SrcOffset, size_t DstOffset, size_t Size, pi_uint32 NumSyncPointsInWaitList, const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint)
Definition: pi2ur.hpp:4681
pi_result piextCommandBufferFillUSM(pi_ext_command_buffer CommandBuffer, void *Ptr, const void *Pattern, size_t PatternSize, size_t Size, pi_uint32 NumSyncPointsInWaitList, const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint)
Definition: pi2ur.hpp:4841
pi_result piextMemGetNativeHandle(pi_mem Mem, pi_device Dev, pi_native_handle *NativeHandle)
Definition: pi2ur.hpp:3218
pi_result piextGetGlobalVariablePointer(pi_device Device, pi_program Program, const char *GlobalVariableName, size_t *GlobalVariableSize, void **GlobalVariablePointerRet)
Definition: pi2ur.hpp:2230
pi_result piextVirtualMemReserve(pi_context Context, const void *Start, size_t RangeSize, void **RetPtr)
Definition: pi2ur.hpp:5758
pi_result piextSignalExternalSemaphore(pi_queue Queue, pi_interop_semaphore_handle SemHandle, bool HasSignalValue, pi_uint64 SignalValue, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *Event)
Definition: pi2ur.hpp:5662
pi_result piTearDown(void *PluginParameter)
Definition: pi2ur.hpp:808
pi_result piextDisablePeerAccess(pi_device command_device, pi_device peer_device)
Definition: pi2ur.hpp:5028
pi_result piextCommandBufferMemBufferCopyRect(pi_ext_command_buffer CommandBuffer, pi_mem SrcMem, pi_mem DstMem, pi_buff_rect_offset SrcOrigin, pi_buff_rect_offset DstOrigin, pi_buff_rect_region Region, size_t SrcRowPitch, size_t SrcSlicePitch, size_t DstRowPitch, size_t DstSlicePitch, pi_uint32 NumSyncPointsInWaitList, const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint)
Definition: pi2ur.hpp:4699
pi_result piextEnablePeerAccess(pi_device command_device, pi_device peer_device)
Definition: pi2ur.hpp:5018
pi_result piDevicePartition(pi_device Device, const pi_device_partition_property *Properties, pi_uint32 NumEntries, pi_device *SubDevices, pi_uint32 *NumSubDevices)
Definition: pi2ur.hpp:1405
pi_result piEnqueueMemBufferReadRect(pi_queue Queue, pi_mem Buffer, pi_bool BlockingRead, pi_buff_rect_offset BufferOffset, pi_buff_rect_offset HostOffset, pi_buff_rect_region Region, size_t BufferRowPitch, size_t BufferSlicePitch, size_t HostRowPitch, size_t HostSlicePitch, void *Ptr, pi_uint32 NumEventsInWaitList, const pi_event *EventsWaitList, pi_event *OutEvent)
Definition: pi2ur.hpp:4126
pi_result piMemImageCreate(pi_context Context, pi_mem_flags Flags, const pi_image_format *ImageFormat, const pi_image_desc *ImageDesc, void *HostPtr, pi_mem *RetImage)
Definition: pi2ur.hpp:3101
pi_result piProgramBuild(pi_program Program, pi_uint32 NumDevices, const pi_device *DeviceList, const char *Options, void(*PFnNotify)(pi_program Program, void *UserData), void *UserData)
Definition: pi2ur.hpp:2129
pi_result piEnqueueMemBufferWriteRect(pi_queue Queue, pi_mem Buffer, pi_bool BlockingWrite, pi_buff_rect_offset BufferOffset, pi_buff_rect_offset HostOffset, pi_buff_rect_region Region, size_t BufferRowPitch, size_t BufferSlicePitch, size_t HostRowPitch, size_t HostSlicePitch, const void *Ptr, pi_uint32 NumEventsInWaitList, const pi_event *EventsWaitList, pi_event *OutEvent)
Definition: pi2ur.hpp:4068
pi_result piProgramRetain(pi_program Program)
Definition: pi2ur.hpp:2352
pi_result piextUSMEnqueueMemAdvise(pi_queue Queue, const void *Ptr, size_t Length, pi_mem_advice Advice, pi_event *OutEvent)
USM memadvise API to govern behavior of automatic migration mechanisms.
Definition: pi2ur.hpp:3476
pi_result piextProgramSetSpecializationConstant(pi_program Program, pi_uint32 SpecID, size_t Size, const void *SpecValue)
Definition: pi2ur.hpp:2158
pi_result piextUSMSharedAlloc(void **ResultPtr, pi_context Context, pi_device Device, pi_usm_mem_properties *Properties, size_t Size, pi_uint32 Alignment)
Definition: pi2ur.hpp:3339
pi_result piEnqueueMemBufferRead(pi_queue Queue, pi_mem Src, pi_bool BlockingRead, size_t Offset, size_t Size, void *Dst, pi_uint32 NumEventsInWaitList, const pi_event *EventsWaitList, pi_event *OutEvent)
Definition: pi2ur.hpp:4161
pi_result piProgramCreate(pi_context Context, const void *ILBytes, size_t Length, pi_program *Program)
Definition: pi2ur.hpp:1930
pi_result piEventsWait(pi_uint32 NumEvents, const pi_event *EventsWaitList)
Definition: pi2ur.hpp:4265
pi_result piDeviceRetain(pi_device Device)
Definition: pi2ur.hpp:1007
pi_result piextCommandBufferMemcpyUSM(pi_ext_command_buffer CommandBuffer, void *DstPtr, const void *SrcPtr, size_t Size, pi_uint32 NumSyncPointsInWaitList, const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint)
Definition: pi2ur.hpp:4667
pi_result piextMemCreateWithNativeHandle(pi_native_handle NativeHandle, pi_context Context, bool OwnNativeHandle, pi_mem *Mem)
Definition: pi2ur.hpp:3264
pi_result piMemGetInfo(pi_mem Mem, pi_mem_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi2ur.hpp:2867
pi_result piextEnqueueNativeCommand(pi_queue Queue, pi_enqueue_native_command_function Fn, void *Data, pi_uint32 NumMems, const pi_mem *MemList, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *Event)
Definition: pi2ur.hpp:5877
pi_result piProgramCompile(pi_program Program, pi_uint32 NumDevices, const pi_device *DeviceList, const char *Options, pi_uint32 NumInputHeaders, const pi_program *InputHeaders, const char **HeaderIncludeNames, void(*PFnNotify)(pi_program Program, void *UserData), void *UserData)
Definition: pi2ur.hpp:2091
pi_result piextPhysicalMemCreate(pi_context Context, pi_device Device, size_t MemSize, pi_physical_mem *RetPhyscialMem)
Definition: pi2ur.hpp:5718
#define PI_ASSERT(condition, error)
Definition: pi2ur.hpp:156
pi_bitfield pi_virtual_access_flags
Definition: pi.h:884
void(*)(pi_queue, void *) pi_enqueue_native_command_function
Definition: pi.h:1301
int32_t pi_int32
Definition: pi.h:253
uintptr_t pi_native_handle
Definition: pi.h:258
pi_bitfield pi_map_flags
Definition: pi.h:844
_pi_result
Definition: pi.h:265
pi_uint32 pi_bool
Definition: pi.h:256
pi_bitfield pi_usm_mem_properties
Definition: pi.h:856
_pi_device_info
Definition: pi.h:346
_pi_queue_info
Definition: pi.h:563
_pi_mem_advice
Definition: pi.h:666
_pi_kernel_sub_group_info
Definition: pi.h:605
pi_bitfield pi_mem_properties
Definition: pi.h:850
_pi_kernel_group_info
Definition: pi.h:584
pi_uint64 pi_image_handle
Definition: pi.h:1296
_pi_ext_command_buffer_command * pi_ext_command_buffer_command
Definition: pi.h:2643
_pi_kernel_exec_info
Definition: pi.h:1762
_pi_platform_info
Definition: pi.h:280
_pi_image_info
Definition: pi.h:595
pi_uint32 pi_ext_sync_point
Definition: pi.h:2644
_pi_profiling_info
Definition: pi.h:823
_pi_usm_migration_flags
Definition: pi.h:2148
_pi_device_type
Definition: pi.h:313
uint64_t pi_uint64
Definition: pi.h:255
pi_bitfield pi_queue_properties
Definition: pi.h:869
_pi_image_copy_flags
Definition: pi.h:743
pi_bitfield pi_sampler_properties
Definition: pi.h:800
_pi_buffer_create_type
Definition: pi.h:749
uint32_t pi_uint32
Definition: pi.h:254
_pi_event_info
Definition: pi.h:612
intptr_t pi_context_properties
Definition: pi.h:792
pi_bitfield pi_mem_flags
Definition: pi.h:834
constexpr pi_queue_properties PI_QUEUE_FLAGS
Definition: pi.h:870
_pi_virtual_mem_info
Definition: pi.h:788
void(* pi_context_extended_deleter)(void *user_data)
Definition: pi.h:1502
_pi_sampler_info
Definition: pi.h:754
_pi_kernel_info
Definition: pi.h:575
_pi_mem_alloc_info
Definition: pi.h:2131
_pi_context_info
Definition: pi.h:546
void * pi_image_mem_handle
Definition: pi.h:1297
#define _PI_PLUGIN_VERSION_CHECK(PI_API_VERSION, PI_PLUGIN_VERSION)
Definition: pi.h:231
_pi_program_info
Definition: pi.h:534
intptr_t pi_device_partition_property
Definition: pi.h:935
_pi_mem_info
Definition: pi.h:1324
_pi_virtual_mem_granularity_info
Definition: pi.h:783
pi_uint64 pi_interop_semaphore_handle
Definition: pi.h:1299
_pi_peer_attr
Definition: pi.h:1326
pi_uint64 pi_interop_mem_handle
Definition: pi.h:1298
_pi_program_build_info
Definition: pi.h:289
C++ wrapper of extern "C" PI interfaces.
pi_result piextReleaseExternalSemaphore(pi_context Context, pi_device Device, pi_interop_semaphore_handle SemHandle)
API to release the external semaphore.
Definition: pi_cuda.cpp:488
pi_result piextContextSetExtendedDeleter(pi_context Context, pi_context_extended_deleter Function, void *UserData)
Definition: pi_cuda.cpp:132
pi_result piextQueueCreateWithNativeHandle(pi_native_handle NativeHandle, int32_t NativeHandleDesc, pi_context Context, pi_device Device, bool OwnNativeHandle, pi_queue_properties *Properties, pi_queue *Queue)
Creates PI queue object from a native handle.
Definition: pi_cuda.cpp:198
pi_result piextDisablePeerAccess(pi_device command_device, pi_device peer_device)
Definition: pi_cuda.cpp:1282
pi_result piDeviceGetInfo(pi_device Device, pi_device_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Returns requested info for provided native device Return PI_DEVICE_INFO_EXTENSION_DEVICELIB_ASSERT fo...
Definition: pi_cuda.cpp:78
pi_result piMemBufferCreate(pi_context Context, pi_mem_flags Flags, size_t Size, void *HostPtr, pi_mem *RetMem, const pi_mem_properties *properties)
Definition: pi_cuda.cpp:210
pi_result piMemRelease(pi_mem Mem)
Definition: pi_cuda.cpp:225
pi_result piEventSetStatus(pi_event Event, pi_int32 ExecutionStatus)
Definition: pi_cuda.cpp:627
pi_result piextEnqueueCommandBuffer(pi_ext_command_buffer CommandBuffer, pi_queue Queue, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *Event)
API to submit the command-buffer to queue for execution, returns an error if the command-buffer is no...
Definition: pi_cuda.cpp:1237
pi_result piextEnablePeerAccess(pi_device command_device, pi_device peer_device)
Definition: pi_cuda.cpp:1276
pi_result piextEnqueueDeviceGlobalVariableWrite(pi_queue Queue, pi_program Program, const char *Name, pi_bool BlockingWrite, size_t Count, size_t Offset, const void *Src, pi_uint32 NumEventsInWaitList, const pi_event *EventsWaitList, pi_event *Event)
Device global variable.
Definition: pi_cuda.cpp:1017
pi_result piextCommandBufferMemBufferCopy(pi_ext_command_buffer CommandBuffer, pi_mem SrcMem, pi_mem DstMem, size_t SrcOffset, size_t DstOffset, size_t Size, pi_uint32 NumSyncPointsInWaitList, const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint)
API to append a mem buffer copy command to the command-buffer.
Definition: pi_cuda.cpp:1132
pi_result piProgramGetBuildInfo(pi_program Program, pi_device Device, pi_program_build_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi_cuda.cpp:310
pi_result piKernelGetGroupInfo(pi_kernel Kernel, pi_device Device, pi_kernel_group_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi_cuda.cpp:511
pi_result piextDeviceCreateWithNativeHandle(pi_native_handle NativeHandle, pi_platform Platform, pi_device *Device)
Creates PI device object from a native handle.
Definition: pi_cuda.cpp:106
pi_result piEventSetCallback(pi_event Event, pi_int32 CommandExecCallbackType, void(*PFnNotify)(pi_event Event, pi_int32 EventCommandStatus, void *UserData), void *UserData)
Definition: pi_cuda.cpp:618
pi_result piextCommandBufferFinalize(pi_ext_command_buffer CommandBuffer)
API to stop command-buffer recording such that no more commands can be appended, and makes the comman...
Definition: pi_cuda.cpp:1107
pi_result piKernelCreate(pi_program Program, const char *KernelName, pi_kernel *RetKernel)
Definition: pi_cuda.cpp:341
pi_result piProgramCompile(pi_program Program, pi_uint32 NumDevices, const pi_device *DeviceList, const char *Options, pi_uint32 NumInputHeaders, const pi_program *InputHeaders, const char **HeaderIncludeNames, void(*PFnNotify)(pi_program Program, void *UserData), void *UserData)
Definition: pi_cuda.cpp:291
pi_result piextEnqueueNativeCommand(pi_queue Queue, pi_enqueue_native_command_function Fn, void *Data, pi_uint32 NumMems, const pi_mem *Mems, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *Event)
API to enqueue work through a backend API such that the plugin can schedule the backend API calls wit...
Definition: pi_cuda.cpp:1361
pi_result piextCommandBufferPrefetchUSM(pi_ext_command_buffer CommandBuffer, const void *Ptr, size_t Size, pi_usm_migration_flags Flags, pi_uint32 NumSyncPointsInWaitList, const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint)
API to append a USM Prefetch command to the command-buffer.
Definition: pi_cuda.cpp:1219
pi_result piextDeviceGetNativeHandle(pi_device Device, pi_native_handle *NativeHandle)
Gets the native handle of a PI device object.
Definition: pi_cuda.cpp:100
pi_result piextPhysicalMemCreate(pi_context context, pi_device device, size_t mem_size, pi_physical_mem *ret_physical_mem)
API for creating a physical memory handle that virtual memory can be mapped to.
Definition: pi_cuda.cpp:1307
pi_result piextPlatformCreateWithNativeHandle(pi_native_handle NativeHandle, pi_platform *Platform)
Creates PI platform object from a native handle.
Definition: pi_cuda.cpp:47
pi_result piQueueRetain(pi_queue Queue)
Definition: pi_cuda.cpp:180
pi_result piQueueRelease(pi_queue Queue)
Definition: pi_cuda.cpp:182
pi_result piextCommandBufferReleaseCommand(pi_ext_command_buffer_command Command)
API to decrement the reference count of a command-buffer command.
Definition: pi_cuda.cpp:1258
pi_result piextPluginGetOpaqueData(void *opaque_data_param, void **opaque_data_return)
API to get Plugin internal data, opaque to SYCL RT.
Definition: pi_cuda.cpp:1262
pi_result piextCommandBufferNDRangeKernel(pi_ext_command_buffer CommandBuffer, pi_kernel Kernel, pi_uint32 WorkDim, const size_t *GlobalWorkOffset, const size_t *GlobalWorkSize, const size_t *LocalWorkSize, pi_uint32 NumSyncPointsInWaitList, const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint, pi_ext_command_buffer_command *Command)
API to append a kernel execution command to the command-buffer.
Definition: pi_cuda.cpp:1111
pi_result piextEventGetNativeHandle(pi_event Event, pi_native_handle *NativeHandle)
Gets the native handle of a PI event object.
Definition: pi_cuda.cpp:637
pi_result piProgramRelease(pi_program Program)
Definition: pi_cuda.cpp:324
pi_result piProgramCreateWithBinary(pi_context Context, pi_uint32 NumDevices, const pi_device *DeviceList, const size_t *Lengths, const unsigned char **Binaries, size_t NumMetadataEntries, const pi_device_binary_property *Metadata, pi_int32 *BinaryStatus, pi_program *Program)
Creates a PI program for a context and loads the given binary into it.
Definition: pi_cuda.cpp:253
pi_result piextMemImageFree(pi_context Context, pi_device Device, pi_image_mem_handle MemoryHandle)
API to free memory for bindless images.
Definition: pi_cuda.cpp:416
pi_result piEnqueueMemBufferRead(pi_queue Queue, pi_mem Src, pi_bool BlockingRead, size_t Offset, size_t Size, void *Dst, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *Event)
Definition: pi_cuda.cpp:698
pi_result piextVirtualMemGetInfo(pi_context context, const void *ptr, size_t range_size, pi_virtual_mem_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
API for getting info about a mapped virtual memory range.
Definition: pi_cuda.cpp:1350
pi_result piKernelSetArg(pi_kernel Kernel, pi_uint32 ArgIndex, size_t ArgSize, const void *ArgValue)
Definition: pi_cuda.cpp:347
pi_result piextDeviceSelectBinary(pi_device Device, pi_device_binary *Binaries, pi_uint32 NumBinaries, pi_uint32 *SelectedBinaryInd)
Selects the most appropriate device binary based on runtime information and the IR characteristics.
Definition: pi_cuda.cpp:93
pi_result piextMemCreateWithNativeHandle(pi_native_handle NativeHandle, pi_context Context, bool ownNativeHandle, pi_mem *Mem)
Creates PI mem object from a native handle.
Definition: pi_cuda.cpp:241
pi_result piSamplerRelease(pi_sampler Sampler)
Definition: pi_cuda.cpp:677
pi_result piDeviceRelease(pi_device Device)
Definition: pi_cuda.cpp:74
pi_result piextMemUnsampledImageHandleDestroy(pi_context Context, pi_device Device, pi_image_handle Handle)
API to destroy bindless unsampled image handles.
Definition: pi_cuda.cpp:440
pi_result piEnqueueMemImageRead(pi_queue Queue, pi_mem Image, pi_bool BlockingRead, pi_image_offset Origin, pi_image_region Region, size_t RowPitch, size_t SlicePitch, void *Ptr, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *Event)
Definition: pi_cuda.cpp:813
pi_result piextUSMFree(pi_context Context, void *Ptr)
Indicates that the allocated USM memory is no longer needed on the runtime side.
Definition: pi_cuda.cpp:919
pi_result piQueueFlush(pi_queue Queue)
Definition: pi_cuda.cpp:188
pi_result piMemRetain(pi_mem Mem)
Definition: pi_cuda.cpp:223
pi_result piContextGetInfo(pi_context Context, pi_context_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi_cuda.cpp:124
pi_result piextVirtualMemMap(pi_context context, const void *ptr, size_t range_size, pi_physical_mem physical_mem, size_t offset, pi_virtual_access_flags flags)
API for mapping a virtual memory range to a a physical memory allocation at a given offset.
Definition: pi_cuda.cpp:1332
pi_result piEnqueueMemBufferCopyRect(pi_queue Queue, pi_mem SrcMem, pi_mem DstMem, pi_buff_rect_offset SrcOrigin, pi_buff_rect_offset DstOrigin, pi_buff_rect_region Region, size_t SrcRowPitch, size_t SrcSlicePitch, size_t DstRowPitch, size_t DstSlicePitch, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *Event)
Definition: pi_cuda.cpp:761
pi_result piKernelSetExecInfo(pi_kernel Kernel, pi_kernel_exec_info ParamName, size_t ParamValueSize, const void *ParamValue)
API to set attributes controlling kernel execution.
Definition: pi_cuda.cpp:1077
pi_result piextPhysicalMemRetain(pi_physical_mem physical_mem)
API for retaining a physical memory handle.
Definition: pi_cuda.cpp:1314
pi_result piSamplerGetInfo(pi_sampler Sampler, pi_sampler_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi_cuda.cpp:665
pi_result piextProgramSetSpecializationConstant(pi_program Prog, pi_uint32 SpecID, size_t Size, const void *SpecValue)
Sets a specialization constant to a specific value.
Definition: pi_cuda.cpp:1084
pi_result piextUSMEnqueueMemcpy(pi_queue Queue, pi_bool Blocking, void *DstPtr, const void *SrcPtr, size_t Size, pi_uint32 NumEventsInWaitlist, const pi_event *EventsWaitlist, pi_event *Event)
USM Memcpy API.
Definition: pi_cuda.cpp:937
pi_result piextQueueCreate(pi_context Context, pi_device Device, pi_queue_properties *Properties, pi_queue *Queue)
Definition: pi_cuda.cpp:167
pi_result piextCommandBufferMemBufferWrite(pi_ext_command_buffer CommandBuffer, pi_mem Buffer, size_t Offset, size_t Size, const void *Ptr, pi_uint32 NumSyncPointsInWaitList, const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint)
API to append a mem buffer write command to the command-buffer.
Definition: pi_cuda.cpp:1176
pi_result piEnqueueMemBufferFill(pi_queue Queue, pi_mem Buffer, const void *Pattern, size_t PatternSize, size_t Offset, size_t Size, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *Event)
Definition: pi_cuda.cpp:774
pi_result piextEnqueueCooperativeKernelLaunch(pi_queue Queue, pi_kernel Kernel, pi_uint32 WorkDim, const size_t *GlobalWorkOffset, const size_t *GlobalWorkSize, const size_t *LocalWorkSize, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *OutEvent)
Definition: pi_cuda.cpp:563
pi_result piextPeerAccessGetInfo(pi_device command_device, pi_device peer_device, pi_peer_attr attr, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi_cuda.cpp:1288
pi_result piEventCreate(pi_context Context, pi_event *RetEvent)
Create PI event object in a signalled/completed state.
Definition: pi_cuda.cpp:595
pi_result piextEnqueueKernelLaunchCustom(pi_queue Queue, pi_kernel Kernel, pi_uint32 WorkDim, const size_t *GlobalWorkSize, const size_t *LocalWorkSize, pi_uint32 NumPropsInLaunchPropList, const pi_launch_property *LaunchPropList, pi_uint32 NumEventsInWaitList, const pi_event *EventsWaitList, pi_event *OutEvent)
Definition: pi_cuda.cpp:550
pi_result piextCommandBufferMemcpyUSM(pi_ext_command_buffer CommandBuffer, void *DstPtr, const void *SrcPtr, size_t Size, pi_uint32 NumSyncPointsInWaitList, const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint)
API to append a USM memcpy command to the command-buffer.
Definition: pi_cuda.cpp:1123
pi_result piextCommandBufferMemBufferCopyRect(pi_ext_command_buffer CommandBuffer, pi_mem SrcMem, pi_mem DstMem, pi_buff_rect_offset SrcOrigin, pi_buff_rect_offset DstOrigin, pi_buff_rect_region Region, size_t SrcRowPitch, size_t SrcSlicePitch, size_t DstRowPitch, size_t DstSlicePitch, pi_uint32 NumSyncPointsInWaitList, const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint)
API to append a rectangular mem buffer copy command to the command-buffer.
Definition: pi_cuda.cpp:1142
pi_result piTearDown(void *PluginParameter)
API to notify that the plugin should clean up its resources.
Definition: pi_cuda.cpp:1267
pi_result piextMemUnsampledImageCreate(pi_context Context, pi_device Device, pi_image_mem_handle ImgMem, pi_image_format *ImageFormat, pi_image_desc *ImageDesc, pi_image_handle *RetHandle)
API to create bindless image handles.
Definition: pi_cuda.cpp:383
pi_result piextKernelGetNativeHandle(pi_kernel Kernel, pi_native_handle *NativeHandle)
Gets the native handle of a PI kernel object.
Definition: pi_cuda.cpp:583
pi_result piextUSMEnqueueMemcpy2D(pi_queue Queue, pi_bool Blocking, void *DstPtr, size_t DstPitch, const void *SrcPtr, size_t SrcPitch, size_t Width, size_t Height, pi_uint32 NumEventsInWaitlist, const pi_event *EventWaitlist, pi_event *Event)
USM 2D Memcpy API.
Definition: pi_cuda.cpp:990
pi_result piSamplerRetain(pi_sampler Sampler)
Definition: pi_cuda.cpp:673
pi_result piEventRelease(pi_event Event)
Definition: pi_cuda.cpp:633
pi_result piKernelRelease(pi_kernel Kernel)
Definition: pi_cuda.cpp:534
pi_result piEventGetProfilingInfo(pi_event Event, pi_profiling_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi_cuda.cpp:606
pi_result piMemGetInfo(pi_mem Mem, pi_mem_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi_cuda.cpp:217
pi_result piextMemSampledImageCreate(pi_context Context, pi_device Device, pi_image_mem_handle ImgMem, pi_image_format *ImageFormat, pi_image_desc *ImageDesc, pi_sampler Sampler, pi_image_handle *RetHandle)
API to create sampled bindless image handles.
Definition: pi_cuda.cpp:391
pi_result piEnqueueMemBufferMap(pi_queue Queue, pi_mem Mem, pi_bool BlockingMap, pi_map_flags MapFlags, size_t Offset, size_t Size, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *OutEvent, void **RetMap)
Definition: pi_cuda.cpp:786
pi_result piEnqueueMemBufferWrite(pi_queue Queue, pi_mem Buffer, pi_bool BlockingWrite, size_t Offset, size_t Size, const void *Ptr, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *Event)
Definition: pi_cuda.cpp:724
pi_result piKernelGetInfo(pi_kernel Kernel, pi_kernel_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi_cuda.cpp:366
pi_result piextUSMImport(const void *HostPtr, size_t Size, pi_context Context)
Import host system memory into USM.
Definition: pi_cuda.cpp:1009
pi_result piextUSMEnqueueFill2D(pi_queue Queue, void *Ptr, size_t Pitch, size_t PatternSize, const void *Pattern, size_t Width, size_t Height, pi_uint32 NumEventsWaitList, const pi_event *EventsWaitList, pi_event *Event)
USM 2D fill API.
Definition: pi_cuda.cpp:965
pi_result piPluginInit(pi_plugin *PluginInit)
Definition: pi_cuda.cpp:1372
pi_result piPlatformGetInfo(pi_platform Platform, pi_platform_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi_cuda.cpp:35
pi_result piextMemMipmapGetLevel(pi_context Context, pi_device Device, pi_image_mem_handle MipMem, unsigned int Level, pi_image_mem_handle *RetMem)
API to retrieve individual image from mipmap.
Definition: pi_cuda.cpp:408
pi_result piextMemMipmapFree(pi_context Context, pi_device Device, pi_image_mem_handle MemoryHandle)
API to free mipmap memory for bindless images.
Definition: pi_cuda.cpp:421
pi_result piextSignalExternalSemaphore(pi_queue Queue, pi_interop_semaphore_handle SemHandle, bool HasSignalValue, pi_uint64 SignalValue, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *Event)
API to instruct the queue to signal the external semaphore handle once all previous commands have com...
Definition: pi_cuda.cpp:502
pi_result piextCommandBufferRetainCommand(pi_ext_command_buffer_command Command)
API to increment the reference count of a command-buffer command.
Definition: pi_cuda.cpp:1253
pi_result piextUSMSharedAlloc(void **ResultPtr, pi_context Context, pi_device Device, pi_usm_mem_properties *Properties, size_t Size, pi_uint32 Alignment)
Allocates memory accessible on both host and device.
Definition: pi_cuda.cpp:893
void freeCUDATracingContext(cuda_tracing_context_t_ *Ctx)
pi_result piEnqueueMemBufferWriteRect(pi_queue Queue, pi_mem Buffer, pi_bool BlockingWrite, pi_buff_rect_offset BufferOffset, pi_buff_rect_offset HostOffset, pi_buff_rect_region Region, size_t BufferRowPitch, size_t BufferSlicePitch, size_t HostRowPitch, size_t HostSlicePitch, const void *Ptr, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *Event)
Definition: pi_cuda.cpp:736
pi_result piextGetDeviceFunctionPointer(pi_device Device, pi_program Program, const char *FunctionName, pi_uint64 *FunctionPointerRet)
Retrieves a device function pointer to a user-defined function.
Definition: pi_cuda.cpp:868
pi_result piextUSMEnqueueMemAdvise(pi_queue Queue, const void *Ptr, size_t Length, pi_mem_advice Advice, pi_event *OutEvent)
USM Memadvise API.
Definition: pi_cuda.cpp:958
pi_result piextUSMHostAlloc(void **ResultPtr, pi_context Context, pi_usm_mem_properties *Properties, size_t Size, pi_uint32 Alignment)
Allocates host memory accessible by the device.
Definition: pi_cuda.cpp:912
pi_result piProgramRetain(pi_program Program)
Definition: pi_cuda.cpp:320
pi_result piextVirtualMemSetAccess(pi_context context, const void *ptr, size_t range_size, pi_virtual_access_flags flags)
API for setting the access mode of a mapped virtual memory range.
Definition: pi_cuda.cpp:1344
pi_result piQueueGetInfo(pi_queue Queue, pi_queue_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi_cuda.cpp:172
pi_result piQueueCreate(pi_context Context, pi_device Device, pi_queue_properties Flags, pi_queue *Queue)
Definition: pi_cuda.cpp:161
pi_result piextGetGlobalVariablePointer(pi_device Device, pi_program Program, const char *GlobalVariableName, size_t *GlobalVariableSize, void **GlobalVariablePointerRet)
Definition: pi_cuda.cpp:875
const char SupportedVersion[]
Definition: pi_cuda.cpp:1370
pi_result piContextRelease(pi_context Context)
Definition: pi_cuda.cpp:157
pi_result piextMemMapExternalArray(pi_context Context, pi_device Device, pi_image_format *ImageFormat, pi_image_desc *ImageDesc, pi_interop_mem_handle MemHandle, pi_image_mem_handle *RetMem)
API to map an interop memory handle to an image memory handle.
Definition: pi_cuda.cpp:465
pi_result piEnqueueMemBufferCopy(pi_queue Queue, pi_mem SrcMem, pi_mem DstMem, size_t SrcOffset, size_t DstOffset, size_t Size, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *Event)
Definition: pi_cuda.cpp:750
pi_result piEnqueueMemImageCopy(pi_queue Queue, pi_mem SrcImage, pi_mem DstImage, pi_image_offset SrcOrigin, pi_image_offset DstOrigin, pi_image_region Region, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *Event)
Definition: pi_cuda.cpp:839
pi_result piextCommandBufferUpdateKernelLaunch(pi_ext_command_buffer_command Command, pi_ext_command_buffer_update_kernel_launch_desc *Desc)
API to update a kernel launch command inside of a command-buffer.
Definition: pi_cuda.cpp:1246
pi_result piEventGetInfo(pi_event Event, pi_event_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi_cuda.cpp:599
pi_result piProgramGetInfo(pi_program Program, pi_program_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi_cuda.cpp:272
pi_result piextUSMEnqueueFill(pi_queue Queue, void *Ptr, const void *Pattern, size_t PatternSize, size_t Count, pi_uint32 NumEventsInWaitlist, const pi_event *EventsWaitlist, pi_event *Event)
USM Fill API.
Definition: pi_cuda.cpp:929
pi_result piextUSMEnqueueMemset2D(pi_queue Queue, void *Ptr, size_t Pitch, int Value, size_t Width, size_t Height, pi_uint32 NumEventsWaitList, const pi_event *EventsWaitlist, pi_event *Event)
USM 2D Memset API.
Definition: pi_cuda.cpp:978
pi_result piextCommandBufferMemBufferWriteRect(pi_ext_command_buffer CommandBuffer, pi_mem Buffer, pi_buff_rect_offset BufferOffset, pi_buff_rect_offset HostOffset, pi_buff_rect_region Region, size_t BufferRowPitch, size_t BufferSlicePitch, size_t HostRowPitch, size_t HostSlicePitch, const void *Ptr, pi_uint32 NumSyncPointsInWaitList, const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint)
API to append a rectangular mem buffer write command to the command-buffer.
Definition: pi_cuda.cpp:1185
pi_result piextMemReleaseInterop(pi_context Context, pi_device Device, pi_interop_mem_handle ExtMem)
API to destroy interop memory.
Definition: pi_cuda.cpp:473
pi_result piextUSMRelease(const void *HostPtr, pi_context Context)
Release host system memory from USM.
Definition: pi_cuda.cpp:1013
pi_result piEventsWait(pi_uint32 NumEvents, const pi_event *EventList)
Definition: pi_cuda.cpp:614
void enableCUDATracing(cuda_tracing_context_t_ *ctx)
pi_result piextPlatformGetNativeHandle(pi_platform Platform, pi_native_handle *NativeHandle)
Gets the native handle of a PI platform object.
Definition: pi_cuda.cpp:42
pi_result piEnqueueMemBufferReadRect(pi_queue Queue, pi_mem Buffer, pi_bool BlockingRead, pi_buff_rect_offset BufferOffset, pi_buff_rect_offset HostOffset, pi_buff_rect_region Region, size_t BufferRowPitch, size_t BufferSlicePitch, size_t HostRowPitch, size_t HostSlicePitch, void *Ptr, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *Event)
Definition: pi_cuda.cpp:710
pi_result piMemBufferPartition(pi_mem Buffer, pi_mem_flags Flags, pi_buffer_create_type BufferCreateType, void *BufferCreateInfo, pi_mem *RetMem)
Definition: pi_cuda.cpp:860
pi_result piPluginGetLastError(char **message)
API to get Plugin specific warning and error messages.
Definition: pi_cuda.cpp:52
pi_result piextCommandBufferMemBufferRead(pi_ext_command_buffer CommandBuffer, pi_mem Buffer, size_t Offset, size_t Size, void *Dst, pi_uint32 NumSyncPointsInWaitList, const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint)
API to append a mem buffer read command to the command-buffer.
Definition: pi_cuda.cpp:1154
pi_result piextVirtualMemReserve(pi_context context, const void *start, size_t range_size, void **ret_ptr)
API for reserving a virtual memory range.
Definition: pi_cuda.cpp:1322
pi_result piEnqueueMemImageWrite(pi_queue Queue, pi_mem Image, pi_bool BlockingWrite, pi_image_offset Origin, pi_image_region Region, size_t InputRowPitch, size_t InputSlicePitch, const void *Ptr, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *Event)
Definition: pi_cuda.cpp:825
pi_result piextContextGetNativeHandle(pi_context Context, pi_native_handle *NativeHandle)
Gets the native handle of a PI context object.
Definition: pi_cuda.cpp:138
pi_result piMemImageCreate(pi_context Context, pi_mem_flags Flags, const pi_image_format *ImageFormat, const pi_image_desc *ImageDesc, void *HostPtr, pi_mem *RetImage)
Definition: pi_cuda.cpp:227
pi_result piextUSMGetMemAllocInfo(pi_context Context, const void *Ptr, pi_mem_alloc_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
API to query information about USM allocated pointers Valid Queries: PI_MEM_ALLOC_TYPE returns host/d...
Definition: pi_cuda.cpp:1001
pi_result piEnqueueTimestampRecordingExp(pi_queue Queue, pi_bool Blocking, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *Event)
Definition: pi_cuda.cpp:651
pi_result piEnqueueEventsWaitWithBarrier(pi_queue Queue, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *OutEvent)
Definition: pi_cuda.cpp:689
pi_result piextMemSampledImageHandleDestroy(pi_context Context, pi_device Device, pi_image_handle Handle)
API to destroy bindless sampled image handles.
Definition: pi_cuda.cpp:445
pi_result piQueueFinish(pi_queue Queue)
Definition: pi_cuda.cpp:186
pi_result piextWaitExternalSemaphore(pi_queue Queue, pi_interop_semaphore_handle SemHandle, bool HasWaitValue, pi_uint64 WaitValue, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *Event)
API to instruct the queue with a non-blocking wait on an external semaphore.
Definition: pi_cuda.cpp:493
void disableCUDATracing(cuda_tracing_context_t_ *ctx)
pi_result piextMemImageCreateWithNativeHandle(pi_native_handle NativeHandle, pi_context Context, bool OwnNativeHandle, const pi_image_format *ImageFormat, const pi_image_desc *ImageDesc, pi_mem *Img)
Creates PI image object from a native handle.
Definition: pi_cuda.cpp:264
pi_result piSamplerCreate(pi_context Context, const pi_sampler_properties *SamplerProperties, pi_sampler *RetSampler)
Definition: pi_cuda.cpp:659
pi_result piGetDeviceAndHostTimer(pi_device Device, uint64_t *DeviceTime, uint64_t *HostTime)
Queries device for it's global timestamp in nanoseconds, and updates HostTime with the value of the h...
Definition: pi_cuda.cpp:1271
pi_result piPlatformsGet(pi_uint32 NumEntries, pi_platform *Platforms, pi_uint32 *NumPlatforms)
Definition: pi_cuda.cpp:30
pi_result piDevicesGet(pi_platform Platform, pi_device_type DeviceType, pi_uint32 NumEntries, pi_device *Devices, pi_uint32 *NumDevices)
Definition: pi_cuda.cpp:63
pi_result piEnqueueMemImageFill(pi_queue Queue, pi_mem Image, const void *FillColor, const size_t *Origin, const size_t *Region, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *Event)
Definition: pi_cuda.cpp:848
pi_result piextEnqueueWriteHostPipe(pi_queue Queue, pi_program Program, const char *PipeSymbol, pi_bool Blocking, void *Ptr, size_t Size, pi_uint32 NumEventsInWaitList, const pi_event *EventsWaitList, pi_event *Event)
Write to pipe of a given name.
Definition: pi_cuda.cpp:1057
pi_result piextKernelSetArgMemObj(pi_kernel Kernel, pi_uint32 ArgIndex, const pi_mem_obj_property *ArgProperties, const pi_mem *ArgValue)
Definition: pi_cuda.cpp:353
pi_result piDevicePartition(pi_device Device, const pi_device_partition_property *Properties, pi_uint32 NumDevices, pi_device *OutDevices, pi_uint32 *OutNumDevices)
Definition: pi_cuda.cpp:85
cuda_tracing_context_t_ * createCUDATracingContext()
pi_result piextEnqueueDeviceGlobalVariableRead(pi_queue Queue, pi_program Program, const char *Name, pi_bool BlockingRead, size_t Count, size_t Offset, void *Dst, pi_uint32 NumEventsInWaitList, const pi_event *EventsWaitList, pi_event *Event)
API reading data from a device global variable to host.
Definition: pi_cuda.cpp:1026
pi_result piextMemImageGetInfo(pi_context Context, pi_image_mem_handle MemHandle, pi_image_info ParamName, void *ParamValue, size_t *ParamValueSizeRet)
API to query an image memory handle for specific properties.
Definition: pi_cuda.cpp:450
pi_result piContextCreate(const pi_context_properties *Properties, pi_uint32 NumDevices, const pi_device *Devices, void(*PFnNotify)(const char *ErrInfo, const void *PrivateInfo, size_t CB, void *UserData), void *UserData, pi_context *RetContext)
Definition: pi_cuda.cpp:114
pi_result piextUSMDeviceAlloc(void **ResultPtr, pi_context Context, pi_device Device, pi_usm_mem_properties *Properties, size_t Size, pi_uint32 Alignment)
Allocates device memory.
Definition: pi_cuda.cpp:884
pi_result piextKernelSetArgSampler(pi_kernel Kernel, pi_uint32 ArgIndex, const pi_sampler *ArgValue)
Definition: pi_cuda.cpp:360
pi_result piextMemGetNativeHandle(pi_mem Mem, pi_device Dev, pi_native_handle *NativeHandle)
Gets the native handle of a PI mem object.
Definition: pi_cuda.cpp:236
pi_result piextEnqueueReadHostPipe(pi_queue Queue, pi_program Program, const char *PipeSymbol, pi_bool Blocking, void *Ptr, size_t Size, pi_uint32 NumEventsInWaitList, const pi_event *EventsWaitList, pi_event *Event)
Plugin.
Definition: pi_cuda.cpp:1037
pi_result piextUSMEnqueuePrefetch(pi_queue Queue, const void *Ptr, size_t Size, pi_usm_migration_flags Flags, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *OutEvent)
Hint to migrate memory to the device.
Definition: pi_cuda.cpp:948
pi_result piEnqueueKernelLaunch(pi_queue Queue, pi_kernel Kernel, pi_uint32 WorkDim, const size_t *GlobalWorkOffset, const size_t *GlobalWorkSize, const size_t *LocalWorkSize, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *OutEvent)
Definition: pi_cuda.cpp:540
pi_result piextCommandBufferFillUSM(pi_ext_command_buffer CommandBuffer, void *Ptr, const void *Pattern, size_t PatternSize, size_t Size, pi_uint32 NumSyncPointsInWaitList, const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint)
API to append a USM fill command to the command-buffer.
Definition: pi_cuda.cpp:1208
pi_result piextCommandBufferRetain(pi_ext_command_buffer CommandBuffer)
API to increment the reference count of the command-buffer.
Definition: pi_cuda.cpp:1099
pi_result piProgramBuild(pi_program Program, pi_uint32 NumDevices, const pi_device *DeviceList, const char *Options, void(*PFnNotify)(pi_program Program, void *UserData), void *UserData)
Definition: pi_cuda.cpp:302
pi_result piextImportExternalMemory(pi_context Context, pi_device Device, pi_external_mem_descriptor *MemDesc, pi_interop_mem_handle *RetHandle)
API to import external memory.
Definition: pi_cuda.cpp:459
pi_result piKernelRetain(pi_kernel Kernel)
Definition: pi_cuda.cpp:529
pi_result piEventRetain(pi_event Event)
Definition: pi_cuda.cpp:631
pi_result piextVirtualMemUnmap(pi_context context, const void *ptr, size_t range_size)
API for unmapping a virtual memory range previously mapped in a context.
Definition: pi_cuda.cpp:1339
pi_result piextContextCreateWithNativeHandle(pi_native_handle NativeHandle, pi_uint32 NumDevices, const pi_device *Devices, bool OwnNativeHandle, pi_context *RetContext)
Creates PI context object from a native handle.
Definition: pi_cuda.cpp:143
pi_result piextCommandBufferRelease(pi_ext_command_buffer CommandBuffer)
API to decrement the reference count of the command-buffer.
Definition: pi_cuda.cpp:1103
pi_result piPluginGetBackendOption(pi_platform platform, const char *frontend_option, const char **backend_option)
API to get backend specific option.
Definition: pi_cuda.cpp:56
pi_result piextCommandBufferMemBufferFill(pi_ext_command_buffer CommandBuffer, pi_mem Buffer, const void *Pattern, size_t PatternSize, size_t Offset, size_t Size, pi_uint32 NumSyncPointsInWaitList, const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint)
API to append a mem buffer fill command to the command-buffer.
Definition: pi_cuda.cpp:1198
pi_result piextVirtualMemGranularityGetInfo(pi_context context, pi_device device, pi_virtual_mem_granularity_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
Virtual memory.
Definition: pi_cuda.cpp:1298
pi_result piProgramLink(pi_context Context, pi_uint32 NumDevices, const pi_device *DeviceList, const char *Options, pi_uint32 NumInputPrograms, const pi_program *InputPrograms, void(*PFnNotify)(pi_program Program, void *UserData), void *UserData, pi_program *RetProgram)
Definition: pi_cuda.cpp:280
pi_result piextProgramCreateWithNativeHandle(pi_native_handle NativeHandle, pi_context Context, bool OwnNativeHandle, pi_program *Program)
Creates PI program object from a native handle.
Definition: pi_cuda.cpp:333
pi_result piextCommandBufferAdviseUSM(pi_ext_command_buffer CommandBuffer, const void *Ptr, size_t Length, pi_mem_advice Advice, pi_uint32 NumSyncPointsInWaitList, const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint)
API to append a USM Advise command to the command-buffer.
Definition: pi_cuda.cpp:1228
pi_result piextEventCreateWithNativeHandle(pi_native_handle NativeHandle, pi_context Context, bool OwnNativeHandle, pi_event *Event)
Creates PI event object from a native handle.
Definition: pi_cuda.cpp:643
pi_result piMemImageGetInfo(pi_mem Image, pi_image_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi_cuda.cpp:805
pi_result piEnqueueEventsWait(pi_queue Queue, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *OutEvent)
Definition: pi_cuda.cpp:681
pi_result piextImportExternalSemaphore(pi_context Context, pi_device Device, pi_external_semaphore_descriptor *SemDesc, pi_interop_semaphore_handle *RetHandle)
API to import an external semaphore.
Definition: pi_cuda.cpp:480
pi_result piDeviceRetain(pi_device Device)
Definition: pi_cuda.cpp:70
pi_result piextVirtualMemFree(pi_context context, const void *ptr, size_t range_size)
API for freeing a virtual memory range.
Definition: pi_cuda.cpp:1327
pi_result piextQueueGetNativeHandle(pi_queue Queue, pi_native_handle *NativeHandle, int32_t *NativeHandleDesc)
Gets the native handle of a PI queue object.
Definition: pi_cuda.cpp:190
pi_result piextUSMPitchedAlloc(void **ResultPtr, size_t *ResultPitch, pi_context Context, pi_device Device, pi_usm_mem_properties *Properties, size_t WidthInBytes, size_t Height, unsigned int ElementSizeBytes)
Allocates memory accessible on device.
Definition: pi_cuda.cpp:902
pi_result piextMemImageCopy(pi_queue Queue, void *DstPtr, const void *SrcPtr, const pi_image_desc *SrcImageDesc, const pi_image_desc *DestImageDesc, const pi_image_format *SrcImageFormat, const pi_image_format *DestImageFormat, const pi_image_copy_flags Flags, pi_image_offset SrcOffset, pi_image_offset DstOffset, pi_image_region CopyExtent, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *Event)
API to copy image data Host to Device or Device to Host.
Definition: pi_cuda.cpp:426
pi_result piextCommandBufferCreate(pi_context Context, pi_device Device, const pi_ext_command_buffer_desc *Desc, pi_ext_command_buffer *RetCommandBuffer)
API to create a command-buffer.
Definition: pi_cuda.cpp:1092
pi_result piextCommandBufferMemBufferReadRect(pi_ext_command_buffer CommandBuffer, pi_mem Buffer, pi_buff_rect_offset BufferOffset, pi_buff_rect_offset HostOffset, pi_buff_rect_region Region, size_t BufferRowPitch, size_t BufferSlicePitch, size_t HostRowPitch, size_t HostSlicePitch, void *Ptr, pi_uint32 NumSyncPointsInWaitList, const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint)
API to append a rectangular mem buffer read command to the command-buffer.
Definition: pi_cuda.cpp:1163
pi_result piextPhysicalMemRelease(pi_physical_mem physical_mem)
API for releasing a physical memory handle.
Definition: pi_cuda.cpp:1318
pi_result piContextRetain(pi_context Context)
Definition: pi_cuda.cpp:152
pi_result piextKernelSetArgPointer(pi_kernel Kernel, pi_uint32 ArgIndex, size_t ArgSize, const void *ArgValue)
Sets up pointer arguments for CL kernels.
Definition: pi_cuda.cpp:924
pi_result piextKernelSuggestMaxCooperativeGroupCount(pi_kernel Kernel, size_t LocalWorkSize, size_t DynamicSharedMemorySize, pi_uint32 *GroupCountRet)
Gets the max work group count for a cooperative kernel.
Definition: pi_cuda.cpp:588
pi_result piKernelGetSubGroupInfo(pi_kernel Kernel, pi_device Device, pi_kernel_sub_group_info ParamName, size_t InputValueSize, const void *InputValue, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
API to query information from the sub-group from a kernel.
Definition: pi_cuda.cpp:519
pi_result piextBindlessImageSamplerCreate(pi_context Context, const pi_sampler_properties *SamplerProperties, float MinMipmapLevelClamp, float MaxMipmapLevelClamp, float MaxAnisotropy, pi_sampler *RetSampler)
API to create samplers for bindless images.
Definition: pi_cuda.cpp:399
pi_result piEnqueueMemUnmap(pi_queue Queue, pi_mem Mem, void *MappedPtr, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *OutEvent)
Definition: pi_cuda.cpp:797
pi_result piextMemImageAllocate(pi_context Context, pi_device Device, pi_image_format *ImageFormat, pi_image_desc *ImageDesc, pi_image_mem_handle *RetMem)
API to allocate memory for bindless images.
Definition: pi_cuda.cpp:374
pi_result piProgramCreate(pi_context Context, const void *ILBytes, size_t Length, pi_program *Program)
Definition: pi_cuda.cpp:248
pi_result piextKernelCreateWithNativeHandle(pi_native_handle NativeHandle, pi_context Context, pi_program Program, bool OwnNativeHandle, pi_kernel *Kernel)
Creates PI kernel object from a native handle.
Definition: pi_cuda.cpp:573
pi_result piextProgramGetNativeHandle(pi_program Program, pi_native_handle *NativeHandle)
Gets the native handle of a PI program object.
Definition: pi_cuda.cpp:328
Declarations for CUDA Plugin.
#define _PI_CUDA_PLUGIN_VERSION_STRING
Definition: pi_cuda.hpp:25
char PluginVersion[20]
Definition: pi.h:3259
struct _pi_plugin::FunctionPointers PiFunctionTable
char PiVersion[20]
Definition: pi.h:3257
This struct is a record of the device binary information.
Definition: pi.h:1109