mirror of
https://github.com/fumiama/gozel.git
synced 2026-06-11 20:10:34 +08:00
chore: run go generate
This commit is contained in:
committed by
GitHub
parent
bfda7d76f3
commit
32abd8ea7c
170
rntm_common.go
170
rntm_common.go
@@ -21,121 +21,119 @@ import (
|
||||
|
||||
// ZeDefaultGPUImmediateCommandQueueDesc Immediate Command List default descriptor for GPU devices
|
||||
var ZeDefaultGPUImmediateCommandQueueDesc = ZeCommandQueueDesc{
|
||||
ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC, ///< stype
|
||||
nil, ///< pNext
|
||||
0, ///< ordinal
|
||||
0, ///< index
|
||||
ZE_COMMAND_QUEUE_FLAG_IN_ORDER | ZE_COMMAND_QUEUE_FLAG_COPY_OFFLOAD_HINT, ///< flags
|
||||
ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS, ///< mode
|
||||
ZE_COMMAND_QUEUE_PRIORITY_NORMAL, ///< priority
|
||||
ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC, ///< stype
|
||||
nil, ///< pNext
|
||||
0, ///< ordinal
|
||||
0, ///< index
|
||||
ZE_COMMAND_QUEUE_FLAG_IN_ORDER | ZE_COMMAND_QUEUE_FLAG_COPY_OFFLOAD_HINT, ///< flags
|
||||
ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS, ///< mode
|
||||
ZE_COMMAND_QUEUE_PRIORITY_NORMAL, ///< priority
|
||||
}
|
||||
|
||||
// ZeDefaultGPUDeviceMemAllocDesc Device Unified Shared Memory Allocation default descriptor for GPU
|
||||
/// devices
|
||||
// / devices
|
||||
var ZeDefaultGPUDeviceMemAllocDesc = ZeDeviceMemAllocDesc{
|
||||
ZE_STRUCTURE_TYPE_DEVICE_MEM_ALLOC_DESC, ///< stype
|
||||
nil, ///< pNext
|
||||
ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_CACHED, ///< flags
|
||||
0, ///< ordinal
|
||||
ZE_STRUCTURE_TYPE_DEVICE_MEM_ALLOC_DESC, ///< stype
|
||||
nil, ///< pNext
|
||||
ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_CACHED, ///< flags
|
||||
0, ///< ordinal
|
||||
}
|
||||
|
||||
// ZeDefaultGPUHostMemAllocDesc Host Unified Shared Memory Allocation default descriptor for GPU
|
||||
/// devices
|
||||
// / devices
|
||||
var ZeDefaultGPUHostMemAllocDesc = ZeHostMemAllocDesc{
|
||||
ZE_STRUCTURE_TYPE_HOST_MEM_ALLOC_DESC, ///< stype
|
||||
nil, ///< pNext
|
||||
ZE_STRUCTURE_TYPE_HOST_MEM_ALLOC_DESC, ///< stype
|
||||
nil, ///< pNext
|
||||
ZE_HOST_MEM_ALLOC_FLAG_BIAS_CACHED | ZE_HOST_MEM_ALLOC_FLAG_BIAS_INITIAL_PLACEMENT, ///< flags
|
||||
}
|
||||
|
||||
// ZerGetLastErrorDescription Retrieves a string describing the last error code returned by the
|
||||
/// default driver in the current thread.
|
||||
///
|
||||
/// @details
|
||||
/// - String returned is thread local.
|
||||
/// - String is only updated on calls returning an error, i.e., not on calls
|
||||
/// returning ::ZE_RESULT_SUCCESS.
|
||||
/// - String may be empty if driver considers error code is already explicit
|
||||
/// enough to describe cause.
|
||||
/// - Memory pointed to by ppString is owned by the default driver.
|
||||
/// - String returned is null-terminated.
|
||||
///
|
||||
/// @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_POINTER
|
||||
/// + `nullptr == ppString`
|
||||
// / default driver in the current thread.
|
||||
// /
|
||||
// / @details
|
||||
// / - String returned is thread local.
|
||||
// / - String is only updated on calls returning an error, i.e., not on calls
|
||||
// / returning ::ZE_RESULT_SUCCESS.
|
||||
// / - String may be empty if driver considers error code is already explicit
|
||||
// / enough to describe cause.
|
||||
// / - Memory pointed to by ppString is owned by the default driver.
|
||||
// / - String returned is null-terminated.
|
||||
// /
|
||||
// / @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_POINTER
|
||||
// / + `nullptr == ppString`
|
||||
func ZerGetLastErrorDescription(
|
||||
ppString **byte, // ppString [in,out] pointer to a null-terminated array of characters describing cause of error.
|
||||
ppString **byte, // ppString [in,out] pointer to a null-terminated array of characters describing cause of error.
|
||||
) (ZeResult, error) {
|
||||
return zecall.Call[ZeResult]("zerGetLastErrorDescription", uintptr(unsafe.Pointer(ppString)))
|
||||
}
|
||||
|
||||
// ZerTranslateDeviceHandleToIdentifier Translates device handle to integer identifier.
|
||||
///
|
||||
/// @details
|
||||
/// - The implementation of this function should be lock-free.
|
||||
/// - This function does not return error code, to get info about failure
|
||||
/// user may use ::zerGetLastErrorDescription function.
|
||||
/// - In case of failure, this function returns UINT32_MAX.
|
||||
///
|
||||
/// @returns
|
||||
/// - integer identifier for the device
|
||||
/// - UINT32_MAX
|
||||
// /
|
||||
// / @details
|
||||
// / - The implementation of this function should be lock-free.
|
||||
// / - This function does not return error code, to get info about failure
|
||||
// / user may use ::zerGetLastErrorDescription function.
|
||||
// / - In case of failure, this function returns UINT32_MAX.
|
||||
// /
|
||||
// / @returns
|
||||
// / - integer identifier for the device
|
||||
// / - UINT32_MAX
|
||||
func ZerTranslateDeviceHandleToIdentifier(
|
||||
hDevice ZeDeviceHandle, // hDevice [in] handle of the device
|
||||
hDevice ZeDeviceHandle, // hDevice [in] handle of the device
|
||||
) (uint32, error) {
|
||||
return zecall.Call[uint32]("zerTranslateDeviceHandleToIdentifier", uintptr(hDevice))
|
||||
}
|
||||
|
||||
// ZerTranslateIdentifierToDeviceHandle Translates to integer identifier to a device handle.
|
||||
///
|
||||
/// @details
|
||||
/// - The driver must be initialized before calling this function.
|
||||
/// - The implementation of this function should be lock-free.
|
||||
/// - This function does not return error code, to get info about failure
|
||||
/// user may use ::zerGetLastErrorDescription function.
|
||||
/// - In case of failure, this function returns null.
|
||||
/// - Details on the error can be retrieved using
|
||||
/// ::zerGetLastErrorDescription function.
|
||||
///
|
||||
/// @returns
|
||||
/// - handle of the device with the given identifier
|
||||
/// - nullptr
|
||||
// /
|
||||
// / @details
|
||||
// / - The driver must be initialized before calling this function.
|
||||
// / - The implementation of this function should be lock-free.
|
||||
// / - This function does not return error code, to get info about failure
|
||||
// / user may use ::zerGetLastErrorDescription function.
|
||||
// / - In case of failure, this function returns null.
|
||||
// / - Details on the error can be retrieved using
|
||||
// / ::zerGetLastErrorDescription function.
|
||||
// /
|
||||
// / @returns
|
||||
// / - handle of the device with the given identifier
|
||||
// / - nullptr
|
||||
func ZerTranslateIdentifierToDeviceHandle(
|
||||
identifier uint32, // identifier [in] integer identifier of the device
|
||||
identifier uint32, // identifier [in] integer identifier of the device
|
||||
) (ZeDeviceHandle, error) {
|
||||
return zecall.Call[ZeDeviceHandle]("zerTranslateIdentifierToDeviceHandle", uintptr(identifier))
|
||||
}
|
||||
|
||||
// ZerGetDefaultContext Retrieves handle to default context from the default driver.
|
||||
///
|
||||
/// @details
|
||||
/// - The driver must be initialized before calling this function.
|
||||
/// - The implementation of this function should be lock-free.
|
||||
/// - This returned context contains all the devices available in the
|
||||
/// default driver.
|
||||
/// - This function does not return error code, to get info about failure
|
||||
/// user may use ::zerGetLastErrorDescription function.
|
||||
/// - In case of failure, this function returns null.
|
||||
/// - Details on the error can be retrieved using
|
||||
/// ::zerGetLastErrorDescription function.
|
||||
///
|
||||
/// @returns
|
||||
/// - handle of the default context
|
||||
/// - nullptr
|
||||
func ZerGetDefaultContext(
|
||||
) (ZeContextHandle, error) {
|
||||
// /
|
||||
// / @details
|
||||
// / - The driver must be initialized before calling this function.
|
||||
// / - The implementation of this function should be lock-free.
|
||||
// / - This returned context contains all the devices available in the
|
||||
// / default driver.
|
||||
// / - This function does not return error code, to get info about failure
|
||||
// / user may use ::zerGetLastErrorDescription function.
|
||||
// / - In case of failure, this function returns null.
|
||||
// / - Details on the error can be retrieved using
|
||||
// / ::zerGetLastErrorDescription function.
|
||||
// /
|
||||
// / @returns
|
||||
// / - handle of the default context
|
||||
// / - nullptr
|
||||
func ZerGetDefaultContext() (ZeContextHandle, error) {
|
||||
return zecall.Call[ZeContextHandle]("zerGetDefaultContext")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user