//==------------ pi.def Plugin Interface list of API -----------------------==//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef _PI_API
#error Undefined _PI_API macro expansion
#endif

// The list of all PI interfaces wrapped with _PI_API macro.
// This is for convinience of doing same thing for all interfaces, e.g.
// declare, define, initialize.
//
// This list is used to define PiApiKind enum, which is part of external
// interface. To avoid ABI breakage, please, add new entries to the end of the
// list.
//
// Platform
_PI_API(piPlatformsGet)
_PI_API(piPlatformGetInfo)
_PI_API(piextPlatformGetNativeHandle)
_PI_API(piextPlatformCreateWithNativeHandle)
// Device
_PI_API(piDevicesGet)
_PI_API(piDeviceGetInfo)
_PI_API(piDevicePartition)
_PI_API(piDeviceRetain)
_PI_API(piDeviceRelease)
_PI_API(piextDeviceSelectBinary)
_PI_API(piextGetDeviceFunctionPointer)
_PI_API(piextDeviceGetNativeHandle)
_PI_API(piextDeviceCreateWithNativeHandle)
// Context
_PI_API(piContextCreate)
_PI_API(piContextGetInfo)
_PI_API(piContextRetain)
_PI_API(piContextRelease)
_PI_API(piextContextSetExtendedDeleter)
_PI_API(piextContextGetNativeHandle)
_PI_API(piextContextCreateWithNativeHandle)
// Queue
_PI_API(piQueueCreate)
_PI_API(piextQueueCreate)
_PI_API(piQueueGetInfo)
_PI_API(piQueueFinish)
_PI_API(piQueueFlush)
_PI_API(piQueueRetain)
_PI_API(piQueueRelease)
_PI_API(piextQueueGetNativeHandle)
_PI_API(piextQueueCreateWithNativeHandle)
// Memory
_PI_API(piMemBufferCreate)
_PI_API(piMemImageCreate)
_PI_API(piMemGetInfo)
_PI_API(piMemImageGetInfo)
_PI_API(piMemRetain)
_PI_API(piMemRelease)
_PI_API(piMemBufferPartition)
_PI_API(piextMemGetNativeHandle)
_PI_API(piextMemCreateWithNativeHandle)
_PI_API(piextMemImageCreateWithNativeHandle)
// Program
_PI_API(piProgramCreate)
_PI_API(piProgramCreateWithBinary)
_PI_API(piProgramGetInfo)
_PI_API(piProgramCompile)
_PI_API(piProgramBuild)
_PI_API(piProgramLink)
_PI_API(piProgramGetBuildInfo)
_PI_API(piProgramRetain)
_PI_API(piProgramRelease)
_PI_API(piextProgramSetSpecializationConstant)
_PI_API(piextProgramGetNativeHandle)
_PI_API(piextProgramCreateWithNativeHandle)
// Kernel
_PI_API(piKernelCreate)
_PI_API(piKernelSetArg)
_PI_API(piKernelGetInfo)
_PI_API(piKernelGetGroupInfo)
_PI_API(piKernelGetSubGroupInfo)
_PI_API(piKernelRetain)
_PI_API(piKernelRelease)
_PI_API(piextKernelSetArgPointer)
_PI_API(piKernelSetExecInfo)
_PI_API(piextKernelCreateWithNativeHandle)
_PI_API(piextKernelGetNativeHandle)
// Event
_PI_API(piEventCreate)
_PI_API(piEventGetInfo)
_PI_API(piEventGetProfilingInfo)
_PI_API(piEventsWait)
_PI_API(piEventSetCallback)
_PI_API(piEventSetStatus)
_PI_API(piEventRetain)
_PI_API(piEventRelease)
_PI_API(piextEventGetNativeHandle)
_PI_API(piextEventCreateWithNativeHandle)
// Sampler
_PI_API(piSamplerCreate)
_PI_API(piSamplerGetInfo)
_PI_API(piSamplerRetain)
_PI_API(piSamplerRelease)
// Queue commands
_PI_API(piEnqueueKernelLaunch)
_PI_API(piEnqueueEventsWait)
_PI_API(piEnqueueEventsWaitWithBarrier)
_PI_API(piEnqueueMemBufferRead)
_PI_API(piEnqueueMemBufferReadRect)
_PI_API(piEnqueueMemBufferWrite)
_PI_API(piEnqueueMemBufferWriteRect)
_PI_API(piEnqueueMemBufferCopy)
_PI_API(piEnqueueMemBufferCopyRect)
_PI_API(piEnqueueMemBufferFill)
_PI_API(piEnqueueMemImageRead)
_PI_API(piEnqueueMemImageWrite)
_PI_API(piEnqueueMemImageCopy)
_PI_API(piEnqueueMemImageFill)
_PI_API(piEnqueueMemBufferMap)
_PI_API(piEnqueueMemUnmap)
// USM
_PI_API(piextUSMHostAlloc)
_PI_API(piextUSMDeviceAlloc)
_PI_API(piextUSMSharedAlloc)
_PI_API(piextUSMFree)
_PI_API(piextUSMEnqueueMemset)
_PI_API(piextUSMEnqueueMemcpy)
_PI_API(piextUSMEnqueuePrefetch)
_PI_API(piextUSMEnqueueMemAdvise)
_PI_API(piextUSMGetMemAllocInfo)
// Host pipes
_PI_API(piextEnqueueReadHostPipe)
_PI_API(piextEnqueueWriteHostPipe)

_PI_API(piextKernelSetArgMemObj)
_PI_API(piextKernelSetArgSampler)

_PI_API(piextPluginGetOpaqueData)

_PI_API(piPluginGetLastError)

_PI_API(piTearDown)

_PI_API(piextUSMEnqueueFill2D)
_PI_API(piextUSMEnqueueMemset2D)
_PI_API(piextUSMEnqueueMemcpy2D)

_PI_API(piGetDeviceAndHostTimer)

// Device global variable
_PI_API(piextEnqueueDeviceGlobalVariableWrite)
_PI_API(piextEnqueueDeviceGlobalVariableRead)

_PI_API(piPluginGetBackendOption)

_PI_API(piextEnablePeerAccess)
_PI_API(piextDisablePeerAccess)
_PI_API(piextPeerAccessGetInfo)

// USM import/release APIs
_PI_API(piextUSMImport)
_PI_API(piextUSMRelease)

// command-buffer Extension
_PI_API(piextCommandBufferCreate)
_PI_API(piextCommandBufferRetain)
_PI_API(piextCommandBufferRelease)
_PI_API(piextCommandBufferFinalize)
_PI_API(piextCommandBufferNDRangeKernel)
_PI_API(piextCommandBufferMemcpyUSM)
_PI_API(piextCommandBufferMemBufferCopy)
_PI_API(piextCommandBufferMemBufferCopyRect)
_PI_API(piextCommandBufferMemBufferWrite)
_PI_API(piextCommandBufferMemBufferWriteRect)
_PI_API(piextCommandBufferMemBufferRead)
_PI_API(piextCommandBufferMemBufferReadRect)
_PI_API(piextEnqueueCommandBuffer)

_PI_API(piextUSMPitchedAlloc)

// Bindless Images
_PI_API(piextMemUnsampledImageHandleDestroy)
_PI_API(piextMemSampledImageHandleDestroy)
_PI_API(piextBindlessImageSamplerCreate)
_PI_API(piextMemImageAllocate)
_PI_API(piextMemImageFree)
_PI_API(piextMemUnsampledImageCreate)
_PI_API(piextMemSampledImageCreate)
_PI_API(piextMemImageCopy)
_PI_API(piextMemImageGetInfo)
_PI_API(piextMemMipmapGetLevel)
_PI_API(piextMemMipmapFree)

// Interop
_PI_API(piextMemImportOpaqueFD)
_PI_API(piextMemReleaseInterop)
_PI_API(piextMemMapExternalArray)
_PI_API(piextImportExternalSemaphoreOpaqueFD)
_PI_API(piextDestroyExternalSemaphore)
_PI_API(piextWaitExternalSemaphore)
_PI_API(piextSignalExternalSemaphore)

#undef _PI_API
