1
0
mirror of https://github.com/fumiama/gozel.git synced 2026-06-05 00:10:24 +08:00
Files
gozel/core_kernelAllocationProperties.go
2026-03-24 00:49:26 +08:00

79 lines
4.1 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_GET_KERNEL_ALLOCATION_PROPERTIES_EXP_NAME Get Kernel Allocation Properties Extension Name
const ZE_GET_KERNEL_ALLOCATION_PROPERTIES_EXP_NAME = "ZE_experimental_kernel_allocation_properties"
// ZeKernelGetAllocationPropertiesExpVersion (ze_kernel_get_allocation_properties_exp_version_t) Get Kernel Allocation Properties Extension Version(s)
type ZeKernelGetAllocationPropertiesExpVersion uintptr
const (
ZE_KERNEL_GET_ALLOCATION_PROPERTIES_EXP_VERSION_1_0 ZeKernelGetAllocationPropertiesExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */((( 1 << 16 )|( 0 & 0x0000ffff))) // ZE_KERNEL_GET_ALLOCATION_PROPERTIES_EXP_VERSION_1_0 version 1.0
ZE_KERNEL_GET_ALLOCATION_PROPERTIES_EXP_VERSION_CURRENT ZeKernelGetAllocationPropertiesExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */((( 1 << 16 )|( 0 & 0x0000ffff))) // ZE_KERNEL_GET_ALLOCATION_PROPERTIES_EXP_VERSION_CURRENT latest known version
ZE_KERNEL_GET_ALLOCATION_PROPERTIES_EXP_VERSION_FORCE_UINT32 ZeKernelGetAllocationPropertiesExpVersion = 0x7fffffff // ZE_KERNEL_GET_ALLOCATION_PROPERTIES_EXP_VERSION_FORCE_UINT32 Value marking end of ZE_KERNEL_GET_ALLOCATION_PROPERTIES_EXP_VERSION_* ENUMs
)
// ZeKernelAllocationExpProperties (ze_kernel_allocation_exp_properties_t) Kernel allocation properties
type ZeKernelAllocationExpProperties struct {
Stype ZeStructureType // Stype [in] type of this structure
Pnext unsafe.Pointer // Pnext [in,out][optional] must be null or a pointer to an extension-specific structure (i.e. contains stype and pNext).
Base uint64 // Base [out] base address of the allocation
Size uintptr // Size [out] size of allocation
Type ZeMemoryType // Type [out] type of allocation
Argindex uint32 // Argindex [out] kernel argument index for current allocation, -1 for driver internal (not kernel argument) allocations
}
// ZeKernelGetAllocationPropertiesExp Retrieves kernel allocation properties.
///
/// @details
/// - A valid kernel handle must be created with ::zeKernelCreate.
/// - Returns array of kernel allocation properties for kernel handle.
/// - The application may call this function from simultaneous threads.
/// - The implementation of this function must be thread-safe.
///
/// @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 == hKernel`
/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
/// + `nullptr == pCount`
func ZeKernelGetAllocationPropertiesExp(
hKernel ZeKernelHandle, // hKernel [in] Kernel handle.
pCount *uint32, // pCount [in,out] pointer to the number of kernel allocation properties. if count is zero, then the driver shall update the value with the total number of kernel allocation properties available. if count is greater than the number of kernel allocation properties available, then the driver shall update the value with the correct number of kernel allocation properties.
pAllocationProperties *ZeKernelAllocationExpProperties, // pAllocationProperties [in,out][optional][range(0, *pCount)] array of kernel allocation properties. if count is less than the number of kernel allocation properties available, then driver shall only retrieve that number of kernel allocation properties.
) (ZeResult, error) {
return zecall.Call[ZeResult]("zeKernelGetAllocationPropertiesExp", uintptr(hKernel), uintptr(unsafe.Pointer(pCount)), uintptr(unsafe.Pointer(pAllocationProperties)))
}