1
0
mirror of https://github.com/fumiama/gozel.git synced 2026-06-05 08:20:24 +08:00
Files
gozel/core_copy.go
github-actions[bot] 32abd8ea7c chore: run go generate
2026-03-26 00:49:32 +08:00

620 lines
34 KiB
Go

// Code generated by cmd/gen. DO NOT EDIT.
/*
*
* Copyright (C) 2019-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
* @file ze_api.h
* @version v1.15-r1.15.31
*
*/
package gozel
import (
"unsafe"
"github.com/fumiama/gozel/internal/zecall"
)
// ZeCommandListAppendMemoryCopy Copies host, device, or shared memory.
// /
// / @details
// / - The application must ensure the memory pointed to by dstptr and srcptr
// / is accessible by the device on which the command list was created.
// / - The implementation must not access the memory pointed to by dstptr and
// / srcptr as they are free to be modified by either the Host or device up
// / until execution.
// / - The application must ensure the events are accessible by the device on
// / which the command list was created.
// / - The application must ensure the command list and events were created,
// / and the memory was allocated, on the same context.
// / - The application must **not** call this function from simultaneous
// / threads with the same command list handle.
// / - The implementation of this function should be lock-free.
// /
// / @remarks
// / _Analogues_
// / - **clEnqueueCopyBuffer**
// / - **clEnqueueReadBuffer**
// / - **clEnqueueWriteBuffer**
// / - **clEnqueueSVMMemcpy**
// /
// / @returns
// / - ::ZE_RESULT_SUCCESS
// / - ::ZE_RESULT_ERROR_UNINITIALIZED
// / - ::ZE_RESULT_ERROR_DEVICE_LOST
// / - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY
// / - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY
// / - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
// / - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE
// / - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE
// / - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS
// / - ::ZE_RESULT_ERROR_NOT_AVAILABLE
// / - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET
// / - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
// / - ::ZE_RESULT_ERROR_UNKNOWN
// / - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
// / + `nullptr == hCommandList`
// / - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
// / + `nullptr == dstptr`
// / + `nullptr == srcptr`
// / - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT
// / - ::ZE_RESULT_ERROR_INVALID_SIZE
// / + `(nullptr == phWaitEvents) && (0 < numWaitEvents)`
func ZeCommandListAppendMemoryCopy(
hCommandList ZeCommandListHandle, // hCommandList [in] handle of command list
dstptr unsafe.Pointer, // dstptr [in] pointer to destination memory to copy to
srcptr unsafe.Pointer, // srcptr [in] pointer to source memory to copy from
size uintptr, // size [in] size in bytes to copy
hSignalEvent ZeEventHandle, // hSignalEvent [in][optional] handle of the event to signal on completion
numWaitEvents uint32, // numWaitEvents [in][optional] number of events to wait on before launching; must be 0 if `nullptr == phWaitEvents`
phWaitEvents *ZeEventHandle, // phWaitEvents [in][optional][range(0, numWaitEvents)] handle of the events to wait on before launching
) (ZeResult, error) {
return zecall.Call[ZeResult]("zeCommandListAppendMemoryCopy", uintptr(hCommandList), uintptr(unsafe.Pointer(dstptr)), uintptr(unsafe.Pointer(srcptr)), uintptr(size), uintptr(hSignalEvent), uintptr(numWaitEvents), uintptr(unsafe.Pointer(phWaitEvents)))
}
// ZeCommandListAppendMemoryFill Initializes host, device, or shared memory.
// /
// / @details
// / - The application must ensure the memory pointed to by ptr is accessible
// / by the device on which the command list was created.
// / - The implementation must not access the memory pointed to by ptr as it
// / is free to be modified by either the Host or device up until
// / execution.
// / - The ptr must be aligned to pattern_size
// / - The value to initialize memory to is described by the pattern and the
// / pattern size.
// / - The pattern size must be a power-of-two and less than or equal to the
// / `maxMemoryFillPatternSize` member of
// / ::ze_command_queue_group_properties_t.
// / - The application must ensure the events are accessible by the device on
// / which the command list was created.
// / - The application must ensure the command list and events were created,
// / and the memory was allocated, on the same context.
// / - The application must **not** call this function from simultaneous
// / threads with the same command list handle.
// / - The implementation of this function should be lock-free.
// /
// / @remarks
// / _Analogues_
// / - **clEnqueueFillBuffer**
// / - **clEnqueueSVMMemFill**
// /
// / @returns
// / - ::ZE_RESULT_SUCCESS
// / - ::ZE_RESULT_ERROR_UNINITIALIZED
// / - ::ZE_RESULT_ERROR_DEVICE_LOST
// / - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY
// / - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY
// / - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
// / - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE
// / - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE
// / - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS
// / - ::ZE_RESULT_ERROR_NOT_AVAILABLE
// / - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET
// / - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
// / - ::ZE_RESULT_ERROR_UNKNOWN
// / - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
// / + `nullptr == hCommandList`
// / - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
// / + `nullptr == ptr`
// / + `nullptr == pattern`
// / - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT
// / - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT
// / - ::ZE_RESULT_ERROR_INVALID_SIZE
// / + `(nullptr == phWaitEvents) && (0 < numWaitEvents)`
func ZeCommandListAppendMemoryFill(
hCommandList ZeCommandListHandle, // hCommandList [in] handle of command list
ptr unsafe.Pointer, // ptr [in] pointer to memory to initialize
pattern unsafe.Pointer, // pattern [in] pointer to value to initialize memory to
pattern_size uintptr, // pattern_size [in] size in bytes of the value to initialize memory to
size uintptr, // size [in] size in bytes to initialize
hSignalEvent ZeEventHandle, // hSignalEvent [in][optional] handle of the event to signal on completion
numWaitEvents uint32, // numWaitEvents [in][optional] number of events to wait on before launching; must be 0 if `nullptr == phWaitEvents`
phWaitEvents *ZeEventHandle, // phWaitEvents [in][optional][range(0, numWaitEvents)] handle of the events to wait on before launching
) (ZeResult, error) {
return zecall.Call[ZeResult]("zeCommandListAppendMemoryFill", uintptr(hCommandList), uintptr(unsafe.Pointer(ptr)), uintptr(unsafe.Pointer(pattern)), uintptr(pattern_size), uintptr(size), uintptr(hSignalEvent), uintptr(numWaitEvents), uintptr(unsafe.Pointer(phWaitEvents)))
}
// ZeCopyRegion (ze_copy_region_t) Copy region descriptor
type ZeCopyRegion struct {
Originx uint32 // Originx [in] The origin x offset for region in bytes
Originy uint32 // Originy [in] The origin y offset for region in rows
Originz uint32 // Originz [in] The origin z offset for region in slices
Width uint32 // Width [in] The region width relative to origin in bytes
Height uint32 // Height [in] The region height relative to origin in rows
Depth uint32 // Depth [in] The region depth relative to origin in slices. Set this to 0 for 2D copy.
}
// ZeCommandListAppendMemoryCopyRegion Copies a region from a 2D or 3D array of host, device, or shared
// / memory.
// /
// / @details
// / - The application must ensure the memory pointed to by dstptr and srcptr
// / is accessible by the device on which the command list was created.
// / - The implementation must not access the memory pointed to by dstptr and
// / srcptr as they are free to be modified by either the Host or device up
// / until execution.
// / - The region width, height, and depth for both src and dst must be same.
// / The origins can be different.
// / - The src and dst regions cannot be overlapping.
// / - The application must ensure the events are accessible by the device on
// / which the command list was created.
// / - The application must ensure the command list and events were created,
// / and the memory was allocated, on the same context.
// / - The application must **not** call this function from simultaneous
// / threads with the same command list handle.
// / - The implementation of this function should be lock-free.
// /
// / @returns
// / - ::ZE_RESULT_SUCCESS
// / - ::ZE_RESULT_ERROR_UNINITIALIZED
// / - ::ZE_RESULT_ERROR_DEVICE_LOST
// / - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY
// / - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY
// / - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
// / - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE
// / - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE
// / - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS
// / - ::ZE_RESULT_ERROR_NOT_AVAILABLE
// / - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET
// / - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
// / - ::ZE_RESULT_ERROR_UNKNOWN
// / - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
// / + `nullptr == hCommandList`
// / - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
// / + `nullptr == dstptr`
// / + `nullptr == dstRegion`
// / + `nullptr == srcptr`
// / + `nullptr == srcRegion`
// / - ::ZE_RESULT_ERROR_OVERLAPPING_REGIONS
// / - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT
// / - ::ZE_RESULT_ERROR_INVALID_SIZE
// / + `(nullptr == phWaitEvents) && (0 < numWaitEvents)`
func ZeCommandListAppendMemoryCopyRegion(
hCommandList ZeCommandListHandle, // hCommandList [in] handle of command list
dstptr unsafe.Pointer, // dstptr [in] pointer to destination memory to copy to
dstRegion *ZeCopyRegion, // dstRegion [in] pointer to destination region to copy to
dstPitch uint32, // dstPitch [in] destination pitch in bytes
dstSlicePitch uint32, // dstSlicePitch [in] destination slice pitch in bytes. This is required for 3D region copies where the `depth` member of ::ze_copy_region_t is not 0, otherwise it's ignored.
srcptr unsafe.Pointer, // srcptr [in] pointer to source memory to copy from
srcRegion *ZeCopyRegion, // srcRegion [in] pointer to source region to copy from
srcPitch uint32, // srcPitch [in] source pitch in bytes
srcSlicePitch uint32, // srcSlicePitch [in] source slice pitch in bytes. This is required for 3D region copies where the `depth` member of ::ze_copy_region_t is not 0, otherwise it's ignored.
hSignalEvent ZeEventHandle, // hSignalEvent [in][optional] handle of the event to signal on completion
numWaitEvents uint32, // numWaitEvents [in][optional] number of events to wait on before launching; must be 0 if `nullptr == phWaitEvents`
phWaitEvents *ZeEventHandle, // phWaitEvents [in][optional][range(0, numWaitEvents)] handle of the events to wait on before launching
) (ZeResult, error) {
return zecall.Call[ZeResult]("zeCommandListAppendMemoryCopyRegion", uintptr(hCommandList), uintptr(unsafe.Pointer(dstptr)), uintptr(unsafe.Pointer(dstRegion)), uintptr(dstPitch), uintptr(dstSlicePitch), uintptr(unsafe.Pointer(srcptr)), uintptr(unsafe.Pointer(srcRegion)), uintptr(srcPitch), uintptr(srcSlicePitch), uintptr(hSignalEvent), uintptr(numWaitEvents), uintptr(unsafe.Pointer(phWaitEvents)))
}
// ZeCommandListAppendMemoryCopyFromContext Copies host, device, or shared memory from another context.
// /
// / @details
// / - The current active and source context must be from the same driver.
// / - The application must ensure the memory pointed to by dstptr and srcptr
// / is accessible by the device on which the command list was created.
// / - The implementation must not access the memory pointed to by dstptr and
// / srcptr as they are free to be modified by either the Host or device up
// / until execution.
// / - The application must ensure the events are accessible by the device on
// / which the command list was created.
// / - The application must ensure the command list and events were created,
// / and the memory was allocated, on the same context.
// / - The application must **not** call this function from simultaneous
// / threads with the same command list handle.
// / - The implementation of this function should be lock-free.
// /
// / @returns
// / - ::ZE_RESULT_SUCCESS
// / - ::ZE_RESULT_ERROR_UNINITIALIZED
// / - ::ZE_RESULT_ERROR_DEVICE_LOST
// / - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY
// / - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY
// / - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
// / - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE
// / - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE
// / - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS
// / - ::ZE_RESULT_ERROR_NOT_AVAILABLE
// / - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET
// / - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
// / - ::ZE_RESULT_ERROR_UNKNOWN
// / - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
// / + `nullptr == hCommandList`
// / + `nullptr == hContextSrc`
// / - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
// / + `nullptr == dstptr`
// / + `nullptr == srcptr`
// / - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT
// / - ::ZE_RESULT_ERROR_INVALID_SIZE
// / + `(nullptr == phWaitEvents) && (0 < numWaitEvents)`
func ZeCommandListAppendMemoryCopyFromContext(
hCommandList ZeCommandListHandle, // hCommandList [in] handle of command list
dstptr unsafe.Pointer, // dstptr [in] pointer to destination memory to copy to
hContextSrc ZeContextHandle, // hContextSrc [in] handle of source context object
srcptr unsafe.Pointer, // srcptr [in] pointer to source memory to copy from
size uintptr, // size [in] size in bytes to copy
hSignalEvent ZeEventHandle, // hSignalEvent [in][optional] handle of the event to signal on completion
numWaitEvents uint32, // numWaitEvents [in][optional] number of events to wait on before launching; must be 0 if `nullptr == phWaitEvents`
phWaitEvents *ZeEventHandle, // phWaitEvents [in][optional][range(0, numWaitEvents)] handle of the events to wait on before launching
) (ZeResult, error) {
return zecall.Call[ZeResult]("zeCommandListAppendMemoryCopyFromContext", uintptr(hCommandList), uintptr(unsafe.Pointer(dstptr)), uintptr(hContextSrc), uintptr(unsafe.Pointer(srcptr)), uintptr(size), uintptr(hSignalEvent), uintptr(numWaitEvents), uintptr(unsafe.Pointer(phWaitEvents)))
}
// ZeCommandListAppendImageCopy Copies an image.
// /
// / @details
// / - The application must ensure the image and events are accessible by the
// / device on which the command list was created.
// / - The application must ensure the image format descriptors for both
// / source and destination images are the same.
// / - The application must ensure the command list, images and events were
// / created on the same context.
// / - The application must **not** call this function from simultaneous
// / threads with the same command list handle.
// / - The implementation of this function should be lock-free.
// /
// / @remarks
// / _Analogues_
// / - **clEnqueueCopyImage**
// /
// / @returns
// / - ::ZE_RESULT_SUCCESS
// / - ::ZE_RESULT_ERROR_UNINITIALIZED
// / - ::ZE_RESULT_ERROR_DEVICE_LOST
// / - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY
// / - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY
// / - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
// / - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE
// / - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE
// / - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS
// / - ::ZE_RESULT_ERROR_NOT_AVAILABLE
// / - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET
// / - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
// / - ::ZE_RESULT_ERROR_UNKNOWN
// / - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
// / + `nullptr == hCommandList`
// / + `nullptr == hDstImage`
// / + `nullptr == hSrcImage`
// / - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT
// / - ::ZE_RESULT_ERROR_INVALID_SIZE
// / + `(nullptr == phWaitEvents) && (0 < numWaitEvents)`
func ZeCommandListAppendImageCopy(
hCommandList ZeCommandListHandle, // hCommandList [in] handle of command list
hDstImage ZeImageHandle, // hDstImage [in] handle of destination image to copy to
hSrcImage ZeImageHandle, // hSrcImage [in] handle of source image to copy from
hSignalEvent ZeEventHandle, // hSignalEvent [in][optional] handle of the event to signal on completion
numWaitEvents uint32, // numWaitEvents [in][optional] number of events to wait on before launching; must be 0 if `nullptr == phWaitEvents`
phWaitEvents *ZeEventHandle, // phWaitEvents [in][optional][range(0, numWaitEvents)] handle of the events to wait on before launching
) (ZeResult, error) {
return zecall.Call[ZeResult]("zeCommandListAppendImageCopy", uintptr(hCommandList), uintptr(hDstImage), uintptr(hSrcImage), uintptr(hSignalEvent), uintptr(numWaitEvents), uintptr(unsafe.Pointer(phWaitEvents)))
}
// ZeImageRegion (ze_image_region_t) Region descriptor
type ZeImageRegion struct {
Originx uint32 // Originx [in] The origin x offset for region in pixels
Originy uint32 // Originy [in] The origin y offset for region in pixels
Originz uint32 // Originz [in] The origin z offset for region in pixels
Width uint32 // Width [in] The region width relative to origin in pixels
Height uint32 // Height [in] The region height relative to origin in pixels
Depth uint32 // Depth [in] The region depth relative to origin. For 1D or 2D images, set this to 1.
}
// ZeCommandListAppendImageCopyRegion Copies a region of an image to another image.
// /
// / @details
// / - The application must ensure the image and events are accessible by the
// / device on which the command list was created.
// / - The region width and height for both src and dst must be same. The
// / origins can be different.
// / - The src and dst regions cannot be overlapping.
// / - The application must ensure the image format descriptors for both
// / source and destination images are the same.
// / - The application must ensure the command list, images and events were
// / created, and the memory was allocated, on the same context.
// / - The application must **not** call this function from simultaneous
// / threads with the same command list handle.
// / - The implementation of this function should be lock-free.
// /
// / @returns
// / - ::ZE_RESULT_SUCCESS
// / - ::ZE_RESULT_ERROR_UNINITIALIZED
// / - ::ZE_RESULT_ERROR_DEVICE_LOST
// / - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY
// / - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY
// / - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
// / - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE
// / - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE
// / - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS
// / - ::ZE_RESULT_ERROR_NOT_AVAILABLE
// / - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET
// / - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
// / - ::ZE_RESULT_ERROR_UNKNOWN
// / - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
// / + `nullptr == hCommandList`
// / + `nullptr == hDstImage`
// / + `nullptr == hSrcImage`
// / - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT
// / - ::ZE_RESULT_ERROR_OVERLAPPING_REGIONS
// / - ::ZE_RESULT_ERROR_INVALID_SIZE
// / + `(nullptr == phWaitEvents) && (0 < numWaitEvents)`
func ZeCommandListAppendImageCopyRegion(
hCommandList ZeCommandListHandle, // hCommandList [in] handle of command list
hDstImage ZeImageHandle, // hDstImage [in] handle of destination image to copy to
hSrcImage ZeImageHandle, // hSrcImage [in] handle of source image to copy from
pDstRegion *ZeImageRegion, // pDstRegion [in][optional] destination region descriptor
pSrcRegion *ZeImageRegion, // pSrcRegion [in][optional] source region descriptor
hSignalEvent ZeEventHandle, // hSignalEvent [in][optional] handle of the event to signal on completion
numWaitEvents uint32, // numWaitEvents [in][optional] number of events to wait on before launching; must be 0 if `nullptr == phWaitEvents`
phWaitEvents *ZeEventHandle, // phWaitEvents [in][optional][range(0, numWaitEvents)] handle of the events to wait on before launching
) (ZeResult, error) {
return zecall.Call[ZeResult]("zeCommandListAppendImageCopyRegion", uintptr(hCommandList), uintptr(hDstImage), uintptr(hSrcImage), uintptr(unsafe.Pointer(pDstRegion)), uintptr(unsafe.Pointer(pSrcRegion)), uintptr(hSignalEvent), uintptr(numWaitEvents), uintptr(unsafe.Pointer(phWaitEvents)))
}
// ZeCommandListAppendImageCopyToMemory Copies from an image to device or shared memory.
// /
// / @details
// / - The application must ensure the memory pointed to by dstptr is
// / accessible by the device on which the command list was created.
// / - The implementation must not access the memory pointed to by dstptr as
// / it is free to be modified by either the Host or device up until
// / execution.
// / - The application must ensure the image and events are accessible by the
// / device on which the command list was created.
// / - The application must ensure the image format descriptor for the source
// / image is a single-planar format.
// / - The application must ensure the command list, image and events were
// / created, and the memory was allocated, on the same context.
// / - The application must **not** call this function from simultaneous
// / threads with the same command list handle.
// / - The implementation of this function should be lock-free.
// /
// / @remarks
// / _Analogues_
// / - clEnqueueReadImage
// /
// / @returns
// / - ::ZE_RESULT_SUCCESS
// / - ::ZE_RESULT_ERROR_UNINITIALIZED
// / - ::ZE_RESULT_ERROR_DEVICE_LOST
// / - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY
// / - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY
// / - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
// / - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE
// / - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE
// / - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS
// / - ::ZE_RESULT_ERROR_NOT_AVAILABLE
// / - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET
// / - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
// / - ::ZE_RESULT_ERROR_UNKNOWN
// / - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
// / + `nullptr == hCommandList`
// / + `nullptr == hSrcImage`
// / - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
// / + `nullptr == dstptr`
// / - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT
// / - ::ZE_RESULT_ERROR_INVALID_SIZE
// / + `(nullptr == phWaitEvents) && (0 < numWaitEvents)`
func ZeCommandListAppendImageCopyToMemory(
hCommandList ZeCommandListHandle, // hCommandList [in] handle of command list
dstptr unsafe.Pointer, // dstptr [in] pointer to destination memory to copy to
hSrcImage ZeImageHandle, // hSrcImage [in] handle of source image to copy from
pSrcRegion *ZeImageRegion, // pSrcRegion [in][optional] source region descriptor
hSignalEvent ZeEventHandle, // hSignalEvent [in][optional] handle of the event to signal on completion
numWaitEvents uint32, // numWaitEvents [in][optional] number of events to wait on before launching; must be 0 if `nullptr == phWaitEvents`
phWaitEvents *ZeEventHandle, // phWaitEvents [in][optional][range(0, numWaitEvents)] handle of the events to wait on before launching
) (ZeResult, error) {
return zecall.Call[ZeResult]("zeCommandListAppendImageCopyToMemory", uintptr(hCommandList), uintptr(unsafe.Pointer(dstptr)), uintptr(hSrcImage), uintptr(unsafe.Pointer(pSrcRegion)), uintptr(hSignalEvent), uintptr(numWaitEvents), uintptr(unsafe.Pointer(phWaitEvents)))
}
// ZeCommandListAppendImageCopyFromMemory Copies to an image from device or shared memory.
// /
// / @details
// / - The application must ensure the memory pointed to by srcptr is
// / accessible by the device on which the command list was created.
// / - The implementation must not access the memory pointed to by srcptr as
// / it is free to be modified by either the Host or device up until
// / execution.
// / - The application must ensure the image and events are accessible by the
// / device on which the command list was created.
// / - The application must ensure the image format descriptor for the
// / destination image is a single-planar format.
// / - The application must ensure the command list, image and events were
// / created, and the memory was allocated, on the same context.
// / - The application must **not** call this function from simultaneous
// / threads with the same command list handle.
// / - The implementation of this function should be lock-free.
// /
// / @remarks
// / _Analogues_
// / - clEnqueueWriteImage
// /
// / @returns
// / - ::ZE_RESULT_SUCCESS
// / - ::ZE_RESULT_ERROR_UNINITIALIZED
// / - ::ZE_RESULT_ERROR_DEVICE_LOST
// / - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY
// / - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY
// / - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
// / - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE
// / - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE
// / - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS
// / - ::ZE_RESULT_ERROR_NOT_AVAILABLE
// / - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET
// / - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
// / - ::ZE_RESULT_ERROR_UNKNOWN
// / - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
// / + `nullptr == hCommandList`
// / + `nullptr == hDstImage`
// / - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
// / + `nullptr == srcptr`
// / - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT
// / - ::ZE_RESULT_ERROR_INVALID_SIZE
// / + `(nullptr == phWaitEvents) && (0 < numWaitEvents)`
func ZeCommandListAppendImageCopyFromMemory(
hCommandList ZeCommandListHandle, // hCommandList [in] handle of command list
hDstImage ZeImageHandle, // hDstImage [in] handle of destination image to copy to
srcptr unsafe.Pointer, // srcptr [in] pointer to source memory to copy from
pDstRegion *ZeImageRegion, // pDstRegion [in][optional] destination region descriptor
hSignalEvent ZeEventHandle, // hSignalEvent [in][optional] handle of the event to signal on completion
numWaitEvents uint32, // numWaitEvents [in][optional] number of events to wait on before launching; must be 0 if `nullptr == phWaitEvents`
phWaitEvents *ZeEventHandle, // phWaitEvents [in][optional][range(0, numWaitEvents)] handle of the events to wait on before launching
) (ZeResult, error) {
return zecall.Call[ZeResult]("zeCommandListAppendImageCopyFromMemory", uintptr(hCommandList), uintptr(hDstImage), uintptr(unsafe.Pointer(srcptr)), uintptr(unsafe.Pointer(pDstRegion)), uintptr(hSignalEvent), uintptr(numWaitEvents), uintptr(unsafe.Pointer(phWaitEvents)))
}
// ZeCommandListAppendMemoryPrefetch Asynchronously prefetches shared memory to the device associated with
// / the specified command list
// /
// / @details
// / - This is a hint to improve performance only and is not required for
// / correctness.
// / - Only prefetching to the device associated with the specified command
// / list is supported.
// / Prefetching to the host or to a peer device is not supported.
// / - Prefetching may not be supported for all allocation types for all devices.
// / If memory prefetching is not supported for the specified memory range
// / the prefetch hint may be ignored.
// / - Prefetching may only be supported at a device-specific granularity,
// / such as at a page boundary.
// / In this case, the memory range may be expanded such that the start and
// / end of the range satisfy granularity requirements.
// / - The application must ensure the memory pointed to by ptr is accessible
// / by the device on which the command list was created.
// / - The application must ensure the command list was created, and the
// / memory was allocated, on the same context.
// / - The application must **not** call this function from simultaneous
// / threads with the same command list handle.
// / - The implementation of this function should be lock-free.
// /
// / @remarks
// / _Analogues_
// / - clEnqueueSVMMigrateMem
// /
// / @returns
// / - ::ZE_RESULT_SUCCESS
// / - ::ZE_RESULT_ERROR_UNINITIALIZED
// / - ::ZE_RESULT_ERROR_DEVICE_LOST
// / - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY
// / - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY
// / - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
// / - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE
// / - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE
// / - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS
// / - ::ZE_RESULT_ERROR_NOT_AVAILABLE
// / - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET
// / - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
// / - ::ZE_RESULT_ERROR_UNKNOWN
// / - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
// / + `nullptr == hCommandList`
// / - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
// / + `nullptr == ptr`
func ZeCommandListAppendMemoryPrefetch(
hCommandList ZeCommandListHandle, // hCommandList [in] handle of command list
ptr unsafe.Pointer, // ptr [in] pointer to start of the memory range to prefetch
size uintptr, // size [in] size in bytes of the memory range to prefetch
) (ZeResult, error) {
return zecall.Call[ZeResult]("zeCommandListAppendMemoryPrefetch", uintptr(hCommandList), uintptr(unsafe.Pointer(ptr)), uintptr(size))
}
// ZeMemoryAdvice (ze_memory_advice_t) Supported memory advice hints
type ZeMemoryAdvice uintptr
const (
ZE_MEMORY_ADVICE_SET_READ_MOSTLY ZeMemoryAdvice = 0 // ZE_MEMORY_ADVICE_SET_READ_MOSTLY hint that memory will be read from frequently and written to rarely
ZE_MEMORY_ADVICE_CLEAR_READ_MOSTLY ZeMemoryAdvice = 1 // ZE_MEMORY_ADVICE_CLEAR_READ_MOSTLY removes the effect of ::ZE_MEMORY_ADVICE_SET_READ_MOSTLY
ZE_MEMORY_ADVICE_SET_PREFERRED_LOCATION ZeMemoryAdvice = 2 // ZE_MEMORY_ADVICE_SET_PREFERRED_LOCATION hint that the preferred memory location is the specified device
ZE_MEMORY_ADVICE_CLEAR_PREFERRED_LOCATION ZeMemoryAdvice = 3 // ZE_MEMORY_ADVICE_CLEAR_PREFERRED_LOCATION removes the effect of ::ZE_MEMORY_ADVICE_SET_PREFERRED_LOCATION
ZE_MEMORY_ADVICE_SET_NON_ATOMIC_MOSTLY ZeMemoryAdvice = 4 // ZE_MEMORY_ADVICE_SET_NON_ATOMIC_MOSTLY hints that memory will mostly be accessed non-atomically
ZE_MEMORY_ADVICE_CLEAR_NON_ATOMIC_MOSTLY ZeMemoryAdvice = 5 // ZE_MEMORY_ADVICE_CLEAR_NON_ATOMIC_MOSTLY removes the effect of ::ZE_MEMORY_ADVICE_SET_NON_ATOMIC_MOSTLY
ZE_MEMORY_ADVICE_BIAS_CACHED ZeMemoryAdvice = 6 // ZE_MEMORY_ADVICE_BIAS_CACHED hints that memory should be cached
ZE_MEMORY_ADVICE_BIAS_UNCACHED ZeMemoryAdvice = 7 // ZE_MEMORY_ADVICE_BIAS_UNCACHED hints that memory should be not be cached
ZE_MEMORY_ADVICE_SET_SYSTEM_MEMORY_PREFERRED_LOCATION ZeMemoryAdvice = 8 // ZE_MEMORY_ADVICE_SET_SYSTEM_MEMORY_PREFERRED_LOCATION hint that the preferred memory location is host memory
ZE_MEMORY_ADVICE_CLEAR_SYSTEM_MEMORY_PREFERRED_LOCATION ZeMemoryAdvice = 9 // ZE_MEMORY_ADVICE_CLEAR_SYSTEM_MEMORY_PREFERRED_LOCATION removes the effect of
///< ::ZE_MEMORY_ADVICE_SET_SYSTEM_MEMORY_PREFERRED_LOCATION
ZE_MEMORY_ADVICE_FORCE_UINT32 ZeMemoryAdvice = 0x7fffffff // ZE_MEMORY_ADVICE_FORCE_UINT32 Value marking end of ZE_MEMORY_ADVICE_* ENUMs
)
// ZeCommandListAppendMemAdvise Provides advice about the use of a shared memory range
// /
// / @details
// / - Memory advice is a performance hint only and is not required for
// / functional correctness.
// / - Memory advice can be used to override driver heuristics to explicitly
// / control shared memory behavior.
// / - Not all memory advice hints may be supported for all allocation types
// / for all devices.
// / If a memory advice hint is not supported by the device it will be ignored.
// / - Memory advice may only be supported at a device-specific granularity,
// / such as at a page boundary.
// / In this case, the memory range may be expanded such that the start and
// / end of the range satisfy granularity requirements.
// / - The application must ensure the memory pointed to by ptr is accessible
// / by the device on which the command list was created.
// / - The application must ensure the command list was created, and memory
// / was allocated, on the same context.
// / - The application must **not** call this function from simultaneous
// / threads with the same command list handle, and the memory was
// / allocated.
// / - The implementation of this function should be lock-free.
// /
// / @returns
// / - ::ZE_RESULT_SUCCESS
// / - ::ZE_RESULT_ERROR_UNINITIALIZED
// / - ::ZE_RESULT_ERROR_DEVICE_LOST
// / - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY
// / - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY
// / - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
// / - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE
// / - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE
// / - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS
// / - ::ZE_RESULT_ERROR_NOT_AVAILABLE
// / - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET
// / - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
// / - ::ZE_RESULT_ERROR_UNKNOWN
// / - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
// / + `nullptr == hCommandList`
// / + `nullptr == hDevice`
// / - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
// / + `nullptr == ptr`
// / - ::ZE_RESULT_ERROR_INVALID_ENUMERATION
// / + `::ZE_MEMORY_ADVICE_CLEAR_SYSTEM_MEMORY_PREFERRED_LOCATION < advice`
// / - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION
func ZeCommandListAppendMemAdvise(
hCommandList ZeCommandListHandle, // hCommandList [in] handle of command list
hDevice ZeDeviceHandle, // hDevice [in] device associated with the memory advice
ptr unsafe.Pointer, // ptr [in] Pointer to the start of the memory range
size uintptr, // size [in] Size in bytes of the memory range
advice ZeMemoryAdvice, // advice [in] Memory advice for the memory range
) (ZeResult, error) {
return zecall.Call[ZeResult]("zeCommandListAppendMemAdvise", uintptr(hCommandList), uintptr(hDevice), uintptr(unsafe.Pointer(ptr)), uintptr(size), uintptr(advice))
}