mirror of
https://github.com/fumiama/gozel.git
synced 2026-06-05 08:20:24 +08:00
156 lines
7.2 KiB
Go
156 lines
7.2 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"
|
|
)
|
|
|
|
// ZeCommandListAppendBarrier Appends an execution and global memory barrier into a command list.
|
|
///
|
|
/// @details
|
|
/// - The application must ensure the events are accessible by the device on
|
|
/// which the command list was created.
|
|
/// - If numWaitEvents is zero, then all previous commands, enqueued on same
|
|
/// command queue, must complete prior to the execution of the barrier.
|
|
/// This is not the case when numWaitEvents is non-zero.
|
|
/// - If numWaitEvents is non-zero, then only all phWaitEvents must be
|
|
/// signaled prior to the execution of the barrier.
|
|
/// - This command blocks all following commands from beginning until the
|
|
/// execution of the barrier completes.
|
|
/// - 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_
|
|
/// - **vkCmdPipelineBarrier**
|
|
/// - clEnqueueBarrierWithWaitList
|
|
///
|
|
/// @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_SYNCHRONIZATION_OBJECT
|
|
/// - ::ZE_RESULT_ERROR_INVALID_SIZE
|
|
/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)`
|
|
func ZeCommandListAppendBarrier(
|
|
hCommandList ZeCommandListHandle, // hCommandList [in] handle of the command list
|
|
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 executing barrier; must be 0 if `nullptr == phWaitEvents`
|
|
phWaitEvents *ZeEventHandle, // phWaitEvents [in][optional][range(0, numWaitEvents)] handle of the events to wait on before executing barrier
|
|
) (ZeResult, error) {
|
|
return zecall.Call[ZeResult]("zeCommandListAppendBarrier", uintptr(hCommandList), uintptr(hSignalEvent), uintptr(numWaitEvents), uintptr(unsafe.Pointer(phWaitEvents)))
|
|
}
|
|
|
|
// ZeCommandListAppendMemoryRangesBarrier Appends a global memory ranges barrier into a command list.
|
|
///
|
|
/// @details
|
|
/// - The application must ensure the events are accessible by the device on
|
|
/// which the command list was created.
|
|
/// - If numWaitEvents is zero, then all previous commands are completed
|
|
/// prior to the execution of the barrier.
|
|
/// - If numWaitEvents is non-zero, then then all phWaitEvents must be
|
|
/// signaled prior to the execution of the barrier.
|
|
/// - This command blocks all following commands from beginning until the
|
|
/// execution of the barrier completes.
|
|
/// - 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 == pRangeSizes`
|
|
/// + `nullptr == pRanges`
|
|
/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT
|
|
/// - ::ZE_RESULT_ERROR_INVALID_SIZE
|
|
/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)`
|
|
func ZeCommandListAppendMemoryRangesBarrier(
|
|
hCommandList ZeCommandListHandle, // hCommandList [in] handle of the command list
|
|
numRanges uint32, // numRanges [in] number of memory ranges
|
|
pRangeSizes *uintptr, // pRangeSizes [in][range(0, numRanges)] array of sizes of memory range
|
|
pRanges *unsafe.Pointer, // pRanges [in][range(0, numRanges)] array of memory ranges
|
|
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 executing barrier; must be 0 if `nullptr == phWaitEvents`
|
|
phWaitEvents *ZeEventHandle, // phWaitEvents [in][optional][range(0, numWaitEvents)] handle of the events to wait on before executing barrier
|
|
) (ZeResult, error) {
|
|
return zecall.Call[ZeResult]("zeCommandListAppendMemoryRangesBarrier", uintptr(hCommandList), uintptr(numRanges), uintptr(unsafe.Pointer(pRangeSizes)), uintptr(unsafe.Pointer(pRanges)), uintptr(hSignalEvent), uintptr(numWaitEvents), uintptr(unsafe.Pointer(phWaitEvents)))
|
|
}
|
|
|
|
// ZeContextSystemBarrier Ensures in-bound writes to the device are globally observable.
|
|
///
|
|
/// @details
|
|
/// - This is a special-case system level barrier that can be used to ensure
|
|
/// global observability of writes;
|
|
/// typically needed after a producer (e.g., NIC) performs direct writes
|
|
/// to the device's memory (e.g., Direct RDMA writes).
|
|
/// This is typically required when the memory corresponding to the writes
|
|
/// is subsequently accessed from a remote device.
|
|
/// - The application may call this function from simultaneous threads.
|
|
/// - 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 == hContext`
|
|
/// + `nullptr == hDevice`
|
|
func ZeContextSystemBarrier(
|
|
hContext ZeContextHandle, // hContext [in] handle of context object
|
|
hDevice ZeDeviceHandle, // hDevice [in] handle of the device
|
|
) (ZeResult, error) {
|
|
return zecall.Call[ZeResult]("zeContextSystemBarrier", uintptr(hContext), uintptr(hDevice))
|
|
}
|
|
|