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

141 lines
6.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"
)
// ZE_CACHE_RESERVATION_EXT_NAME Cache_Reservation Extension Name
const ZE_CACHE_RESERVATION_EXT_NAME = "ZE_extension_cache_reservation"
// ZeCacheReservationExtVersion (ze_cache_reservation_ext_version_t) Cache_Reservation Extension Version(s)
type ZeCacheReservationExtVersion uintptr
const (
ZE_CACHE_RESERVATION_EXT_VERSION_1_0 ZeCacheReservationExtVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_CACHE_RESERVATION_EXT_VERSION_1_0 version 1.0
ZE_CACHE_RESERVATION_EXT_VERSION_CURRENT ZeCacheReservationExtVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_CACHE_RESERVATION_EXT_VERSION_CURRENT latest known version
ZE_CACHE_RESERVATION_EXT_VERSION_FORCE_UINT32 ZeCacheReservationExtVersion = 0x7fffffff // ZE_CACHE_RESERVATION_EXT_VERSION_FORCE_UINT32 Value marking end of ZE_CACHE_RESERVATION_EXT_VERSION_* ENUMs
)
// ZeCacheExtRegion (ze_cache_ext_region_t) Cache Reservation Region
type ZeCacheExtRegion uintptr
const (
ZE_CACHE_EXT_REGION_ZE_CACHE_REGION_DEFAULT ZeCacheExtRegion = 0 // ZE_CACHE_EXT_REGION_ZE_CACHE_REGION_DEFAULT [DEPRECATED] utilize driver default scheme. Use
///< ::ZE_CACHE_EXT_REGION_DEFAULT.
ZE_CACHE_EXT_REGION_ZE_CACHE_RESERVE_REGION ZeCacheExtRegion = 1 // ZE_CACHE_EXT_REGION_ZE_CACHE_RESERVE_REGION [DEPRECATED] utilize reserved region. Use
///< ::ZE_CACHE_EXT_REGION_RESERVED.
ZE_CACHE_EXT_REGION_ZE_CACHE_NON_RESERVED_REGION ZeCacheExtRegion = 2 // ZE_CACHE_EXT_REGION_ZE_CACHE_NON_RESERVED_REGION [DEPRECATED] utilize non-reserverd region. Use
///< ::ZE_CACHE_EXT_REGION_NON_RESERVED.
ZE_CACHE_EXT_REGION_DEFAULT ZeCacheExtRegion = 0 // ZE_CACHE_EXT_REGION_DEFAULT utilize driver default scheme
ZE_CACHE_EXT_REGION_RESERVED ZeCacheExtRegion = 1 // ZE_CACHE_EXT_REGION_RESERVED utilize reserved region
ZE_CACHE_EXT_REGION_NON_RESERVED ZeCacheExtRegion = 2 // ZE_CACHE_EXT_REGION_NON_RESERVED utilize non-reserverd region
ZE_CACHE_EXT_REGION_FORCE_UINT32 ZeCacheExtRegion = 0x7fffffff // ZE_CACHE_EXT_REGION_FORCE_UINT32 Value marking end of ZE_CACHE_EXT_REGION_* ENUMs
)
// ZeCacheReservationExtDesc (ze_cache_reservation_ext_desc_t) CacheReservation structure
// /
// / @details
// / - This structure must be passed to ::zeDeviceGetCacheProperties via the
// / `pNext` member of ::ze_device_cache_properties_t
// / - Used for determining the max cache reservation allowed on device. Size
// / of zero means no reservation available.
type ZeCacheReservationExtDesc struct {
Stype ZeStructureType // Stype [in] type of this structure
Pnext unsafe.Pointer // Pnext [in][optional] must be null or a pointer to an extension-specific structure (i.e. contains stype and pNext).
Maxcachereservationsize uintptr // Maxcachereservationsize [out] max cache reservation size
}
// ZeDeviceReserveCacheExt Reserve Cache on Device
// /
// / @details
// / - The application may call this function but may not be successful as
// / some other application may have reserve prior
// /
// / @remarks
// / _Analogues_
// / - None
// /
// / @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 == hDevice`
func ZeDeviceReserveCacheExt(
hDevice ZeDeviceHandle, // hDevice [in] handle of the device object
cacheLevel uintptr, // cacheLevel [in] cache level where application want to reserve. If zero, then the driver shall default to last level of cache and attempt to reserve in that cache.
cacheReservationSize uintptr, // cacheReservationSize [in] value for reserving size, in bytes. If zero, then the driver shall remove prior reservation
) (ZeResult, error) {
return zecall.Call[ZeResult]("zeDeviceReserveCacheExt", uintptr(hDevice), uintptr(cacheLevel), uintptr(cacheReservationSize))
}
// ZeDeviceSetCacheAdviceExt Assign VA section to use reserved section
// /
// / @details
// / - The application may call this function to assign VA to particular
// / reservartion region
// /
// / @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 == hDevice`
// / - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
// / + `nullptr == ptr`
// / - ::ZE_RESULT_ERROR_INVALID_ENUMERATION
// / + `::ZE_CACHE_EXT_REGION_NON_RESERVED < cacheRegion`
// / - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION
func ZeDeviceSetCacheAdviceExt(
hDevice ZeDeviceHandle, // hDevice [in] handle of the device object
ptr unsafe.Pointer, // ptr [in] memory pointer to query
regionSize uintptr, // regionSize [in] region size, in pages
cacheRegion ZeCacheExtRegion, // cacheRegion [in] reservation region
) (ZeResult, error) {
return zecall.Call[ZeResult]("zeDeviceSetCacheAdviceExt", uintptr(hDevice), uintptr(unsafe.Pointer(ptr)), uintptr(regionSize), uintptr(cacheRegion))
}