DPC++ Runtime
Runtime libraries for oneAPI DPC++
pi_hip.cpp
Go to the documentation of this file.
1 //==---------- pi_hip.cpp - HIP 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_hip.hpp>
15 #include <sycl/detail/defines.hpp>
17 #include <sycl/detail/pi.hpp>
18 
19 #include <algorithm>
20 #include <cassert>
21 #include <chrono>
22 #include <hip/hip_runtime.h>
23 #include <limits>
24 #include <memory>
25 #include <mutex>
26 #include <regex>
27 #include <string.h>
28 #include <string_view>
29 
30 //-- PI API implementation
31 extern "C" {
32 
34  pi_uint32 *NumPlatforms) {
35  return pi2ur::piPlatformsGet(NumEntries, Platforms, NumPlatforms);
36 }
37 
39  size_t ParamValueSize, void *ParamValue,
40  size_t *ParamValueSizeRet) {
41  return pi2ur::piPlatformGetInfo(Platform, ParamName, ParamValueSize,
42  ParamValue, ParamValueSizeRet);
43 }
44 
46  pi_native_handle *NativeHandle) {
47  return pi2ur::piextPlatformGetNativeHandle(Platform, NativeHandle);
48 }
49 
51  pi_platform *Platform) {
52  return pi2ur::piextPlatformCreateWithNativeHandle(NativeHandle, Platform);
53 }
54 
56  return pi2ur::piPluginGetLastError(message);
57 }
58 
60  const char *frontend_option,
61  const char **backend_option) {
62  return pi2ur::piPluginGetBackendOption(platform, frontend_option,
63  backend_option);
64 }
65 
67  pi_uint32 NumEntries, pi_device *Devices,
68  pi_uint32 *NumDevices) {
69  return pi2ur::piDevicesGet(Platform, DeviceType, NumEntries, Devices,
70  NumDevices);
71 }
72 
74  return pi2ur::piDeviceRetain(Device);
75 }
76 
78  return pi2ur::piDeviceRelease(Device);
79 }
80 
82  size_t ParamValueSize, void *ParamValue,
83  size_t *ParamValueSizeRet) {
84  return pi2ur::piDeviceGetInfo(Device, ParamName, ParamValueSize, ParamValue,
85  ParamValueSizeRet);
86 }
87 
89  const pi_device_partition_property *Properties,
90  pi_uint32 NumDevices, pi_device *OutDevices,
91  pi_uint32 *OutNumDevices) {
92  return pi2ur::piDevicePartition(Device, Properties, NumDevices, OutDevices,
93  OutNumDevices);
94 }
95 
97  pi_uint32 NumBinaries,
98  pi_uint32 *SelectedBinaryInd) {
99  return pi2ur::piextDeviceSelectBinary(Device, Binaries, NumBinaries,
100  SelectedBinaryInd);
101 }
102 
104  pi_native_handle *NativeHandle) {
105 
106  return pi2ur::piextDeviceGetNativeHandle(Device, NativeHandle);
107 }
108 
110  pi_platform Platform,
111  pi_device *Device) {
112 
113  return pi2ur::piextDeviceCreateWithNativeHandle(NativeHandle, Platform,
114  Device);
115 }
116 
118  pi_uint32 NumDevices, const pi_device *Devices,
119  void (*PFnNotify)(const char *ErrInfo,
120  const void *PrivateInfo, size_t CB,
121  void *UserData),
122  void *UserData, pi_context *RetContext) {
123  return pi2ur::piContextCreate(Properties, NumDevices, Devices, PFnNotify,
124  UserData, RetContext);
125 }
126 
128  size_t ParamValueSize, void *ParamValue,
129  size_t *ParamValueSizeRet) {
130 
131  return pi2ur::piContextGetInfo(Context, ParamName, ParamValueSize, ParamValue,
132  ParamValueSizeRet);
133 }
134 
137  void *UserData) {
138  return pi2ur::piextContextSetExtendedDeleter(Context, Function, UserData);
139 }
140 
142  pi_native_handle *NativeHandle) {
143  return pi2ur::piextContextGetNativeHandle(Context, NativeHandle);
144 }
145 
147  pi_uint32 NumDevices,
148  const pi_device *Devices,
149  bool OwnNativeHandle,
150  pi_context *RetContext) {
152  NativeHandle, NumDevices, Devices, OwnNativeHandle, RetContext);
153 }
154 
156 
157  return pi2ur::piContextRetain(Context);
158 }
159 
161  return pi2ur::piContextRelease(Context);
162 }
163 
165  pi_queue_properties Flags, pi_queue *Queue) {
166  pi_queue_properties Properties[] = {PI_QUEUE_FLAGS, Flags, 0};
167  return piextQueueCreate(Context, Device, Properties, Queue);
168 }
169 
171  pi_queue_properties *Properties, pi_queue *Queue) {
172  return pi2ur::piextQueueCreate(Context, Device, Properties, Queue);
173 }
174 
176  size_t ParamValueSize, void *ParamValue,
177  size_t *ParamValueSizeRet) {
178 
179  return pi2ur::piQueueGetInfo(Queue, ParamName, ParamValueSize, ParamValue,
180  ParamValueSizeRet);
181 }
182 
184 
186  return pi2ur::piQueueRelease(Queue);
187 }
188 
190 
192 
194  pi_native_handle *NativeHandle,
195  int32_t *NativeHandleDesc) {
196 
197  return pi2ur::piextQueueGetNativeHandle(Queue, NativeHandle,
198  NativeHandleDesc);
199 }
200 
202  int32_t NativeHandleDesc,
203  pi_context Context, pi_device Device,
204  bool OwnNativeHandle,
205  pi_queue_properties *Properties,
206  pi_queue *Queue) {
207 
209  NativeHandle, NativeHandleDesc, Context, Device, OwnNativeHandle,
210  Properties, Queue);
211 }
212 
214  void *HostPtr, pi_mem *RetMem,
215  const pi_mem_properties *properties) {
216  return pi2ur::piMemBufferCreate(Context, Flags, Size, HostPtr, RetMem,
217  properties);
218 }
219 
220 pi_result piMemGetInfo(pi_mem Mem, pi_mem_info ParamName, size_t ParamValueSize,
221  void *ParamValue, size_t *ParamValueSizeRet) {
222  return pi2ur::piMemGetInfo(Mem, ParamName, ParamValueSize, ParamValue,
223  ParamValueSizeRet);
224 }
225 
227 
229 
231  const pi_image_format *ImageFormat,
232  const pi_image_desc *ImageDesc, void *HostPtr,
233  pi_mem *RetImage) {
234 
235  return pi2ur::piMemImageCreate(Context, Flags, ImageFormat, ImageDesc,
236  HostPtr, RetImage);
237 }
238 
240  pi_native_handle *NativeHandle) {
241  return pi2ur::piextMemGetNativeHandle(Mem, Dev, NativeHandle);
242 }
243 
245  pi_context Context,
246  bool ownNativeHandle, pi_mem *Mem) {
247  return pi2ur::piextMemCreateWithNativeHandle(NativeHandle, Context,
248  ownNativeHandle, Mem);
249 }
250 
251 pi_result piProgramCreate(pi_context Context, const void *ILBytes,
252  size_t Length, pi_program *Program) {
253  return pi2ur::piProgramCreate(Context, ILBytes, Length, Program);
254 }
255 
257  pi_context Context, pi_uint32 NumDevices, const pi_device *DeviceList,
258  const size_t *Lengths, const unsigned char **Binaries,
259  size_t NumMetadataEntries, const pi_device_binary_property *Metadata,
260  pi_int32 *BinaryStatus, pi_program *Program) {
261 
262  return pi2ur::piProgramCreateWithBinary(Context, NumDevices, DeviceList,
263  Lengths, Binaries, NumMetadataEntries,
264  Metadata, BinaryStatus, Program);
265 }
266 
268  pi_native_handle NativeHandle, pi_context Context, bool OwnNativeHandle,
269  const pi_image_format *ImageFormat, const pi_image_desc *ImageDesc,
270  pi_mem *Img) {
272  NativeHandle, Context, OwnNativeHandle, ImageFormat, ImageDesc, Img);
273 }
274 
276  size_t ParamValueSize, void *ParamValue,
277  size_t *ParamValueSizeRet) {
278 
279  return pi2ur::piProgramGetInfo(Program, ParamName, ParamValueSize, ParamValue,
280  ParamValueSizeRet);
281 }
282 
284  const pi_device *DeviceList, const char *Options,
285  pi_uint32 NumInputPrograms,
286  const pi_program *InputPrograms,
287  void (*PFnNotify)(pi_program Program, void *UserData),
288  void *UserData, pi_program *RetProgram) {
289  return pi2ur::piProgramLink(Context, NumDevices, DeviceList, Options,
290  NumInputPrograms, InputPrograms, PFnNotify,
291  UserData, RetProgram);
292 }
293 
295  pi_program Program, pi_uint32 NumDevices, const pi_device *DeviceList,
296  const char *Options, pi_uint32 NumInputHeaders,
297  const pi_program *InputHeaders, const char **HeaderIncludeNames,
298  void (*PFnNotify)(pi_program Program, void *UserData), void *UserData) {
299 
300  return pi2ur::piProgramCompile(Program, NumDevices, DeviceList, Options,
301  NumInputHeaders, InputHeaders,
302  HeaderIncludeNames, PFnNotify, UserData);
303 }
304 
306  const pi_device *DeviceList, const char *Options,
307  void (*PFnNotify)(pi_program Program, void *UserData),
308  void *UserData) {
309  return pi2ur::piProgramBuild(Program, NumDevices, DeviceList, Options,
310  PFnNotify, UserData);
311 }
312 
314  pi_program_build_info ParamName,
315  size_t ParamValueSize, void *ParamValue,
316  size_t *ParamValueSizeRet) {
317 
318  return pi2ur::piProgramGetBuildInfo(Program, Device, ParamName,
319  ParamValueSize, ParamValue,
320  ParamValueSizeRet);
321 }
322 
324  return pi2ur::piProgramRetain(Program);
325 }
326 
328  return pi2ur::piProgramRelease(Program);
329 }
330 
332  pi_native_handle *NativeHandle) {
333  return pi2ur::piextProgramGetNativeHandle(Program, NativeHandle);
334 }
335 
337  pi_context Context,
338  bool OwnNativeHandle,
339  pi_program *Program) {
340  return pi2ur::piextProgramCreateWithNativeHandle(NativeHandle, Context,
341  OwnNativeHandle, Program);
342 }
343 
344 pi_result piKernelCreate(pi_program Program, const char *KernelName,
345  pi_kernel *RetKernel) {
346 
347  return pi2ur::piKernelCreate(Program, KernelName, RetKernel);
348 }
349 
350 pi_result piKernelSetArg(pi_kernel Kernel, pi_uint32 ArgIndex, size_t ArgSize,
351  const void *ArgValue) {
352 
353  return pi2ur::piKernelSetArg(Kernel, ArgIndex, ArgSize, ArgValue);
354 }
355 
357  const pi_mem_obj_property *ArgProperties,
358  const pi_mem *ArgValue) {
359  return pi2ur::piextKernelSetArgMemObj(Kernel, ArgIndex, ArgProperties,
360  ArgValue);
361 }
362 
364  const pi_sampler *ArgValue) {
365 
366  return pi2ur::piextKernelSetArgSampler(Kernel, ArgIndex, ArgValue);
367 }
368 
370  size_t ParamValueSize, void *ParamValue,
371  size_t *ParamValueSizeRet) {
372 
373  return pi2ur::piKernelGetInfo(Kernel, ParamName, ParamValueSize, ParamValue,
374  ParamValueSizeRet);
375 }
376 
378  pi_device Device,
379  pi_image_format *ImageFormat,
380  pi_image_desc *ImageDesc,
381  pi_image_mem_handle *RetMem) {
382  return pi2ur::piextMemImageAllocate(Context, Device, ImageFormat, ImageDesc,
383  RetMem);
384 }
385 
387  pi_context Context, pi_device Device, pi_image_mem_handle ImgMem,
388  pi_image_format *ImageFormat, pi_image_desc *ImageDesc,
389  pi_image_handle *RetHandle) {
390  return pi2ur::piextMemUnsampledImageCreate(Context, Device, ImgMem,
391  ImageFormat, ImageDesc, RetHandle);
392 }
393 
395  pi_context Context, pi_device Device, pi_image_mem_handle ImgMem,
396  pi_image_format *ImageFormat, pi_image_desc *ImageDesc, pi_sampler Sampler,
397  pi_image_handle *RetHandle) {
398  return pi2ur::piextMemSampledImageCreate(Context, Device, ImgMem, ImageFormat,
399  ImageDesc, Sampler, RetHandle);
400 }
401 
403  pi_context Context, const pi_sampler_properties *SamplerProperties,
404  float MinMipmapLevelClamp, float MaxMipmapLevelClamp, float MaxAnisotropy,
405  pi_sampler *RetSampler) {
407  Context, SamplerProperties, MinMipmapLevelClamp, MaxMipmapLevelClamp,
408  MaxAnisotropy, RetSampler);
409 }
410 
412  pi_device Device,
413  pi_image_mem_handle MipMem,
414  unsigned int Level,
415  pi_image_mem_handle *RetMem) {
416  return pi2ur::piextMemMipmapGetLevel(Context, Device, MipMem, Level, RetMem);
417 }
418 
419 __SYCL_EXPORT pi_result piextMemImageFree(pi_context Context, pi_device Device,
420  pi_image_mem_handle MemoryHandle) {
421  return pi2ur::piextMemImageFree(Context, Device, MemoryHandle);
422 }
423 
424 __SYCL_EXPORT pi_result piextMemMipmapFree(pi_context Context, pi_device Device,
425  pi_image_mem_handle MemoryHandle) {
426  return pi2ur::piextMemMipmapFree(Context, Device, MemoryHandle);
427 }
428 
430  pi_queue Queue, void *DstPtr, void *SrcPtr,
431  const pi_image_format *ImageFormat, const pi_image_desc *ImageDesc,
432  const pi_image_copy_flags Flags, pi_image_offset SrcOffset,
433  pi_image_offset DstOffset, pi_image_region CopyExtent,
434  pi_image_region HostExtent, pi_uint32 NumEventsInWaitList,
435  const pi_event *EventWaitList, pi_event *Event) {
436  return pi2ur::piextMemImageCopy(Queue, DstPtr, SrcPtr, ImageFormat, ImageDesc,
437  Flags, SrcOffset, DstOffset, CopyExtent,
438  HostExtent, NumEventsInWaitList,
439  EventWaitList, Event);
440 }
441 
443  pi_context Context, pi_device Device, pi_image_handle Handle) {
444  return pi2ur::piextMemUnsampledImageHandleDestroy(Context, Device, Handle);
445 }
446 
448  pi_context Context, pi_device Device, pi_image_handle Handle) {
449  return pi2ur::piextMemSampledImageHandleDestroy(Context, Device, Handle);
450 }
451 
453  pi_image_info ParamName,
454  void *ParamValue,
455  size_t *ParamValueSizeRet) {
456  return pi2ur::piextMemImageGetInfo(MemHandle, ParamName, ParamValue,
457  ParamValueSizeRet);
458 }
459 
460 __SYCL_EXPORT_DEPRECATED("This function has been deprecated in favor of "
461  "`piextImportExternalMemory`")
463  size_t Size, int FileDescriptor,
464  pi_interop_mem_handle *RetHandle) {
465  return pi2ur::piextMemImportOpaqueFD(Context, Device, Size, FileDescriptor,
466  RetHandle);
467 }
468 
470  pi_context Context, pi_device Device, pi_external_mem_descriptor *MemDesc,
471  pi_interop_mem_handle *RetHandle) {
472  return pi2ur::piextImportExternalMemory(Context, Device, MemDesc, RetHandle);
473 }
474 
476  pi_context Context, pi_device Device, pi_image_format *ImageFormat,
477  pi_image_desc *ImageDesc, pi_interop_mem_handle MemHandle,
478  pi_image_mem_handle *RetMem) {
479  return pi2ur::piextMemMapExternalArray(Context, Device, ImageFormat,
480  ImageDesc, MemHandle, RetMem);
481 }
482 
484  pi_device Device,
485  pi_interop_mem_handle ExtMem) {
486  return pi2ur::piextMemReleaseInterop(Context, Device, ExtMem);
487 }
488 
489 __SYCL_EXPORT_DEPRECATED("This function has been deprecated in favor of "
490  "`piextImportExternalSemaphore`")
491 pi_result
493  int FileDescriptor,
494  pi_interop_semaphore_handle *RetHandle) {
495  return pi2ur::piextImportExternalSemaphoreOpaqueFD(Context, Device,
496  FileDescriptor, RetHandle);
497 }
498 
499 __SYCL_EXPORT pi_result
502  pi_interop_semaphore_handle *RetHandle) {
503  return pi2ur::piextImportExternalSemaphore(Context, Device, SemDesc,
504  RetHandle);
505 }
506 
507 __SYCL_EXPORT pi_result
509  pi_interop_semaphore_handle SemHandle) {
510  return pi2ur::piextDestroyExternalSemaphore(Context, Device, SemHandle);
511 }
512 
514  pi_queue Queue, pi_interop_semaphore_handle SemHandle, bool HasWaitValue,
515  pi_uint64 WaitValue, pi_uint32 NumEventsInWaitList,
516  const pi_event *EventWaitList, pi_event *Event) {
517  return pi2ur::piextWaitExternalSemaphore(Queue, SemHandle, HasWaitValue,
518  WaitValue, NumEventsInWaitList,
519  EventWaitList, Event);
520 }
521 
523  pi_queue Queue, pi_interop_semaphore_handle SemHandle, bool HasSignalValue,
524  pi_uint64 SignalValue, pi_uint32 NumEventsInWaitList,
525  const pi_event *EventWaitList, pi_event *Event) {
526  return pi2ur::piextSignalExternalSemaphore(Queue, SemHandle, HasSignalValue,
527  SignalValue, NumEventsInWaitList,
528  EventWaitList, Event);
529 }
530 
532  pi_kernel_group_info ParamName,
533  size_t ParamValueSize, void *ParamValue,
534  size_t *ParamValueSizeRet) {
535  return pi2ur::piKernelGetGroupInfo(Kernel, Device, ParamName, ParamValueSize,
536  ParamValue, ParamValueSizeRet);
537 }
538 
540  pi_kernel_sub_group_info ParamName,
541  size_t InputValueSize, const void *InputValue,
542  size_t ParamValueSize, void *ParamValue,
543  size_t *ParamValueSizeRet) {
545  Kernel, Device, ParamName, InputValueSize, InputValue, ParamValueSize,
546  ParamValue, ParamValueSizeRet);
547 }
548 
550 
551  return pi2ur::piKernelRetain(Kernel);
552 }
553 
555 
556  return pi2ur::piKernelRelease(Kernel);
557 }
558 
559 pi_result
561  const size_t *GlobalWorkOffset,
562  const size_t *GlobalWorkSize, const size_t *LocalWorkSize,
563  pi_uint32 NumEventsInWaitList,
564  const pi_event *EventWaitList, pi_event *OutEvent) {
566  Queue, Kernel, WorkDim, GlobalWorkOffset, GlobalWorkSize, LocalWorkSize,
567  NumEventsInWaitList, EventWaitList, OutEvent);
568 }
569 
571  pi_queue Queue, pi_kernel Kernel, pi_uint32 WorkDim,
572  const size_t *GlobalWorkOffset, const size_t *GlobalWorkSize,
573  const size_t *LocalWorkSize, pi_uint32 NumEventsInWaitList,
574  const pi_event *EventWaitList, pi_event *OutEvent) {
576  Queue, Kernel, WorkDim, GlobalWorkOffset, GlobalWorkSize, LocalWorkSize,
577  NumEventsInWaitList, EventWaitList, OutEvent);
578 }
579 
581  pi_context Context,
582  pi_program Program,
583  bool OwnNativeHandle,
584  pi_kernel *Kernel) {
585 
587  NativeHandle, Context, Program, OwnNativeHandle, Kernel);
588 }
589 
591  pi_native_handle *NativeHandle) {
592  return pi2ur::piextKernelGetNativeHandle(Kernel, NativeHandle);
593 }
594 
596  pi_kernel Kernel, size_t LocalWorkSize, size_t DynamicSharedMemorySize,
597  pi_uint32 *GroupCountRet) {
599  Kernel, LocalWorkSize, DynamicSharedMemorySize, GroupCountRet);
600 }
601 
603  return pi2ur::piEventCreate(Context, RetEvent);
604 }
605 
607  size_t ParamValueSize, void *ParamValue,
608  size_t *ParamValueSizeRet) {
609  return pi2ur::piEventGetInfo(Event, ParamName, ParamValueSize, ParamValue,
610  ParamValueSizeRet);
611 }
612 
614  size_t ParamValueSize, void *ParamValue,
615  size_t *ParamValueSizeRet) {
616 
617  return pi2ur::piEventGetProfilingInfo(Event, ParamName, ParamValueSize,
618  ParamValue, ParamValueSizeRet);
619 }
620 
621 pi_result piEventsWait(pi_uint32 NumEvents, const pi_event *EventList) {
622  return pi2ur::piEventsWait(NumEvents, EventList);
623 }
624 
625 pi_result piEventSetCallback(pi_event Event, pi_int32 CommandExecCallbackType,
626  void (*PFnNotify)(pi_event Event,
627  pi_int32 EventCommandStatus,
628  void *UserData),
629  void *UserData) {
630  return pi2ur::piEventSetCallback(Event, CommandExecCallbackType, PFnNotify,
631  UserData);
632 }
633 
634 pi_result piEventSetStatus(pi_event Event, pi_int32 ExecutionStatus) {
635  return pi2ur::piEventSetStatus(Event, ExecutionStatus);
636 }
637 
639 
641  return pi2ur::piEventRelease(Event);
642 }
643 
645  pi_native_handle *NativeHandle) {
646 
647  return pi2ur::piextEventGetNativeHandle(Event, NativeHandle);
648 }
649 
651  pi_context Context,
652  bool OwnNativeHandle,
653  pi_event *Event) {
654  return pi2ur::piextEventCreateWithNativeHandle(NativeHandle, Context,
655  OwnNativeHandle, Event);
656 }
657 
659  pi_uint32 NumEventsInWaitList,
660  const pi_event *EventWaitList,
661  pi_event *Event) {
663  Queue, Blocking, NumEventsInWaitList, EventWaitList, Event);
664 }
665 
667  const pi_sampler_properties *SamplerProperties,
668  pi_sampler *RetSampler) {
669  return pi2ur::piSamplerCreate(Context, SamplerProperties, RetSampler);
670 }
671 
673  size_t ParamValueSize, void *ParamValue,
674  size_t *ParamValueSizeRet) {
675 
676  return pi2ur::piSamplerGetInfo(Sampler, ParamName, ParamValueSize, ParamValue,
677  ParamValueSizeRet);
678 }
679 
681  return pi2ur::piSamplerRetain(Sampler);
682 }
683 
685  return pi2ur::piSamplerRelease(Sampler);
686 }
687 
688 pi_result piEnqueueEventsWait(pi_queue Queue, pi_uint32 NumEventsInWaitList,
689  const pi_event *EventWaitList,
690  pi_event *OutEvent) {
691 
692  return pi2ur::piEnqueueEventsWait(Queue, NumEventsInWaitList, EventWaitList,
693  OutEvent);
694 }
695 
697  pi_uint32 NumEventsInWaitList,
698  const pi_event *EventWaitList,
699  pi_event *OutEvent) {
700 
701  return pi2ur::piEnqueueEventsWaitWithBarrier(Queue, NumEventsInWaitList,
702  EventWaitList, OutEvent);
703 }
704 
706  pi_bool BlockingRead, size_t Offset,
707  size_t Size, void *Dst,
708  pi_uint32 NumEventsInWaitList,
709  const pi_event *EventWaitList,
710  pi_event *Event) {
711 
712  return pi2ur::piEnqueueMemBufferRead(Queue, Src, BlockingRead, Offset, Size,
713  Dst, NumEventsInWaitList, EventWaitList,
714  Event);
715 }
716 
718  pi_queue Queue, pi_mem Buffer, pi_bool BlockingRead,
719  pi_buff_rect_offset BufferOffset, pi_buff_rect_offset HostOffset,
720  pi_buff_rect_region Region, size_t BufferRowPitch, size_t BufferSlicePitch,
721  size_t HostRowPitch, size_t HostSlicePitch, void *Ptr,
722  pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList,
723  pi_event *Event) {
724 
726  Queue, Buffer, BlockingRead, BufferOffset, HostOffset, Region,
727  BufferRowPitch, BufferSlicePitch, HostRowPitch, HostSlicePitch, Ptr,
728  NumEventsInWaitList, EventWaitList, Event);
729 }
730 
732  pi_bool BlockingWrite, size_t Offset,
733  size_t Size, const void *Ptr,
734  pi_uint32 NumEventsInWaitList,
735  const pi_event *EventWaitList,
736  pi_event *Event) {
737 
738  return pi2ur::piEnqueueMemBufferWrite(Queue, Buffer, BlockingWrite, Offset,
739  Size, Ptr, NumEventsInWaitList,
740  EventWaitList, Event);
741 }
742 
744  pi_queue Queue, pi_mem Buffer, pi_bool BlockingWrite,
745  pi_buff_rect_offset BufferOffset, pi_buff_rect_offset HostOffset,
746  pi_buff_rect_region Region, size_t BufferRowPitch, size_t BufferSlicePitch,
747  size_t HostRowPitch, size_t HostSlicePitch, const void *Ptr,
748  pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList,
749  pi_event *Event) {
750 
752  Queue, Buffer, BlockingWrite, BufferOffset, HostOffset, Region,
753  BufferRowPitch, BufferSlicePitch, HostRowPitch, HostSlicePitch, Ptr,
754  NumEventsInWaitList, EventWaitList, Event);
755 }
756 
758  size_t SrcOffset, size_t DstOffset,
759  size_t Size, pi_uint32 NumEventsInWaitList,
760  const pi_event *EventWaitList,
761  pi_event *Event) {
762 
763  return pi2ur::piEnqueueMemBufferCopy(Queue, SrcMem, DstMem, SrcOffset,
764  DstOffset, Size, NumEventsInWaitList,
765  EventWaitList, Event);
766 }
767 
769  pi_queue Queue, pi_mem SrcMem, pi_mem DstMem, pi_buff_rect_offset SrcOrigin,
770  pi_buff_rect_offset DstOrigin, pi_buff_rect_region Region,
771  size_t SrcRowPitch, size_t SrcSlicePitch, size_t DstRowPitch,
772  size_t DstSlicePitch, pi_uint32 NumEventsInWaitList,
773  const pi_event *EventWaitList, pi_event *Event) {
774 
776  Queue, SrcMem, DstMem, SrcOrigin, DstOrigin, Region, SrcRowPitch,
777  SrcSlicePitch, DstRowPitch, DstSlicePitch, NumEventsInWaitList,
778  EventWaitList, Event);
779 }
780 
782  const void *Pattern, size_t PatternSize,
783  size_t Offset, size_t Size,
784  pi_uint32 NumEventsInWaitList,
785  const pi_event *EventWaitList,
786  pi_event *Event) {
787 
788  return pi2ur::piEnqueueMemBufferFill(Queue, Buffer, Pattern, PatternSize,
789  Offset, Size, NumEventsInWaitList,
790  EventWaitList, Event);
791 }
792 
794  pi_map_flags MapFlags, size_t Offset,
795  size_t Size, pi_uint32 NumEventsInWaitList,
796  const pi_event *EventWaitList,
797  pi_event *OutEvent, void **RetMap) {
798 
799  return pi2ur::piEnqueueMemBufferMap(Queue, Mem, BlockingMap, MapFlags, Offset,
800  Size, NumEventsInWaitList, EventWaitList,
801  OutEvent, RetMap);
802 }
803 
804 pi_result piEnqueueMemUnmap(pi_queue Queue, pi_mem Mem, void *MappedPtr,
805  pi_uint32 NumEventsInWaitList,
806  const pi_event *EventWaitList, pi_event *OutEvent) {
807 
808  return pi2ur::piEnqueueMemUnmap(Queue, Mem, MappedPtr, NumEventsInWaitList,
809  EventWaitList, OutEvent);
810 }
811 
813  size_t ParamValueSize, void *ParamValue,
814  size_t *ParamValueSizeRet) {
815 
816  return pi2ur::piMemImageGetInfo(Image, ParamName, ParamValueSize, ParamValue,
817  ParamValueSizeRet);
818 }
819 
821  pi_bool BlockingRead, pi_image_offset Origin,
822  pi_image_region Region, size_t RowPitch,
823  size_t SlicePitch, void *Ptr,
824  pi_uint32 NumEventsInWaitList,
825  const pi_event *EventWaitList,
826  pi_event *Event) {
828  Queue, Image, BlockingRead, Origin, Region, RowPitch, SlicePitch, Ptr,
829  NumEventsInWaitList, EventWaitList, Event);
830 }
831 
833  pi_bool BlockingWrite, pi_image_offset Origin,
834  pi_image_region Region, size_t InputRowPitch,
835  size_t InputSlicePitch, const void *Ptr,
836  pi_uint32 NumEventsInWaitList,
837  const pi_event *EventWaitList,
838  pi_event *Event) {
839 
841  Queue, Image, BlockingWrite, Origin, Region, InputRowPitch,
842  InputSlicePitch, Ptr, NumEventsInWaitList, EventWaitList, Event);
843 }
844 
845 pi_result
846 piEnqueueMemImageCopy(pi_queue Queue, pi_mem SrcImage, pi_mem DstImage,
847  pi_image_offset SrcOrigin, pi_image_offset DstOrigin,
848  pi_image_region Region, pi_uint32 NumEventsInWaitList,
849  const pi_event *EventWaitList, pi_event *Event) {
850  return pi2ur::piEnqueueMemImageCopy(Queue, SrcImage, DstImage, SrcOrigin,
851  DstOrigin, Region, NumEventsInWaitList,
852  EventWaitList, Event);
853 }
854 
856  const void *FillColor, const size_t *Origin,
857  const size_t *Region,
858  pi_uint32 NumEventsInWaitList,
859  const pi_event *EventWaitList,
860  pi_event *Event) {
861 
862  return pi2ur::piEnqueueMemImageFill(Queue, Image, FillColor, Origin, Region,
863  NumEventsInWaitList, EventWaitList,
864  Event);
865 }
866 
868  pi_buffer_create_type BufferCreateType,
869  void *BufferCreateInfo, pi_mem *RetMem) {
870 
871  return pi2ur::piMemBufferPartition(Buffer, Flags, BufferCreateType,
872  BufferCreateInfo, RetMem);
873 }
874 
876  const char *FunctionName,
877  pi_uint64 *FunctionPointerRet) {
878  return pi2ur::piextGetDeviceFunctionPointer(Device, Program, FunctionName,
879  FunctionPointerRet);
880 }
881 
883  const char *GlobalVariableName,
884  size_t *GlobalVariableSize,
885  void **GlobalVariablePointerRet) {
887  Device, Program, GlobalVariableName, GlobalVariableSize,
888  GlobalVariablePointerRet);
889 }
890 
891 pi_result piextUSMDeviceAlloc(void **ResultPtr, pi_context Context,
892  pi_device Device,
893  pi_usm_mem_properties *Properties, size_t Size,
895 
896  return pi2ur::piextUSMDeviceAlloc(ResultPtr, Context, Device, Properties,
897  Size, Alignment);
898 }
899 
900 pi_result piextUSMSharedAlloc(void **ResultPtr, pi_context Context,
901  pi_device Device,
902  pi_usm_mem_properties *Properties, size_t Size,
904 
905  return pi2ur::piextUSMSharedAlloc(ResultPtr, Context, Device, Properties,
906  Size, Alignment);
907 }
908 
910  void **ResultPtr, size_t *ResultPitch, pi_context Context, pi_device Device,
911  pi_usm_mem_properties *Properties, size_t WidthInBytes, size_t Height,
912  unsigned int ElementSizeBytes) {
913 
914  return pi2ur::piextUSMPitchedAlloc(ResultPtr, ResultPitch, Context, Device,
915  Properties, WidthInBytes, Height,
916  ElementSizeBytes);
917 }
918 
919 pi_result piextUSMHostAlloc(void **ResultPtr, pi_context Context,
920  pi_usm_mem_properties *Properties, size_t Size,
922  return pi2ur::piextUSMHostAlloc(ResultPtr, Context, Properties, Size,
923  Alignment);
924 }
925 
926 pi_result piextUSMFree(pi_context Context, void *Ptr) {
927 
928  return pi2ur::piextUSMFree(Context, Ptr);
929 }
930 
932  size_t ArgSize, const void *ArgValue) {
933  return pi2ur::piextKernelSetArgPointer(Kernel, ArgIndex, ArgSize, ArgValue);
934 }
935 
937  size_t Count, pi_uint32 NumEventsInWaitlist,
938  const pi_event *EventsWaitlist,
939  pi_event *Event) {
941  Queue, Ptr, Value, Count, NumEventsInWaitlist, EventsWaitlist, Event);
942 }
943 
944 pi_result piextUSMEnqueueMemcpy(pi_queue Queue, pi_bool Blocking, void *DstPtr,
945  const void *SrcPtr, size_t Size,
946  pi_uint32 NumEventsInWaitlist,
947  const pi_event *EventsWaitlist,
948  pi_event *Event) {
949 
950  return pi2ur::piextUSMEnqueueMemcpy(Queue, Blocking, DstPtr, SrcPtr, Size,
951  NumEventsInWaitlist, EventsWaitlist,
952  Event);
953 }
954 
955 pi_result piextUSMEnqueuePrefetch(pi_queue Queue, const void *Ptr, size_t Size,
957  pi_uint32 NumEventsInWaitList,
958  const pi_event *EventWaitList,
959  pi_event *OutEvent) {
960 
962  Queue, Ptr, Size, Flags, NumEventsInWaitList, EventWaitList, OutEvent);
963 }
964 
966  size_t Length, pi_mem_advice Advice,
967  pi_event *OutEvent) {
968 
969  return pi2ur::piextUSMEnqueueMemAdvise(Queue, Ptr, Length, Advice, OutEvent);
970 }
971 
972 __SYCL_EXPORT pi_result piextUSMEnqueueFill2D(pi_queue Queue, void *Ptr,
973  size_t Pitch, size_t PatternSize,
974  const void *Pattern, size_t Width,
975  size_t Height,
976  pi_uint32 NumEventsWaitList,
977  const pi_event *EventsWaitList,
978  pi_event *Event) {
979 
980  return pi2ur::piextUSMEnqueueFill2D(Queue, Ptr, Pitch, PatternSize, Pattern,
981  Width, Height, NumEventsWaitList,
982  EventsWaitList, Event);
983 }
984 
985 __SYCL_EXPORT pi_result piextUSMEnqueueMemset2D(pi_queue Queue, void *Ptr,
986  size_t Pitch, int Value,
987  size_t Width, size_t Height,
988  pi_uint32 NumEventsWaitList,
989  const pi_event *EventsWaitlist,
990  pi_event *Event) {
991 
992  return pi2ur::piextUSMEnqueueMemset2D(Queue, Ptr, Pitch, Value, Width, Height,
993  NumEventsWaitList, EventsWaitlist,
994  Event);
995 }
996 
998  pi_queue Queue, pi_bool Blocking, void *DstPtr, size_t DstPitch,
999  const void *SrcPtr, size_t SrcPitch, size_t Width, size_t Height,
1000  pi_uint32 NumEventsInWaitlist, const pi_event *EventWaitlist,
1001  pi_event *Event) {
1002 
1004  Queue, Blocking, DstPtr, DstPitch, SrcPtr, SrcPitch, Width, Height,
1005  NumEventsInWaitlist, EventWaitlist, Event);
1006 }
1007 
1009  pi_mem_alloc_info ParamName,
1010  size_t ParamValueSize, void *ParamValue,
1011  size_t *ParamValueSizeRet) {
1012  return pi2ur::piextUSMGetMemAllocInfo(Context, Ptr, ParamName, ParamValueSize,
1013  ParamValue, ParamValueSizeRet);
1014 }
1015 
1016 pi_result piextUSMImport(const void *HostPtr, size_t Size, pi_context Context) {
1017  return pi2ur::piextUSMImport(HostPtr, Size, Context);
1018 }
1019 
1020 pi_result piextUSMRelease(const void *HostPtr, pi_context Context) {
1021  return pi2ur::piextUSMRelease(HostPtr, Context);
1022 }
1023 
1025  pi_queue Queue, pi_program Program, const char *Name, pi_bool BlockingWrite,
1026  size_t Count, size_t Offset, const void *Src, pi_uint32 NumEventsInWaitList,
1027  const pi_event *EventsWaitList, pi_event *Event) {
1029  Queue, Program, Name, BlockingWrite, Count, Offset, Src,
1030  NumEventsInWaitList, EventsWaitList, Event);
1031 }
1032 
1034  pi_queue Queue, pi_program Program, const char *Name, pi_bool BlockingRead,
1035  size_t Count, size_t Offset, void *Dst, pi_uint32 NumEventsInWaitList,
1036  const pi_event *EventsWaitList, pi_event *Event) {
1038  Queue, Program, Name, BlockingRead, Count, Offset, Dst,
1039  NumEventsInWaitList, EventsWaitList, Event);
1040 
1041  return PI_SUCCESS;
1042 }
1043 
1045  const char *PipeSymbol, pi_bool Blocking,
1046  void *Ptr, size_t Size,
1047  pi_uint32 NumEventsInWaitList,
1048  const pi_event *EventsWaitList,
1049  pi_event *Event) {
1050  (void)Queue;
1051  (void)Program;
1052  (void)PipeSymbol;
1053  (void)Blocking;
1054  (void)Ptr;
1055  (void)Size;
1056  (void)NumEventsInWaitList;
1057  (void)EventsWaitList;
1058  (void)Event;
1059  PI_ASSERT(Queue, PI_ERROR_INVALID_QUEUE);
1060  die("piextEnqueueReadHostPipe: not implemented");
1061  return {};
1062 }
1063 
1065  const char *PipeSymbol, pi_bool Blocking,
1066  void *Ptr, size_t Size,
1067  pi_uint32 NumEventsInWaitList,
1068  const pi_event *EventsWaitList,
1069  pi_event *Event) {
1070  (void)Queue;
1071  (void)Program;
1072  (void)PipeSymbol;
1073  (void)Blocking;
1074  (void)Ptr;
1075  (void)Size;
1076  (void)NumEventsInWaitList;
1077  (void)EventsWaitList;
1078  (void)Event;
1079  PI_ASSERT(Queue, PI_ERROR_INVALID_QUEUE);
1080  die("piextEnqueueWriteHostPipe: not implemented");
1081  return {};
1082 }
1083 
1085  size_t ParamValueSize, const void *ParamValue) {
1086 
1087  return pi2ur::piKernelSetExecInfo(Kernel, ParamName, ParamValueSize,
1088  ParamValue);
1089 }
1090 
1092  pi_uint32 SpecID, size_t Size,
1093  const void *SpecValue) {
1094  return pi2ur::piextProgramSetSpecializationConstant(Prog, SpecID, Size,
1095  SpecValue);
1096 }
1097 
1098 // Command buffer extension
1100  const pi_ext_command_buffer_desc *Desc,
1101  pi_ext_command_buffer *RetCommandBuffer) {
1102  return pi2ur::piextCommandBufferCreate(Context, Device, Desc,
1103  RetCommandBuffer);
1104 }
1105 
1107  return pi2ur::piextCommandBufferRetain(CommandBuffer);
1108 }
1109 
1111  return pi2ur::piextCommandBufferRelease(CommandBuffer);
1112 }
1113 
1115  return pi2ur::piextCommandBufferFinalize(CommandBuffer);
1116 }
1117 
1119  pi_ext_command_buffer CommandBuffer, pi_kernel Kernel, pi_uint32 WorkDim,
1120  const size_t *GlobalWorkOffset, const size_t *GlobalWorkSize,
1121  const size_t *LocalWorkSize, pi_uint32 NumSyncPointsInWaitList,
1122  const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint,
1123  pi_ext_command_buffer_command *Command) {
1125  CommandBuffer, Kernel, WorkDim, GlobalWorkOffset, GlobalWorkSize,
1126  LocalWorkSize, NumSyncPointsInWaitList, SyncPointWaitList, SyncPoint,
1127  Command);
1128 }
1129 
1131  pi_ext_command_buffer CommandBuffer, void *DstPtr, const void *SrcPtr,
1132  size_t Size, pi_uint32 NumSyncPointsInWaitList,
1133  const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint) {
1134  return pi2ur::piextCommandBufferMemcpyUSM(CommandBuffer, DstPtr, SrcPtr, Size,
1135  NumSyncPointsInWaitList,
1136  SyncPointWaitList, SyncPoint);
1137 }
1138 
1140  pi_ext_command_buffer CommandBuffer, pi_mem SrcMem, pi_mem DstMem,
1141  size_t SrcOffset, size_t DstOffset, size_t Size,
1142  pi_uint32 NumSyncPointsInWaitList,
1143  const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint) {
1145  CommandBuffer, SrcMem, DstMem, SrcOffset, DstOffset, Size,
1146  NumSyncPointsInWaitList, SyncPointWaitList, SyncPoint);
1147 }
1148 
1150  pi_ext_command_buffer CommandBuffer, pi_mem SrcMem, pi_mem DstMem,
1151  pi_buff_rect_offset SrcOrigin, pi_buff_rect_offset DstOrigin,
1152  pi_buff_rect_region Region, size_t SrcRowPitch, size_t SrcSlicePitch,
1153  size_t DstRowPitch, size_t DstSlicePitch, pi_uint32 NumSyncPointsInWaitList,
1154  const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint) {
1156  CommandBuffer, SrcMem, DstMem, SrcOrigin, DstOrigin, Region, SrcRowPitch,
1157  SrcSlicePitch, DstRowPitch, DstSlicePitch, NumSyncPointsInWaitList,
1158  SyncPointWaitList, SyncPoint);
1159 }
1160 
1162  pi_ext_command_buffer CommandBuffer, pi_mem Buffer, size_t Offset,
1163  size_t Size, void *Dst, pi_uint32 NumSyncPointsInWaitList,
1164  const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint) {
1166  CommandBuffer, Buffer, Offset, Size, Dst, NumSyncPointsInWaitList,
1167  SyncPointWaitList, SyncPoint);
1168 }
1169 
1171  pi_ext_command_buffer CommandBuffer, pi_mem Buffer,
1172  pi_buff_rect_offset BufferOffset, pi_buff_rect_offset HostOffset,
1173  pi_buff_rect_region Region, size_t BufferRowPitch, size_t BufferSlicePitch,
1174  size_t HostRowPitch, size_t HostSlicePitch, void *Ptr,
1175  pi_uint32 NumSyncPointsInWaitList,
1176  const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint) {
1178  CommandBuffer, Buffer, BufferOffset, HostOffset, Region, BufferRowPitch,
1179  BufferSlicePitch, HostRowPitch, HostSlicePitch, Ptr,
1180  NumSyncPointsInWaitList, SyncPointWaitList, SyncPoint);
1181 }
1182 
1184  pi_ext_command_buffer CommandBuffer, pi_mem Buffer, size_t Offset,
1185  size_t Size, const void *Ptr, pi_uint32 NumSyncPointsInWaitList,
1186  const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint) {
1188  CommandBuffer, Buffer, Offset, Size, Ptr, NumSyncPointsInWaitList,
1189  SyncPointWaitList, SyncPoint);
1190 }
1191 
1193  pi_ext_command_buffer CommandBuffer, pi_mem Buffer,
1194  pi_buff_rect_offset BufferOffset, pi_buff_rect_offset HostOffset,
1195  pi_buff_rect_region Region, size_t BufferRowPitch, size_t BufferSlicePitch,
1196  size_t HostRowPitch, size_t HostSlicePitch, const void *Ptr,
1197  pi_uint32 NumSyncPointsInWaitList,
1198  const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint) {
1200  CommandBuffer, Buffer, BufferOffset, HostOffset, Region, BufferRowPitch,
1201  BufferSlicePitch, HostRowPitch, HostSlicePitch, Ptr,
1202  NumSyncPointsInWaitList, SyncPointWaitList, SyncPoint);
1203 }
1204 
1206  pi_ext_command_buffer CommandBuffer, pi_mem Buffer, const void *Pattern,
1207  size_t PatternSize, size_t Offset, size_t Size,
1208  pi_uint32 NumSyncPointsInWaitList,
1209  const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint) {
1211  CommandBuffer, Buffer, Pattern, PatternSize, Offset, Size,
1212  NumSyncPointsInWaitList, SyncPointWaitList, SyncPoint);
1213 }
1214 
1216  void *Ptr, const void *Pattern,
1217  size_t PatternSize, size_t Size,
1218  pi_uint32 NumSyncPointsInWaitList,
1219  const pi_ext_sync_point *SyncPointWaitList,
1220  pi_ext_sync_point *SyncPoint) {
1222  CommandBuffer, Ptr, Pattern, PatternSize, Size, NumSyncPointsInWaitList,
1223  SyncPointWaitList, SyncPoint);
1224 }
1225 
1227  pi_ext_command_buffer CommandBuffer, const void *Ptr, size_t Size,
1228  pi_usm_migration_flags Flags, pi_uint32 NumSyncPointsInWaitList,
1229  const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint) {
1230  return pi2ur::piextCommandBufferPrefetchUSM(CommandBuffer, Ptr, Size, Flags,
1231  NumSyncPointsInWaitList,
1232  SyncPointWaitList, SyncPoint);
1233 }
1234 
1236  pi_ext_command_buffer CommandBuffer, const void *Ptr, size_t Length,
1237  pi_mem_advice Advice, pi_uint32 NumSyncPointsInWaitList,
1238  const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint) {
1239  return pi2ur::piextCommandBufferAdviseUSM(CommandBuffer, Ptr, Length, Advice,
1240  NumSyncPointsInWaitList,
1241  SyncPointWaitList, SyncPoint);
1242 }
1243 
1245  pi_queue Queue,
1246  pi_uint32 NumEventsInWaitList,
1247  const pi_event *EventWaitList,
1248  pi_event *Event) {
1250  CommandBuffer, Queue, NumEventsInWaitList, EventWaitList, Event);
1251 }
1252 
1256  return pi2ur::piextCommandBufferUpdateKernelLaunch(Command, Desc);
1257 }
1258 
1259 pi_result
1262 }
1263 
1264 pi_result
1267 }
1268 
1269 pi_result piextPluginGetOpaqueData(void *opaque_data_param,
1270  void **opaque_data_return) {
1271  return pi2ur::piextPluginGetOpaqueData(opaque_data_param, opaque_data_return);
1272 }
1273 
1274 pi_result piTearDown(void *PluginParameter) {
1275  return pi2ur::piTearDown(PluginParameter);
1276 }
1277 
1278 pi_result piGetDeviceAndHostTimer(pi_device Device, uint64_t *DeviceTime,
1279  uint64_t *HostTime) {
1280  return pi2ur::piGetDeviceAndHostTimer(Device, DeviceTime, HostTime);
1281 }
1282 
1284  pi_device peer_device) {
1285 
1286  return pi2ur::piextEnablePeerAccess(command_device, peer_device);
1287 }
1288 
1290  pi_device peer_device) {
1291 
1292  return pi2ur::piextDisablePeerAccess(command_device, peer_device);
1293 }
1294 
1296  pi_device peer_device, pi_peer_attr attr,
1297  size_t ParamValueSize, void *ParamValue,
1298  size_t *ParamValueSizeRet) {
1299  return pi2ur::piextPeerAccessGetInfo(command_device, peer_device, attr,
1300  ParamValueSize, ParamValue,
1301  ParamValueSizeRet);
1302 }
1303 
1305 
1307  // Check that the major version matches in PiVersion and SupportedVersion
1309 
1310  // PI interface supports higher version or the same version.
1311  size_t PluginVersionSize = sizeof(PluginInit->PluginVersion);
1312  if (strlen(SupportedVersion) >= PluginVersionSize)
1313  return PI_ERROR_INVALID_VALUE;
1314  strncpy(PluginInit->PluginVersion, SupportedVersion, PluginVersionSize);
1315 
1316  // Set whole function table to zero to make it easier to detect if
1317  // functions are not set up below.
1318  std::memset(&(PluginInit->PiFunctionTable), 0,
1319  sizeof(PluginInit->PiFunctionTable));
1320 
1321 // Forward calls to HIP RT.
1322 #define _PI_API(api) \
1323  (PluginInit->PiFunctionTable).api = (decltype(&::api))(&api);
1324 #include <sycl/detail/pi.def>
1325 #undef _PI_API
1326 
1327  return PI_SUCCESS;
1328 }
1329 
1330 #ifdef _WIN32
1331 #define __SYCL_PLUGIN_DLL_NAME "pi_hip.dll"
1332 #include "../common_win_pi_trace/common_win_pi_trace.hpp"
1333 #undef __SYCL_PLUGIN_DLL_NAME
1334 #endif
1335 
1336 } // 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:5607
pi_result piextUSMEnqueueMemset(pi_queue Queue, void *Ptr, pi_int32 Value, size_t Count, pi_uint32 NumEventsInWaitList, const pi_event *EventsWaitList, pi_event *OutEvent)
Definition: pi2ur.hpp:3896
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:2160
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:4707
pi_result piProgramGetInfo(pi_program Program, pi_program_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi2ur.hpp:1967
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:3520
pi_result piKernelSetExecInfo(pi_kernel Kernel, pi_kernel_exec_info ParamName, size_t ParamValueSize, const void *ParamValue)
Definition: pi2ur.hpp:2332
pi_result piPlatformGetInfo(pi_platform Platform, pi_platform_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi2ur.hpp:876
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:3421
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:3558
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:2465
pi_result piQueueGetInfo(pi_queue Queue, pi_queue_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi2ur.hpp:1824
pi_result piMemRetain(pi_mem Mem)
Definition: pi2ur.hpp:3392
pi_result piPlatformsGet(pi_uint32 NumEntries, pi_platform *Platforms, pi_uint32 *NumPlatforms)
Definition: pi2ur.hpp:823
pi_result piEnqueueEventsWait(pi_queue Queue, pi_uint32 NumEventsInWaitList, const pi_event *EventsWaitList, pi_event *OutEvent)
Definition: pi2ur.hpp:4134
pi_result piextKernelSuggestMaxCooperativeGroupCount(pi_kernel Kernel, size_t LocalWorkSize, size_t DynamicSharedMemorySize, pi_uint32 *GroupCountRet)
Definition: pi2ur.hpp:2657
pi_result piextDestroyExternalSemaphore(pi_context Context, pi_device Device, pi_interop_semaphore_handle SemHandle)
Definition: pi2ur.hpp:5591
pi_result piEnqueueMemUnmap(pi_queue Queue, pi_mem Mem, void *MappedPtr, pi_uint32 NumEventsInWaitList, const pi_event *EventsWaitList, pi_event *OutEvent)
Definition: pi2ur.hpp:3852
pi_result piextDeviceGetNativeHandle(pi_device Device, pi_native_handle *NativeHandle)
Definition: pi2ur.hpp:1337
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:5054
pi_result piextCommandBufferUpdateKernelLaunch(pi_ext_command_buffer_command command, pi_ext_command_buffer_update_kernel_launch_desc *desc)
Definition: pi2ur.hpp:4871
pi_result piProgramRelease(pi_program Program)
Definition: pi2ur.hpp:2543
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:4787
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:3764
pi_result piPluginGetBackendOption(pi_platform Platform, const char *FrontendOption, const char **PlatformOption)
Definition: pi2ur.hpp:936
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:4579
pi_result piextPluginGetOpaqueData(void *opaque_data_param, void **opaque_data_return)
Definition: pi2ur.hpp:929
pi_result piKernelCreate(pi_program Program, const char *KernelName, pi_kernel *RetKernel)
Definition: pi2ur.hpp:2143
pi_result piextUSMImport(const void *HostPtr, size_t Size, pi_context Context)
Definition: pi2ur.hpp:3600
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:3715
pi_result piEventSetStatus(pi_event Event, pi_int32 ExecutionStatus)
Definition: pi2ur.hpp:4344
pi_result piEventSetCallback(pi_event Event, pi_int32 CommandExecCallbackType, void(*PFnNotify)(pi_event Event, pi_int32 EventCommandStatus, void *UserData), void *UserData)
Definition: pi2ur.hpp:4331
pi_result piSamplerCreate(pi_context Context, const pi_sampler_properties *SamplerProperties, pi_sampler *RetSampler)
Definition: pi2ur.hpp:4391
pi_result piSamplerGetInfo(pi_sampler Sampler, pi_sampler_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi2ur.hpp:4452
pi_result piextMemUnsampledImageHandleDestroy(pi_context Context, pi_device Device, pi_image_handle Handle)
Definition: pi2ur.hpp:5298
pi_result piextKernelSetArgSampler(pi_kernel Kernel, pi_uint32 ArgIndex, const pi_sampler *ArgValue)
Definition: pi2ur.hpp:4490
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:1737
pi_result piMemImageGetInfo(pi_mem Image, pi_image_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi2ur.hpp:3623
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:4738
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:5463
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:1921
pi_result piextProgramGetNativeHandle(pi_program Program, pi_native_handle *NativeHandle)
Definition: pi2ur.hpp:2377
pi_result piKernelGetInfo(pi_kernel Kernel, pi_kernel_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi2ur.hpp:2413
pi_result piextEventGetNativeHandle(pi_event Event, pi_native_handle *NativeHandle)
Definition: pi2ur.hpp:4239
pi_result piEnqueueEventsWaitWithBarrier(pi_queue Queue, pi_uint32 NumEventsInWaitList, const pi_event *EventsWaitList, pi_event *OutEvent)
Definition: pi2ur.hpp:4115
pi_result piextMemMipmapFree(pi_context Context, pi_device Device, pi_image_mem_handle MemoryHandle)
Definition: pi2ur.hpp:5223
pi_result piextPlatformGetNativeHandle(pi_platform Platform, pi_native_handle *NativeHandle)
Definition: pi2ur.hpp:836
pi_result piSamplerRelease(pi_sampler Sampler)
Definition: pi2ur.hpp:4512
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:2742
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:4033
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:4660
pi_result piDevicesGet(pi_platform Platform, pi_device_type DeviceType, pi_uint32 NumEntries, pi_device *Devices, pi_uint32 *NumDevices)
Definition: pi2ur.hpp:952
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:2683
pi_result piextEventCreateWithNativeHandle(pi_native_handle NativeHandle, pi_context Context, bool OwnNativeHandle, pi_event *Event)
Definition: pi2ur.hpp:4307
pi_result piEventGetProfilingInfo(pi_event Event, pi_profiling_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi2ur.hpp:4254
pi_result piKernelRetain(pi_kernel Kernel)
Definition: pi2ur.hpp:2521
pi_result piextKernelSetArgMemObj(pi_kernel Kernel, pi_uint32 ArgIndex, const pi_mem_obj_property *ArgProperties, const pi_mem *ArgValue)
Definition: pi2ur.hpp:2216
pi_result piextQueueGetNativeHandle(pi_queue Queue, pi_native_handle *NativeHandle, int32_t *NativeHandleDesc)
Definition: pi2ur.hpp:1783
pi_result piextBindlessImageSamplerCreate(pi_context Context, const pi_sampler_properties *SamplerProperties, float MinMipmapLevelClamp, float MaxMipmapLevelClamp, float MaxAnisotropy, pi_sampler *RetSampler)
Definition: pi2ur.hpp:5081
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:3266
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:2603
pi_result piQueueFlush(pi_queue Queue)
Definition: pi2ur.hpp:1885
pi_result piextKernelSetArgPointer(pi_kernel Kernel, pi_uint32 ArgIndex, size_t, const void *ArgValue)
Definition: pi2ur.hpp:2555
pi_result piEnqueueTimestampRecordingExp(pi_queue Queue, pi_bool Blocking, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *Event)
Definition: pi2ur.hpp:4369
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:2027
pi_result piSamplerRetain(pi_sampler Sampler)
Definition: pi2ur.hpp:4501
pi_result piextDeviceSelectBinary(pi_device Device, pi_device_binary *Binaries, pi_uint32 NumBinaries, pi_uint32 *SelectedBinaryInd)
Definition: pi2ur.hpp:1459
pi_result piextContextSetExtendedDeleter(pi_context Context, pi_context_extended_deleter Function, void *UserData)
Definition: pi2ur.hpp:1538
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:4690
pi_result piextGetDeviceFunctionPointer(pi_device Device, pi_program Program, const char *FunctionName, pi_uint64 *FunctionPointerRet)
Definition: pi2ur.hpp:2179
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:3920
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:5188
pi_result piGetDeviceAndHostTimer(pi_device Device, uint64_t *DeviceTime, uint64_t *HostTime)
Definition: pi2ur.hpp:1451
pi_result piEventGetInfo(pi_event Event, pi_event_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi2ur.hpp:4210
pi_result piMemBufferPartition(pi_mem Buffer, pi_mem_flags Flags, pi_buffer_create_type BufferCreateType, void *BufferCreateInfo, pi_mem *RetMem)
Definition: pi2ur.hpp:3152
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:3954
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:1518
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:3300
pi_result piextUSMRelease(const void *HostPtr, pi_context Context)
Definition: pi2ur.hpp:3612
pi_result piEventRelease(pi_event Event)
Definition: pi2ur.hpp:4360
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:2566
pi_result piQueueRetain(pi_queue Queue)
Definition: pi2ur.hpp:1874
pi_result piextCommandBufferReleaseCommand(pi_ext_command_buffer_command command)
Definition: pi2ur.hpp:4937
pi_result piDeviceRelease(pi_device Device)
Definition: pi2ur.hpp:990
pi_result piContextRetain(pi_context Context)
Definition: pi2ur.hpp:1641
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:5005
pi_result piextUSMHostAlloc(void **ResultPtr, pi_context Context, pi_usm_mem_properties *Properties, size_t Size, pi_uint32 Alignment)
Definition: pi2ur.hpp:2817
pi_result piextCommandBufferRetain(pi_ext_command_buffer CommandBuffer)
Definition: pi2ur.hpp:4550
pi_result piDeviceGetInfo(pi_device Device, pi_device_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi2ur.hpp:1015
pi_result piextImportExternalMemory(pi_context Context, pi_device Device, pi_external_mem_descriptor *MemDescriptor, pi_interop_mem_handle *RetHandle)
Definition: pi2ur.hpp:5407
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:4808
pi_result piextKernelCreateWithNativeHandle(pi_native_handle NativeHandle, pi_context Context, pi_program Program, bool OwnNativeHandle, pi_kernel *Kernel)
Definition: pi2ur.hpp:2300
pi_result piextMemSampledImageHandleDestroy(pi_context Context, pi_device Device, pi_image_handle Handle)
Definition: pi2ur.hpp:5314
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:3874
pi_result piextDeviceCreateWithNativeHandle(pi_native_handle NativeHandle, pi_platform Platform, pi_device *Device)
Definition: pi2ur.hpp:1351
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:3682
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:3819
pi_result piextCommandBufferRetainCommand(pi_ext_command_buffer_command command)
Definition: pi2ur.hpp:4929
pi_result piextEnqueueCommandBuffer(pi_ext_command_buffer CommandBuffer, pi_queue Queue, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *Event)
Definition: pi2ur.hpp:4851
pi_result piextCommandBufferCreate(pi_context Context, pi_device Device, const pi_ext_command_buffer_desc *Desc, pi_ext_command_buffer *RetCommandBuffer)
Definition: pi2ur.hpp:4530
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:3739
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:3539
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:3214
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:3123
pi_result piextQueueCreate(pi_context Context, pi_device Device, pi_queue_properties *Properties, pi_queue *Queue)
Definition: pi2ur.hpp:1660
pi_result piextProgramCreateWithNativeHandle(pi_native_handle NativeHandle, pi_context Context, bool OwnNativeHandle, pi_program *Program)
Definition: pi2ur.hpp:2393
pi_result piextImportExternalSemaphore(pi_context Context, pi_device Device, pi_external_semaphore_descriptor *SemDescriptor, pi_interop_semaphore_handle *RetHandle)
Definition: pi2ur.hpp:5533
pi_result piextUSMFree(pi_context Context, void *Ptr)
Definition: pi2ur.hpp:3385
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:2715
pi_result piEventCreate(pi_context Context, pi_event *RetEvent)
Definition: pi2ur.hpp:4292
pi_result piextKernelGetNativeHandle(pi_kernel Kernel, pi_native_handle *NativeHandle)
Definition: pi2ur.hpp:2643
pi_result piextMemImageGetInfo(pi_image_mem_handle MemHandle, pi_image_info ParamName, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi2ur.hpp:5351
pi_result piQueueFinish(pi_queue Queue)
Definition: pi2ur.hpp:1813
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:4756
pi_result piContextRelease(pi_context Context)
Definition: pi2ur.hpp:1649
pi_result piextPlatformCreateWithNativeHandle(pi_native_handle NativeHandle, pi_platform *Platform)
Definition: pi2ur.hpp:853
pi_result piextMemReleaseInterop(pi_context Context, pi_device Device, pi_interop_mem_handle ExtMem)
Definition: pi2ur.hpp:5488
pi_result piKernelSetArg(pi_kernel Kernel, pi_uint32 ArgIndex, size_t ArgSize, const void *ArgValue)
Definition: pi2ur.hpp:2271
pi_result piEventRetain(pi_event Event)
Definition: pi2ur.hpp:4351
pi_result piextContextGetNativeHandle(pi_context Context, pi_native_handle *NativeHandle)
Definition: pi2ur.hpp:1547
pi_result piMemRelease(pi_mem Mem)
Definition: pi2ur.hpp:3402
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:3979
pi_result piextCommandBufferFinalize(pi_ext_command_buffer CommandBuffer)
Definition: pi2ur.hpp:4570
pi_result piPluginGetLastError(char **Message)
Definition: pi2ur.hpp:998
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:3793
pi_result piKernelRelease(pi_kernel Kernel)
Definition: pi2ur.hpp:2532
pi_result piextMemImageFree(pi_context Context, pi_device Device, pi_image_mem_handle MemoryHandle)
Definition: pi2ur.hpp:5207
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:5028
pi_result piextContextCreateWithNativeHandle(pi_native_handle NativeHandle, pi_uint32 NumDevices, const pi_device *Devices, bool OwnNativeHandle, pi_context *RetContext)
Definition: pi2ur.hpp:1558
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:4971
pi_result piQueueRelease(pi_queue Queue)
Definition: pi2ur.hpp:1803
pi_result piextCommandBufferRelease(pi_ext_command_buffer CommandBuffer)
Definition: pi2ur.hpp:4560
pi_result piContextGetInfo(pi_context Context, pi_context_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi2ur.hpp:1586
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:4613
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:4773
pi_result piextMemGetNativeHandle(pi_mem Mem, pi_device Dev, pi_native_handle *NativeHandle)
Definition: pi2ur.hpp:3199
pi_result piextGetGlobalVariablePointer(pi_device Device, pi_program Program, const char *GlobalVariableName, size_t *GlobalVariableSize, void **GlobalVariablePointerRet)
Definition: pi2ur.hpp:2198
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:5627
pi_result piTearDown(void *PluginParameter)
Definition: pi2ur.hpp:783
pi_result piextMemImportOpaqueFD(pi_context Context, pi_device Device, size_t Size, int FileDescriptor, pi_interop_mem_handle *RetHandle)
Definition: pi2ur.hpp:5380
pi_result piextDisablePeerAccess(pi_device command_device, pi_device peer_device)
Definition: pi2ur.hpp:4960
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:4631
pi_result piextEnablePeerAccess(pi_device command_device, pi_device peer_device)
Definition: pi2ur.hpp:4950
pi_result piDevicePartition(pi_device Device, const pi_device_partition_property *Properties, pi_uint32 NumEntries, pi_device *SubDevices, pi_uint32 *NumSubDevices)
Definition: pi2ur.hpp:1375
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:4057
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:3081
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:2097
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:3999
pi_result piProgramRetain(pi_program Program)
Definition: pi2ur.hpp:2321
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:3458
pi_result piextProgramSetSpecializationConstant(pi_program Program, pi_uint32 SpecID, size_t Size, const void *SpecValue)
Definition: pi2ur.hpp:2126
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:3321
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:4092
pi_result piProgramCreate(pi_context Context, const void *ILBytes, size_t Length, pi_program *Program)
Definition: pi2ur.hpp:1902
pi_result piEventsWait(pi_uint32 NumEvents, const pi_event *EventsWaitList)
Definition: pi2ur.hpp:4196
pi_result piDeviceRetain(pi_device Device)
Definition: pi2ur.hpp:983
pi_result piextImportExternalSemaphoreOpaqueFD(pi_context Context, pi_device Device, int FileDescriptor, pi_interop_semaphore_handle *RetHandle)
Definition: pi2ur.hpp:5506
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:4599
pi_result piextMemCreateWithNativeHandle(pi_native_handle NativeHandle, pi_context Context, bool OwnNativeHandle, pi_mem *Mem)
Definition: pi2ur.hpp:3245
pi_result piMemGetInfo(pi_mem Mem, pi_mem_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi2ur.hpp:2847
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:2059
pi_result piextMemImageCopy(pi_queue Queue, void *DstPtr, void *SrcPtr, const pi_image_format *ImageFormat, const pi_image_desc *ImageDesc, const pi_image_copy_flags Flags, pi_image_offset SrcOffset, pi_image_offset DstOffset, pi_image_region CopyExtent, pi_image_region HostExtent, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *Event)
Definition: pi2ur.hpp:5257
void die(const char *Message)
Definition: pi.cpp:526
#define PI_ASSERT(condition, error)
Definition: pi2ur.hpp:156
int32_t pi_int32
Definition: pi.h:238
uintptr_t pi_native_handle
Definition: pi.h:243
pi_bitfield pi_map_flags
Definition: pi.h:810
_pi_result
Definition: pi.h:250
pi_uint32 pi_bool
Definition: pi.h:241
pi_bitfield pi_usm_mem_properties
Definition: pi.h:822
_pi_device_info
Definition: pi.h:330
_pi_queue_info
Definition: pi.h:538
_pi_mem_advice
Definition: pi.h:641
_pi_kernel_sub_group_info
Definition: pi.h:580
pi_bitfield pi_mem_properties
Definition: pi.h:816
_pi_kernel_group_info
Definition: pi.h:559
pi_uint64 pi_image_handle
Definition: pi.h:1253
_pi_ext_command_buffer_command * pi_ext_command_buffer_command
Definition: pi.h:2451
_pi_kernel_exec_info
Definition: pi.h:1697
_pi_platform_info
Definition: pi.h:265
_pi_image_info
Definition: pi.h:570
pi_uint32 pi_ext_sync_point
Definition: pi.h:2452
_pi_profiling_info
Definition: pi.h:789
_pi_usm_migration_flags
Definition: pi.h:2075
_pi_device_type
Definition: pi.h:298
uint64_t pi_uint64
Definition: pi.h:240
pi_bitfield pi_queue_properties
Definition: pi.h:835
_pi_image_copy_flags
Definition: pi.h:718
pi_bitfield pi_sampler_properties
Definition: pi.h:766
_pi_buffer_create_type
Definition: pi.h:724
uint32_t pi_uint32
Definition: pi.h:239
_pi_event_info
Definition: pi.h:587
intptr_t pi_context_properties
Definition: pi.h:758
pi_bitfield pi_mem_flags
Definition: pi.h:800
constexpr pi_queue_properties PI_QUEUE_FLAGS
Definition: pi.h:836
void(* pi_context_extended_deleter)(void *user_data)
Definition: pi.h:1437
_pi_sampler_info
Definition: pi.h:729
_pi_kernel_info
Definition: pi.h:550
_pi_mem_alloc_info
Definition: pi.h:2058
_pi_context_info
Definition: pi.h:521
void * pi_image_mem_handle
Definition: pi.h:1254
#define _PI_PLUGIN_VERSION_CHECK(PI_API_VERSION, PI_PLUGIN_VERSION)
Definition: pi.h:216
_pi_program_info
Definition: pi.h:509
intptr_t pi_device_partition_property
Definition: pi.h:895
_pi_mem_info
Definition: pi.h:1279
pi_uint64 pi_interop_semaphore_handle
Definition: pi.h:1256
_pi_peer_attr
Definition: pi.h:1281
pi_uint64 pi_interop_mem_handle
Definition: pi.h:1255
_pi_program_build_info
Definition: pi.h:274
C++ wrapper of extern "C" PI interfaces.
pi_result piextContextSetExtendedDeleter(pi_context Context, pi_context_extended_deleter Function, void *UserData)
Definition: pi_hip.cpp:135
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_hip.cpp:201
pi_result piextDisablePeerAccess(pi_device command_device, pi_device peer_device)
Definition: pi_hip.cpp:1289
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_hip.cpp:81
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_hip.cpp:213
pi_result piMemRelease(pi_mem Mem)
Definition: pi_hip.cpp:228
pi_result piEventSetStatus(pi_event Event, pi_int32 ExecutionStatus)
Definition: pi_hip.cpp:634
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_hip.cpp:1244
pi_result piextEnablePeerAccess(pi_device command_device, pi_device peer_device)
Definition: pi_hip.cpp:1283
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_hip.cpp:1024
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_hip.cpp:1139
pi_result piProgramGetBuildInfo(pi_program Program, pi_device Device, pi_program_build_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi_hip.cpp:313
pi_result piKernelGetGroupInfo(pi_kernel Kernel, pi_device Device, pi_kernel_group_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi_hip.cpp:531
pi_result piextDeviceCreateWithNativeHandle(pi_native_handle NativeHandle, pi_platform Platform, pi_device *Device)
Creates PI device object from a native handle.
Definition: pi_hip.cpp:109
pi_result piEventSetCallback(pi_event Event, pi_int32 CommandExecCallbackType, void(*PFnNotify)(pi_event Event, pi_int32 EventCommandStatus, void *UserData), void *UserData)
Definition: pi_hip.cpp:625
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_hip.cpp:1114
pi_result piKernelCreate(pi_program Program, const char *KernelName, pi_kernel *RetKernel)
Definition: pi_hip.cpp:344
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_hip.cpp:294
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_hip.cpp:1226
pi_result piextDeviceGetNativeHandle(pi_device Device, pi_native_handle *NativeHandle)
Gets the native handle of a PI device object.
Definition: pi_hip.cpp:103
pi_result piextPlatformCreateWithNativeHandle(pi_native_handle NativeHandle, pi_platform *Platform)
Creates PI platform object from a native handle.
Definition: pi_hip.cpp:50
pi_result piQueueRetain(pi_queue Queue)
Definition: pi_hip.cpp:183
pi_result piQueueRelease(pi_queue Queue)
Definition: pi_hip.cpp:185
pi_result piextCommandBufferReleaseCommand(pi_ext_command_buffer_command Command)
API to decrement the reference count of a command-buffer command.
Definition: pi_hip.cpp:1265
pi_result piextMemImageGetInfo(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_hip.cpp:452
pi_result piextPluginGetOpaqueData(void *opaque_data_param, void **opaque_data_return)
API to get Plugin internal data, opaque to SYCL RT.
Definition: pi_hip.cpp:1269
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_hip.cpp:1118
pi_result piextEventGetNativeHandle(pi_event Event, pi_native_handle *NativeHandle)
Gets the native handle of a PI event object.
Definition: pi_hip.cpp:644
pi_result piProgramRelease(pi_program Program)
Definition: pi_hip.cpp:327
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_hip.cpp:256
pi_result piextMemImageFree(pi_context Context, pi_device Device, pi_image_mem_handle MemoryHandle)
API to free memory for bindless images.
Definition: pi_hip.cpp:419
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_hip.cpp:705
pi_result piKernelSetArg(pi_kernel Kernel, pi_uint32 ArgIndex, size_t ArgSize, const void *ArgValue)
Definition: pi_hip.cpp:350
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_hip.cpp:96
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_hip.cpp:244
pi_result piSamplerRelease(pi_sampler Sampler)
Definition: pi_hip.cpp:684
pi_result piDeviceRelease(pi_device Device)
Definition: pi_hip.cpp:77
pi_result piextMemUnsampledImageHandleDestroy(pi_context Context, pi_device Device, pi_image_handle Handle)
API to destroy bindless unsampled image handles.
Definition: pi_hip.cpp:442
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_hip.cpp:820
pi_result piextUSMFree(pi_context Context, void *Ptr)
Indicates that the allocated USM memory is no longer needed on the runtime side.
Definition: pi_hip.cpp:926
pi_result piQueueFlush(pi_queue Queue)
Definition: pi_hip.cpp:191
pi_result piMemRetain(pi_mem Mem)
Definition: pi_hip.cpp:226
pi_result piContextGetInfo(pi_context Context, pi_context_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi_hip.cpp:127
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_hip.cpp:768
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_hip.cpp:1084
pi_result piSamplerGetInfo(pi_sampler Sampler, pi_sampler_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi_hip.cpp:672
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_hip.cpp:1091
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_hip.cpp:944
pi_result piextQueueCreate(pi_context Context, pi_device Device, pi_queue_properties *Properties, pi_queue *Queue)
Definition: pi_hip.cpp:170
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_hip.cpp:1183
pi_result piextMemImportOpaqueFD(pi_context Context, pi_device Device, size_t Size, int FileDescriptor, pi_interop_mem_handle *RetHandle)
[DEPRECATED] This function is deprecated in favor of piextImportExternalMemory
Definition: pi_hip.cpp:462
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_hip.cpp:781
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_hip.cpp:570
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_hip.cpp:1295
pi_result piEventCreate(pi_context Context, pi_event *RetEvent)
Create PI event object in a signalled/completed state.
Definition: pi_hip.cpp:602
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_hip.cpp:1130
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_hip.cpp:1149
pi_result piTearDown(void *PluginParameter)
API to notify that the plugin should clean up its resources.
Definition: pi_hip.cpp:1274
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_hip.cpp:386
pi_result piextKernelGetNativeHandle(pi_kernel Kernel, pi_native_handle *NativeHandle)
Gets the native handle of a PI kernel object.
Definition: pi_hip.cpp:590
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_hip.cpp:997
pi_result piSamplerRetain(pi_sampler Sampler)
Definition: pi_hip.cpp:680
pi_result piextMemImageCopy(pi_queue Queue, void *DstPtr, void *SrcPtr, const pi_image_format *ImageFormat, const pi_image_desc *ImageDesc, const pi_image_copy_flags Flags, pi_image_offset SrcOffset, pi_image_offset DstOffset, pi_image_region CopyExtent, pi_image_region HostExtent, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *Event)
API to copy image data Host to Device or Device to Host.
Definition: pi_hip.cpp:429
pi_result piEventRelease(pi_event Event)
Definition: pi_hip.cpp:640
pi_result piKernelRelease(pi_kernel Kernel)
Definition: pi_hip.cpp:554
pi_result piEventGetProfilingInfo(pi_event Event, pi_profiling_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi_hip.cpp:613
pi_result piMemGetInfo(pi_mem Mem, pi_mem_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi_hip.cpp:220
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_hip.cpp:394
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_hip.cpp:793
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_hip.cpp:731
pi_result piKernelGetInfo(pi_kernel Kernel, pi_kernel_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi_hip.cpp:369
pi_result piextUSMImport(const void *HostPtr, size_t Size, pi_context Context)
Import host system memory into USM.
Definition: pi_hip.cpp:1016
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_hip.cpp:972
pi_result piPluginInit(pi_plugin *PluginInit)
Definition: pi_hip.cpp:1306
pi_result piPlatformGetInfo(pi_platform Platform, pi_platform_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi_hip.cpp:38
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_hip.cpp:411
pi_result piextMemMipmapFree(pi_context Context, pi_device Device, pi_image_mem_handle MemoryHandle)
API to free mipmap memory for bindless images.
Definition: pi_hip.cpp:424
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_hip.cpp:522
pi_result piextCommandBufferRetainCommand(pi_ext_command_buffer_command Command)
API to increment the reference count of a command-buffer command.
Definition: pi_hip.cpp:1260
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_hip.cpp:900
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_hip.cpp:743
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_hip.cpp:875
pi_result piextUSMEnqueueMemAdvise(pi_queue Queue, const void *Ptr, size_t Length, pi_mem_advice Advice, pi_event *OutEvent)
USM Memadvise API.
Definition: pi_hip.cpp:965
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_hip.cpp:919
pi_result piProgramRetain(pi_program Program)
Definition: pi_hip.cpp:323
pi_result piQueueGetInfo(pi_queue Queue, pi_queue_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi_hip.cpp:175
pi_result piQueueCreate(pi_context Context, pi_device Device, pi_queue_properties Flags, pi_queue *Queue)
Definition: pi_hip.cpp:164
pi_result piextGetGlobalVariablePointer(pi_device Device, pi_program Program, const char *GlobalVariableName, size_t *GlobalVariableSize, void **GlobalVariablePointerRet)
Definition: pi_hip.cpp:882
const char SupportedVersion[]
Definition: pi_hip.cpp:1304
pi_result piContextRelease(pi_context Context)
Definition: pi_hip.cpp:160
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_hip.cpp:475
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_hip.cpp:757
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_hip.cpp:846
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_hip.cpp:1253
pi_result piEventGetInfo(pi_event Event, pi_event_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi_hip.cpp:606
pi_result piProgramGetInfo(pi_program Program, pi_program_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi_hip.cpp:275
pi_result piextImportExternalSemaphoreOpaqueFD(pi_context Context, pi_device Device, int FileDescriptor, pi_interop_semaphore_handle *RetHandle)
[DEPRECATED] This function is deprecated in favor of piextImportExternalSemaphore
Definition: pi_hip.cpp:492
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_hip.cpp:985
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_hip.cpp:1192
pi_result piextMemReleaseInterop(pi_context Context, pi_device Device, pi_interop_mem_handle ExtMem)
API to destroy interop memory.
Definition: pi_hip.cpp:483
pi_result piextUSMRelease(const void *HostPtr, pi_context Context)
Release host system memory from USM.
Definition: pi_hip.cpp:1020
pi_result piEventsWait(pi_uint32 NumEvents, const pi_event *EventList)
Definition: pi_hip.cpp:621
pi_result piextUSMEnqueueMemset(pi_queue Queue, void *Ptr, pi_int32 Value, size_t Count, pi_uint32 NumEventsInWaitlist, const pi_event *EventsWaitlist, pi_event *Event)
USM Memset API.
Definition: pi_hip.cpp:936
pi_result piextPlatformGetNativeHandle(pi_platform Platform, pi_native_handle *NativeHandle)
Gets the native handle of a PI platform object.
Definition: pi_hip.cpp:45
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_hip.cpp:717
pi_result piMemBufferPartition(pi_mem Buffer, pi_mem_flags Flags, pi_buffer_create_type BufferCreateType, void *BufferCreateInfo, pi_mem *RetMem)
Definition: pi_hip.cpp:867
pi_result piextDestroyExternalSemaphore(pi_context Context, pi_device Device, pi_interop_semaphore_handle SemHandle)
API to destroy the external semaphore handle.
Definition: pi_hip.cpp:508
pi_result piPluginGetLastError(char **message)
API to get Plugin specific warning and error messages.
Definition: pi_hip.cpp:55
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_hip.cpp:1161
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_hip.cpp:832
pi_result piextContextGetNativeHandle(pi_context Context, pi_native_handle *NativeHandle)
Gets the native handle of a PI context object.
Definition: pi_hip.cpp:141
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_hip.cpp:230
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_hip.cpp:1008
pi_result piEnqueueTimestampRecordingExp(pi_queue Queue, pi_bool Blocking, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *Event)
Definition: pi_hip.cpp:658
pi_result piEnqueueEventsWaitWithBarrier(pi_queue Queue, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *OutEvent)
Definition: pi_hip.cpp:696
pi_result piextMemSampledImageHandleDestroy(pi_context Context, pi_device Device, pi_image_handle Handle)
API to destroy bindless sampled image handles.
Definition: pi_hip.cpp:447
pi_result piQueueFinish(pi_queue Queue)
Definition: pi_hip.cpp:189
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_hip.cpp:513
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_hip.cpp:267
pi_result piSamplerCreate(pi_context Context, const pi_sampler_properties *SamplerProperties, pi_sampler *RetSampler)
Definition: pi_hip.cpp:666
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_hip.cpp:1278
pi_result piPlatformsGet(pi_uint32 NumEntries, pi_platform *Platforms, pi_uint32 *NumPlatforms)
Definition: pi_hip.cpp:33
pi_result piDevicesGet(pi_platform Platform, pi_device_type DeviceType, pi_uint32 NumEntries, pi_device *Devices, pi_uint32 *NumDevices)
Definition: pi_hip.cpp:66
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_hip.cpp:855
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_hip.cpp:1064
pi_result piextKernelSetArgMemObj(pi_kernel Kernel, pi_uint32 ArgIndex, const pi_mem_obj_property *ArgProperties, const pi_mem *ArgValue)
Definition: pi_hip.cpp:356
pi_result piDevicePartition(pi_device Device, const pi_device_partition_property *Properties, pi_uint32 NumDevices, pi_device *OutDevices, pi_uint32 *OutNumDevices)
Definition: pi_hip.cpp:88
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_hip.cpp:1033
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_hip.cpp:117
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_hip.cpp:891
pi_result piextKernelSetArgSampler(pi_kernel Kernel, pi_uint32 ArgIndex, const pi_sampler *ArgValue)
Definition: pi_hip.cpp:363
pi_result piextMemGetNativeHandle(pi_mem Mem, pi_device Dev, pi_native_handle *NativeHandle)
Gets the native handle of a PI mem object.
Definition: pi_hip.cpp:239
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_hip.cpp:1044
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_hip.cpp:955
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_hip.cpp:560
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_hip.cpp:1215
pi_result piextCommandBufferRetain(pi_ext_command_buffer CommandBuffer)
API to increment the reference count of the command-buffer.
Definition: pi_hip.cpp:1106
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_hip.cpp:305
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_hip.cpp:469
pi_result piKernelRetain(pi_kernel Kernel)
Definition: pi_hip.cpp:549
pi_result piEventRetain(pi_event Event)
Definition: pi_hip.cpp:638
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_hip.cpp:146
pi_result piextCommandBufferRelease(pi_ext_command_buffer CommandBuffer)
API to decrement the reference count of the command-buffer.
Definition: pi_hip.cpp:1110
pi_result piPluginGetBackendOption(pi_platform platform, const char *frontend_option, const char **backend_option)
API to get backend specific option.
Definition: pi_hip.cpp:59
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_hip.cpp:1205
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_hip.cpp:283
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_hip.cpp:336
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_hip.cpp:1235
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_hip.cpp:650
pi_result piMemImageGetInfo(pi_mem Image, pi_image_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
Definition: pi_hip.cpp:812
pi_result piEnqueueEventsWait(pi_queue Queue, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *OutEvent)
Definition: pi_hip.cpp:688
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_hip.cpp:500
pi_result piDeviceRetain(pi_device Device)
Definition: pi_hip.cpp:73
pi_result piextQueueGetNativeHandle(pi_queue Queue, pi_native_handle *NativeHandle, int32_t *NativeHandleDesc)
Gets the native handle of a PI queue object.
Definition: pi_hip.cpp:193
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_hip.cpp:909
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_hip.cpp:1099
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_hip.cpp:1170
pi_result piContextRetain(pi_context Context)
Definition: pi_hip.cpp:155
pi_result piextKernelSetArgPointer(pi_kernel Kernel, pi_uint32 ArgIndex, size_t ArgSize, const void *ArgValue)
Sets up pointer arguments for CL kernels.
Definition: pi_hip.cpp:931
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_hip.cpp:595
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_hip.cpp:539
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_hip.cpp:402
pi_result piEnqueueMemUnmap(pi_queue Queue, pi_mem Mem, void *MappedPtr, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *OutEvent)
Definition: pi_hip.cpp:804
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_hip.cpp:377
pi_result piProgramCreate(pi_context Context, const void *ILBytes, size_t Length, pi_program *Program)
Definition: pi_hip.cpp:251
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_hip.cpp:580
pi_result piextProgramGetNativeHandle(pi_program Program, pi_native_handle *NativeHandle)
Gets the native handle of a PI program object.
Definition: pi_hip.cpp:331
Declarations for HIP Plugin.
#define _PI_HIP_PLUGIN_VERSION_STRING
Definition: pi_hip.hpp:25
char PluginVersion[20]
Definition: pi.h:3077
struct _pi_plugin::FunctionPointers PiFunctionTable
char PiVersion[20]
Definition: pi.h:3075
This struct is a record of the device binary information.
Definition: pi.h:1067