mirror of
https://github.com/fumiama/gozel.git
synced 2026-06-05 00:10:24 +08:00
166 lines
6.6 KiB
Go
166 lines
6.6 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"
|
|
)
|
|
|
|
// ZeContextMakeMemoryResident Makes memory resident for the device.
|
|
// /
|
|
// / @details
|
|
// / - The application must ensure the memory is resident before being
|
|
// / referenced by the 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_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`
|
|
// / - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
|
|
// / + `nullptr == ptr`
|
|
// / - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
|
|
// / + ptr is not recognized by the implementation
|
|
func ZeContextMakeMemoryResident(
|
|
hContext ZeContextHandle, // hContext [in] handle of context object
|
|
hDevice ZeDeviceHandle, // hDevice [in] handle of the device
|
|
ptr unsafe.Pointer, // ptr [in] pointer to memory to make resident
|
|
size uintptr, // size [in] size in bytes to make resident
|
|
) (ZeResult, error) {
|
|
return zecall.Call[ZeResult]("zeContextMakeMemoryResident", uintptr(hContext), uintptr(hDevice), uintptr(unsafe.Pointer(ptr)), uintptr(size))
|
|
}
|
|
|
|
// ZeContextEvictMemory Allows memory to be evicted from the device.
|
|
// /
|
|
// / @details
|
|
// / - The application must ensure the device is not currently referencing
|
|
// / the memory before it is evicted
|
|
// / - The application may free the memory without evicting; the memory is
|
|
// / implicitly evicted when freed.
|
|
// / - 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`
|
|
// / - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
|
|
// / + `nullptr == ptr`
|
|
func ZeContextEvictMemory(
|
|
hContext ZeContextHandle, // hContext [in] handle of context object
|
|
hDevice ZeDeviceHandle, // hDevice [in] handle of the device
|
|
ptr unsafe.Pointer, // ptr [in] pointer to memory to evict
|
|
size uintptr, // size [in] size in bytes to evict
|
|
) (ZeResult, error) {
|
|
return zecall.Call[ZeResult]("zeContextEvictMemory", uintptr(hContext), uintptr(hDevice), uintptr(unsafe.Pointer(ptr)), uintptr(size))
|
|
}
|
|
|
|
// ZeContextMakeImageResident Makes image resident for the device.
|
|
// /
|
|
// / @details
|
|
// / - The application must ensure the image is resident before being
|
|
// / referenced by the 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`
|
|
// / + `nullptr == hImage`
|
|
func ZeContextMakeImageResident(
|
|
hContext ZeContextHandle, // hContext [in] handle of context object
|
|
hDevice ZeDeviceHandle, // hDevice [in] handle of the device
|
|
hImage ZeImageHandle, // hImage [in] handle of image to make resident
|
|
) (ZeResult, error) {
|
|
return zecall.Call[ZeResult]("zeContextMakeImageResident", uintptr(hContext), uintptr(hDevice), uintptr(hImage))
|
|
}
|
|
|
|
// ZeContextEvictImage Allows image to be evicted from the device.
|
|
// /
|
|
// / @details
|
|
// / - The application must ensure the device is not currently referencing
|
|
// / the image before it is evicted
|
|
// / - The application may destroy the image without evicting; the image is
|
|
// / implicitly evicted when destroyed.
|
|
// / - 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`
|
|
// / + `nullptr == hImage`
|
|
func ZeContextEvictImage(
|
|
hContext ZeContextHandle, // hContext [in] handle of context object
|
|
hDevice ZeDeviceHandle, // hDevice [in] handle of the device
|
|
hImage ZeImageHandle, // hImage [in] handle of image to make evict
|
|
) (ZeResult, error) {
|
|
return zecall.Call[ZeResult]("zeContextEvictImage", uintptr(hContext), uintptr(hDevice), uintptr(hImage))
|
|
}
|