mirror of
https://github.com/fumiama/gozel.git
synced 2026-06-05 08:20:24 +08:00
182 lines
8.3 KiB
Go
182 lines
8.3 KiB
Go
// Code generated by cmd/gen. DO NOT EDIT.
|
|
|
|
/*
|
|
*
|
|
* Copyright (C) 2019-2025 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
* @file zes_api.h
|
|
* @version v1.15-r1.15.31
|
|
*
|
|
*/
|
|
|
|
package gozel
|
|
|
|
import (
|
|
"unsafe"
|
|
|
|
"github.com/fumiama/gozel/internal/zecall"
|
|
)
|
|
|
|
// ZesInitFlags (zes_init_flags_t) Supported sysman initialization flags
|
|
type ZesInitFlags uint32
|
|
const (
|
|
ZES_INIT_FLAG_PLACEHOLDER ZesInitFlags = /* ZE_BIT(0) */(( 1 << 0 )) // ZES_INIT_FLAG_PLACEHOLDER placeholder for future use
|
|
ZES_INIT_FLAG_FORCE_UINT32 ZesInitFlags = 0x7fffffff // ZES_INIT_FLAG_FORCE_UINT32 Value marking end of ZES_INIT_FLAG_* ENUMs
|
|
|
|
)
|
|
|
|
// ZesInit Initialize 'oneAPI' System Resource Management (sysman)
|
|
///
|
|
/// @details
|
|
/// - The application must call this function or ::zeInit with the
|
|
/// `ZES_ENABLE_SYSMAN` environment variable set before calling any other
|
|
/// sysman function.
|
|
/// - If this function is not called then all other sysman functions will
|
|
/// return ::ZE_RESULT_ERROR_UNINITIALIZED.
|
|
/// - This function will only initialize sysman. To initialize other
|
|
/// functions, call ::zeInit.
|
|
/// - There is no requirement to call this function before or after
|
|
/// ::zeInit.
|
|
/// - Only one instance of sysman will be initialized per process.
|
|
/// - The application must call this function after forking new processes.
|
|
/// Each forked process must call this function.
|
|
/// - The application may call this function from simultaneous threads.
|
|
/// - The implementation of this function must be thread-safe for scenarios
|
|
/// where multiple libraries may initialize sysman simultaneously.
|
|
///
|
|
/// @returns
|
|
/// - ::ZE_RESULT_SUCCESS
|
|
/// - ::ZE_RESULT_ERROR_UNINITIALIZED
|
|
/// - ::ZE_RESULT_ERROR_DEVICE_LOST
|
|
/// - ::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_ENUMERATION
|
|
/// + `0x1 < flags`
|
|
/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION
|
|
/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY
|
|
func ZesInit(
|
|
flags ZesInitFlags, // flags [in] initialization flags. currently unused, must be 0 (default).
|
|
) (ZeResult, error) {
|
|
return zecall.Call[ZeResult]("zesInit", uintptr(flags))
|
|
}
|
|
|
|
// ZesDriverGet Retrieves sysman driver instances
|
|
///
|
|
/// @details
|
|
/// - A sysman driver represents a collection of physical devices.
|
|
/// - Multiple calls to this function will return identical sysman driver
|
|
/// handles, in the same order.
|
|
/// - The application may pass nullptr for pDrivers when only querying the
|
|
/// number of sysman drivers.
|
|
/// - 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_POINTER
|
|
/// + `nullptr == pCount`
|
|
func ZesDriverGet(
|
|
pCount *uint32, // pCount [in,out] pointer to the number of sysman driver instances. if count is zero, then the loader shall update the value with the total number of sysman drivers available. if count is greater than the number of sysman drivers available, then the loader shall update the value with the correct number of sysman drivers available.
|
|
phDrivers *ZesDriverHandle, // phDrivers [in,out][optional][range(0, *pCount)] array of sysman driver instance handles. if count is less than the number of sysman drivers available, then the loader shall only retrieve that number of sysman drivers.
|
|
) (ZeResult, error) {
|
|
return zecall.Call[ZeResult]("zesDriverGet", uintptr(unsafe.Pointer(pCount)), uintptr(unsafe.Pointer(phDrivers)))
|
|
}
|
|
|
|
// ZES_MAX_EXTENSION_NAME Maximum extension name string size
|
|
const ZES_MAX_EXTENSION_NAME = 256
|
|
|
|
// ZesDriverExtensionProperties (zes_driver_extension_properties_t) Extension properties queried using ::zesDriverGetExtensionProperties
|
|
type ZesDriverExtensionProperties struct {
|
|
Name [ZES_MAX_EXTENSION_NAME]byte // Name [out] extension name
|
|
Version uint32 // Version [out] extension version using ::ZE_MAKE_VERSION
|
|
|
|
}
|
|
|
|
// ZesDriverGetExtensionProperties Retrieves extension properties
|
|
///
|
|
/// @details
|
|
/// - 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 == hDriver`
|
|
/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
|
|
/// + `nullptr == pCount`
|
|
func ZesDriverGetExtensionProperties(
|
|
hDriver ZesDriverHandle, // hDriver [in] handle of the driver instance
|
|
pCount *uint32, // pCount [in,out] pointer to the number of extension properties. if count is zero, then the driver shall update the value with the total number of extension properties available. if count is greater than the number of extension properties available, then the driver shall update the value with the correct number of extension properties available.
|
|
pExtensionProperties *ZesDriverExtensionProperties, // pExtensionProperties [in,out][optional][range(0, *pCount)] array of query results for extension properties. if count is less than the number of extension properties available, then driver shall only retrieve that number of extension properties.
|
|
) (ZeResult, error) {
|
|
return zecall.Call[ZeResult]("zesDriverGetExtensionProperties", uintptr(hDriver), uintptr(unsafe.Pointer(pCount)), uintptr(unsafe.Pointer(pExtensionProperties)))
|
|
}
|
|
|
|
// ZesDriverGetExtensionFunctionAddress Retrieves function pointer for vendor-specific or experimental
|
|
/// extensions
|
|
///
|
|
/// @details
|
|
/// - 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 == hDriver`
|
|
/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
|
|
/// + `nullptr == name`
|
|
/// + `nullptr == ppFunctionAddress`
|
|
func ZesDriverGetExtensionFunctionAddress(
|
|
hDriver ZesDriverHandle, // hDriver [in] handle of the driver instance
|
|
name *byte, // name [in] extension function name
|
|
ppFunctionAddress *unsafe.Pointer, // ppFunctionAddress [out] pointer to function pointer
|
|
) (ZeResult, error) {
|
|
return zecall.Call[ZeResult]("zesDriverGetExtensionFunctionAddress", uintptr(hDriver), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(ppFunctionAddress)))
|
|
}
|
|
|