mirror of
https://github.com/fumiama/gozel.git
synced 2026-06-05 08:20:24 +08:00
181 lines
9.3 KiB
Go
181 lines
9.3 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_BINDLESS_IMAGE_EXP_NAME Image Memory Properties Extension Name
|
|
const ZE_BINDLESS_IMAGE_EXP_NAME = "ZE_experimental_bindless_image"
|
|
|
|
// ZeBindlessImageExpVersion (ze_bindless_image_exp_version_t) Bindless Image Extension Version(s)
|
|
type ZeBindlessImageExpVersion uintptr
|
|
const (
|
|
ZE_BINDLESS_IMAGE_EXP_VERSION_1_0 ZeBindlessImageExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */((( 1 << 16 )|( 0 & 0x0000ffff))) // ZE_BINDLESS_IMAGE_EXP_VERSION_1_0 version 1.0
|
|
ZE_BINDLESS_IMAGE_EXP_VERSION_CURRENT ZeBindlessImageExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */((( 1 << 16 )|( 0 & 0x0000ffff))) // ZE_BINDLESS_IMAGE_EXP_VERSION_CURRENT latest known version
|
|
ZE_BINDLESS_IMAGE_EXP_VERSION_FORCE_UINT32 ZeBindlessImageExpVersion = 0x7fffffff // ZE_BINDLESS_IMAGE_EXP_VERSION_FORCE_UINT32 Value marking end of ZE_BINDLESS_IMAGE_EXP_VERSION_* ENUMs
|
|
|
|
)
|
|
|
|
// ZeImageBindlessExpFlags (ze_image_bindless_exp_flags_t) Image flags for Bindless images
|
|
type ZeImageBindlessExpFlags uint32
|
|
const (
|
|
ZE_IMAGE_BINDLESS_EXP_FLAG_BINDLESS ZeImageBindlessExpFlags = /* ZE_BIT(0) */(( 1 << 0 )) // ZE_IMAGE_BINDLESS_EXP_FLAG_BINDLESS Bindless images are created with ::zeImageCreate. The image handle
|
|
|
|
///< created with this flag is valid on both host and device.
|
|
|
|
ZE_IMAGE_BINDLESS_EXP_FLAG_SAMPLED_IMAGE ZeImageBindlessExpFlags = /* ZE_BIT(1) */(( 1 << 1 )) // ZE_IMAGE_BINDLESS_EXP_FLAG_SAMPLED_IMAGE Bindless sampled images are created with ::zeImageCreate by combining
|
|
|
|
///< BINDLESS and SAMPLED_IMAGE.
|
|
///< Create sampled image view from bindless unsampled image using SAMPLED_IMAGE.
|
|
|
|
ZE_IMAGE_BINDLESS_EXP_FLAG_FORCE_UINT32 ZeImageBindlessExpFlags = 0x7fffffff // ZE_IMAGE_BINDLESS_EXP_FLAG_FORCE_UINT32 Value marking end of ZE_IMAGE_BINDLESS_EXP_FLAG_* ENUMs
|
|
|
|
)
|
|
|
|
// ZeImageBindlessExpDesc (ze_image_bindless_exp_desc_t) Image descriptor for bindless images. This structure may be passed to
|
|
/// ::zeImageCreate via pNext member of ::ze_image_desc_t.
|
|
type ZeImageBindlessExpDesc 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).
|
|
Flags ZeImageBindlessExpFlags // Flags [in] image flags. must be 0 (default) or a valid value of ::ze_image_bindless_exp_flag_t default behavior is bindless images are not used when creating handles via ::zeImageCreate. When the flag is passed to ::zeImageCreate, then only the memory for the image is allocated. Additional image handles can be created with ::zeImageViewCreateExt. When ::ZE_IMAGE_BINDLESS_EXP_FLAG_SAMPLED_IMAGE flag is passed, ::ze_sampler_desc_t must be attached via pNext member of ::ze_image_bindless_exp_desc_t.
|
|
|
|
}
|
|
|
|
// ZeImagePitchedExpDesc (ze_image_pitched_exp_desc_t) Image descriptor for bindless images created from pitched allocations.
|
|
/// This structure may be passed to ::zeImageCreate via pNext member of
|
|
/// ::ze_image_desc_t.
|
|
type ZeImagePitchedExpDesc 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).
|
|
Ptr unsafe.Pointer // Ptr [in] pointer to pitched device allocation allocated using ::zeMemAllocDevice
|
|
|
|
}
|
|
|
|
// ZeDevicePitchedAllocExpProperties (ze_device_pitched_alloc_exp_properties_t) Device specific properties for pitched allocations
|
|
///
|
|
/// @details
|
|
/// - This structure may be passed to ::zeDeviceGetImageProperties via the
|
|
/// pNext member of ::ze_device_image_properties_t.
|
|
type ZeDevicePitchedAllocExpProperties 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).
|
|
Maximagelinearwidth uintptr // Maximagelinearwidth [out] Maximum image linear width.
|
|
Maximagelinearheight uintptr // Maximagelinearheight [out] Maximum image linear height.
|
|
|
|
}
|
|
|
|
// ZePitchedAlloc2dimageLinearPitchExpInfo (ze_pitched_alloc_2dimage_linear_pitch_exp_info_t) Pitch information for 2-dimensional linear pitched allocations
|
|
///
|
|
/// @details
|
|
/// - This structure may be passed to ::zeDeviceGetImageProperties in
|
|
/// conjunction with the ::ze_device_pitched_alloc_exp_properties_t via
|
|
/// its pNext member
|
|
type ZePitchedAlloc2dimageLinearPitchExpInfo 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).
|
|
Pitchalign uintptr // Pitchalign [out] Required pitch Aligment in Bytes.
|
|
Maxsupportedpitch uintptr // Maxsupportedpitch [out] Maximum allowed pitch in Bytes.
|
|
|
|
}
|
|
|
|
// ZeMemGetPitchFor2dImage Retrieves pitch information that can be used to allocate USM memory
|
|
/// for a given image.
|
|
///
|
|
/// @details
|
|
/// - Retrieves pitch for 2D image given the width, height and size in bytes
|
|
/// - The memory is then allocated using ::zeMemAllocDevice by providing
|
|
/// input size calculated as the returned pitch value multiplied by image height
|
|
/// - The application may call this function from simultaneous threads
|
|
/// - The implementation of this function must be thread-safe.
|
|
/// - The implementation of this function should be lock-free.
|
|
/// - The implementation must support ::ZE_BINDLESS_IMAGE_EXP_NAME extension.
|
|
///
|
|
/// @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`
|
|
func ZeMemGetPitchFor2dImage(
|
|
hContext ZeContextHandle, // hContext [in] handle of the context object
|
|
hDevice ZeDeviceHandle, // hDevice [in] handle of the device
|
|
imageWidth uintptr, // imageWidth [in] imageWidth
|
|
imageHeight uintptr, // imageHeight [in] imageHeight
|
|
elementSizeInBytes uint32, // elementSizeInBytes [in] Element size in bytes
|
|
rowPitch *uintptr, // rowPitch [out] rowPitch
|
|
) (ZeResult, error) {
|
|
return zecall.Call[ZeResult]("zeMemGetPitchFor2dImage", uintptr(hContext), uintptr(hDevice), uintptr(imageWidth), uintptr(imageHeight), uintptr(elementSizeInBytes), uintptr(unsafe.Pointer(rowPitch)))
|
|
}
|
|
|
|
// ZeImageGetDeviceOffsetExp Get bindless device offset for image
|
|
///
|
|
/// @details
|
|
/// - The application may call this function from simultaneous threads
|
|
/// - The implementation of this function must be thread-safe.
|
|
/// - The implementation of this function should be lock-free.
|
|
/// - The implementation must support ::ZE_BINDLESS_IMAGE_EXP_NAME
|
|
/// extension.
|
|
///
|
|
/// @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 == hImage`
|
|
/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
|
|
/// + `nullptr == pDeviceOffset`
|
|
func ZeImageGetDeviceOffsetExp(
|
|
hImage ZeImageHandle, // hImage [in] handle of the image
|
|
pDeviceOffset *uint64, // pDeviceOffset [out] bindless device offset for image
|
|
) (ZeResult, error) {
|
|
return zecall.Call[ZeResult]("zeImageGetDeviceOffsetExp", uintptr(hImage), uintptr(unsafe.Pointer(pDeviceOffset)))
|
|
}
|
|
|
|
// ZeCustomPitchExpDesc (ze_custom_pitch_exp_desc_t) Specify user defined pitch for pitched linear image allocations. This
|
|
/// structure may be passed to ::zeImageCreate in conjunction with
|
|
/// ::ze_image_pitched_exp_desc_t via its pNext member
|
|
type ZeCustomPitchExpDesc 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).
|
|
Rowpitch uintptr // Rowpitch [in] user programmed aligned pitch for pitched linear image allocations. This pitch should satisfy the pitchAlign requirement in ::ze_pitched_alloc_2dimage_linear_pitch_exp_info_t
|
|
Slicepitch uintptr // Slicepitch [in] user programmed slice pitch , must be multiple of rowPitch. For 2D image arrary or a slice of a 3D image array - this pitch should be >= rowPitch * image_height . For 1D iamge array >= rowPitch.
|
|
|
|
}
|
|
|