mirror of
https://github.com/fumiama/gozel.git
synced 2026-06-05 08:20:24 +08:00
577 lines
30 KiB
Go
577 lines
30 KiB
Go
// Code generated by cmd/gen. DO NOT EDIT.
|
|
|
|
/*
|
|
*
|
|
* Copyright (C) 2019-2025 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
* @file zet_api.h
|
|
* @version v1.15-r1.15.31
|
|
*
|
|
*/
|
|
|
|
package gozel
|
|
|
|
import (
|
|
"unsafe"
|
|
|
|
"github.com/fumiama/gozel/internal/zecall"
|
|
)
|
|
|
|
// ZetDeviceDebugPropertyFlags (zet_device_debug_property_flags_t) Supported device debug property flags
|
|
type ZetDeviceDebugPropertyFlags uint32
|
|
|
|
const (
|
|
ZET_DEVICE_DEBUG_PROPERTY_FLAG_ATTACH ZetDeviceDebugPropertyFlags = /* ZE_BIT(0) */ (1 << 0) // ZET_DEVICE_DEBUG_PROPERTY_FLAG_ATTACH the device supports attaching for debug
|
|
ZET_DEVICE_DEBUG_PROPERTY_FLAG_FORCE_UINT32 ZetDeviceDebugPropertyFlags = 0x7fffffff // ZET_DEVICE_DEBUG_PROPERTY_FLAG_FORCE_UINT32 Value marking end of ZET_DEVICE_DEBUG_PROPERTY_FLAG_* ENUMs
|
|
|
|
)
|
|
|
|
// ZetDeviceDebugProperties (zet_device_debug_properties_t) Device debug properties queried using ::zetDeviceGetDebugProperties.
|
|
type ZetDeviceDebugProperties struct {
|
|
Stype ZetStructureType // 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).
|
|
Flags ZetDeviceDebugPropertyFlags // Flags [out] returns 0 (none) or a valid combination of ::zet_device_debug_property_flag_t
|
|
|
|
}
|
|
|
|
// ZetDeviceGetDebugProperties Retrieves debug properties of the device.
|
|
// /
|
|
// / @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 == pDebugProperties`
|
|
func ZetDeviceGetDebugProperties(
|
|
hDevice ZetDeviceHandle, // hDevice [in] device handle
|
|
pDebugProperties *ZetDeviceDebugProperties, // pDebugProperties [in,out] query result for debug properties
|
|
) (ZeResult, error) {
|
|
return zecall.Call[ZeResult]("zetDeviceGetDebugProperties", uintptr(hDevice), uintptr(unsafe.Pointer(pDebugProperties)))
|
|
}
|
|
|
|
// ZetDebugConfig (zet_debug_config_t) Debug configuration provided to ::zetDebugAttach
|
|
type ZetDebugConfig struct {
|
|
Pid uint32 // Pid [in] the host process identifier
|
|
|
|
}
|
|
|
|
// ZetDebugAttach Attach to a device.
|
|
// /
|
|
// / @details
|
|
// / - The device must be enabled for debug; see
|
|
// / ::zesSchedulerSetComputeUnitDebugMode.
|
|
// /
|
|
// / @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_DEPENDENCY_UNAVAILABLE
|
|
// / - ::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 == config`
|
|
// / + `nullptr == phDebug`
|
|
// / - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE
|
|
// / + attaching to this device is not supported
|
|
// / - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS
|
|
// / + caller does not have sufficient permissions
|
|
// / - ::ZE_RESULT_ERROR_NOT_AVAILABLE
|
|
// / + a debugger is already attached
|
|
func ZetDebugAttach(
|
|
hDevice ZetDeviceHandle, // hDevice [in] device handle
|
|
config *ZetDebugConfig, // config [in] the debug configuration
|
|
phDebug *ZetDebugSessionHandle, // phDebug [out] debug session handle
|
|
) (ZeResult, error) {
|
|
return zecall.Call[ZeResult]("zetDebugAttach", uintptr(hDevice), uintptr(unsafe.Pointer(config)), uintptr(unsafe.Pointer(phDebug)))
|
|
}
|
|
|
|
// ZetDebugDetach Close a debug session.
|
|
// /
|
|
// / @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 == hDebug`
|
|
func ZetDebugDetach(
|
|
hDebug ZetDebugSessionHandle, // hDebug [in][release] debug session handle
|
|
) (ZeResult, error) {
|
|
return zecall.Call[ZeResult]("zetDebugDetach", uintptr(hDebug))
|
|
}
|
|
|
|
// ZetDebugEventFlags (zet_debug_event_flags_t) Supported debug event flags.
|
|
type ZetDebugEventFlags uint32
|
|
|
|
const (
|
|
ZET_DEBUG_EVENT_FLAG_NEED_ACK ZetDebugEventFlags = /* ZE_BIT(0) */ (1 << 0) // ZET_DEBUG_EVENT_FLAG_NEED_ACK The event needs to be acknowledged by calling
|
|
|
|
///< ::zetDebugAcknowledgeEvent.
|
|
|
|
ZET_DEBUG_EVENT_FLAG_FORCE_UINT32 ZetDebugEventFlags = 0x7fffffff // ZET_DEBUG_EVENT_FLAG_FORCE_UINT32 Value marking end of ZET_DEBUG_EVENT_FLAG_* ENUMs
|
|
|
|
)
|
|
|
|
// ZetDebugEventType (zet_debug_event_type_t) Supported debug event types.
|
|
type ZetDebugEventType uintptr
|
|
|
|
const (
|
|
ZET_DEBUG_EVENT_TYPE_INVALID ZetDebugEventType = 0 // ZET_DEBUG_EVENT_TYPE_INVALID The event is invalid
|
|
ZET_DEBUG_EVENT_TYPE_DETACHED ZetDebugEventType = 1 // ZET_DEBUG_EVENT_TYPE_DETACHED The tool was detached
|
|
ZET_DEBUG_EVENT_TYPE_PROCESS_ENTRY ZetDebugEventType = 2 // ZET_DEBUG_EVENT_TYPE_PROCESS_ENTRY The debuggee process created command queues on the device
|
|
ZET_DEBUG_EVENT_TYPE_PROCESS_EXIT ZetDebugEventType = 3 // ZET_DEBUG_EVENT_TYPE_PROCESS_EXIT The debuggee process destroyed all command queues on the device
|
|
ZET_DEBUG_EVENT_TYPE_MODULE_LOAD ZetDebugEventType = 4 // ZET_DEBUG_EVENT_TYPE_MODULE_LOAD An in-memory module was loaded onto the device
|
|
ZET_DEBUG_EVENT_TYPE_MODULE_UNLOAD ZetDebugEventType = 5 // ZET_DEBUG_EVENT_TYPE_MODULE_UNLOAD An in-memory module is about to get unloaded from the device
|
|
ZET_DEBUG_EVENT_TYPE_THREAD_STOPPED ZetDebugEventType = 6 // ZET_DEBUG_EVENT_TYPE_THREAD_STOPPED The thread stopped due to a device exception
|
|
ZET_DEBUG_EVENT_TYPE_THREAD_UNAVAILABLE ZetDebugEventType = 7 // ZET_DEBUG_EVENT_TYPE_THREAD_UNAVAILABLE The thread is not available to be stopped
|
|
ZET_DEBUG_EVENT_TYPE_PAGE_FAULT ZetDebugEventType = 8 // ZET_DEBUG_EVENT_TYPE_PAGE_FAULT A page request could not be completed on the device
|
|
ZET_DEBUG_EVENT_TYPE_FORCE_UINT32 ZetDebugEventType = 0x7fffffff // ZET_DEBUG_EVENT_TYPE_FORCE_UINT32 Value marking end of ZET_DEBUG_EVENT_TYPE_* ENUMs
|
|
|
|
)
|
|
|
|
// ZetDebugDetachReason (zet_debug_detach_reason_t) Supported debug detach reasons.
|
|
type ZetDebugDetachReason uintptr
|
|
|
|
const (
|
|
ZET_DEBUG_DETACH_REASON_INVALID ZetDebugDetachReason = 0 // ZET_DEBUG_DETACH_REASON_INVALID The detach reason is not valid
|
|
ZET_DEBUG_DETACH_REASON_HOST_EXIT ZetDebugDetachReason = 1 // ZET_DEBUG_DETACH_REASON_HOST_EXIT The host process exited
|
|
ZET_DEBUG_DETACH_REASON_FORCE_UINT32 ZetDebugDetachReason = 0x7fffffff // ZET_DEBUG_DETACH_REASON_FORCE_UINT32 Value marking end of ZET_DEBUG_DETACH_REASON_* ENUMs
|
|
|
|
)
|
|
|
|
// ZetDebugEventInfoDetached (zet_debug_event_info_detached_t) Event information for ::ZET_DEBUG_EVENT_TYPE_DETACHED
|
|
type ZetDebugEventInfoDetached struct {
|
|
Reason ZetDebugDetachReason // Reason [out] the detach reason
|
|
|
|
}
|
|
|
|
// ZetDebugEventInfoModule (zet_debug_event_info_module_t) Event information for ::ZET_DEBUG_EVENT_TYPE_MODULE_LOAD and
|
|
// / ::ZET_DEBUG_EVENT_TYPE_MODULE_UNLOAD
|
|
type ZetDebugEventInfoModule struct {
|
|
Format ZetModuleDebugInfoFormat // Format [out] the module format
|
|
Modulebegin uint64 // Modulebegin [out] the begin address of the in-memory module (inclusive)
|
|
Moduleend uint64 // Moduleend [out] the end address of the in-memory module (exclusive)
|
|
Load uint64 // Load [out] the load address of the module on the device
|
|
|
|
}
|
|
|
|
// ZetDebugEventInfoThreadStopped (zet_debug_event_info_thread_stopped_t) Event information for ::ZET_DEBUG_EVENT_TYPE_THREAD_STOPPED and
|
|
// / ::ZET_DEBUG_EVENT_TYPE_THREAD_UNAVAILABLE
|
|
type ZetDebugEventInfoThreadStopped struct {
|
|
Thread ZeDeviceThread // Thread [out] the stopped/unavailable thread
|
|
|
|
}
|
|
|
|
// ZetDebugPageFaultReason (zet_debug_page_fault_reason_t) Page fault reasons.
|
|
type ZetDebugPageFaultReason uintptr
|
|
|
|
const (
|
|
ZET_DEBUG_PAGE_FAULT_REASON_INVALID ZetDebugPageFaultReason = 0 // ZET_DEBUG_PAGE_FAULT_REASON_INVALID The page fault reason is not valid
|
|
ZET_DEBUG_PAGE_FAULT_REASON_MAPPING_ERROR ZetDebugPageFaultReason = 1 // ZET_DEBUG_PAGE_FAULT_REASON_MAPPING_ERROR The address is not mapped
|
|
ZET_DEBUG_PAGE_FAULT_REASON_PERMISSION_ERROR ZetDebugPageFaultReason = 2 // ZET_DEBUG_PAGE_FAULT_REASON_PERMISSION_ERROR Invalid access permissions
|
|
ZET_DEBUG_PAGE_FAULT_REASON_FORCE_UINT32 ZetDebugPageFaultReason = 0x7fffffff // ZET_DEBUG_PAGE_FAULT_REASON_FORCE_UINT32 Value marking end of ZET_DEBUG_PAGE_FAULT_REASON_* ENUMs
|
|
|
|
)
|
|
|
|
// ZetDebugEventInfoPageFault (zet_debug_event_info_page_fault_t) Event information for ::ZET_DEBUG_EVENT_TYPE_PAGE_FAULT
|
|
type ZetDebugEventInfoPageFault struct {
|
|
Address uint64 // Address [out] the faulting address
|
|
Mask uint64 // Mask [out] the alignment mask
|
|
Reason ZetDebugPageFaultReason // Reason [out] the page fault reason
|
|
|
|
}
|
|
|
|
// ZetDebugEventInfo (zet_debug_event_info_t) Event type-specific information
|
|
type ZetDebugEventInfo [32]byte
|
|
|
|
// ZetDebugEvent (zet_debug_event_t) A debug event on the device.
|
|
type ZetDebugEvent struct {
|
|
Type ZetDebugEventType // Type [out] the event type
|
|
Flags ZetDebugEventFlags // Flags [out] returns 0 (none) or a combination of ::zet_debug_event_flag_t
|
|
Info ZetDebugEventInfo // Info [out] event type specific information
|
|
|
|
}
|
|
|
|
// ZetDebugReadEvent Read the topmost debug event.
|
|
// /
|
|
// / @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 == hDebug`
|
|
// / - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
|
|
// / + `nullptr == event`
|
|
// / - ::ZE_RESULT_NOT_READY
|
|
// / + the timeout expired
|
|
func ZetDebugReadEvent(
|
|
hDebug ZetDebugSessionHandle, // hDebug [in] debug session handle
|
|
timeout uint64, // timeout [in] if non-zero, then indicates the maximum time (in milliseconds) to yield before returning ::ZE_RESULT_SUCCESS or ::ZE_RESULT_NOT_READY; if zero, then immediately returns the status of the event; if `UINT64_MAX`, then function will not return until complete or device is lost. Due to external dependencies, timeout may be rounded to the closest value allowed by the accuracy of those dependencies.
|
|
event *ZetDebugEvent, // event [in,out] a pointer to a ::zet_debug_event_t.
|
|
) (ZeResult, error) {
|
|
return zecall.Call[ZeResult]("zetDebugReadEvent", uintptr(hDebug), uintptr(timeout), uintptr(unsafe.Pointer(event)))
|
|
}
|
|
|
|
// ZetDebugAcknowledgeEvent Acknowledge a debug event.
|
|
// /
|
|
// / @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 == hDebug`
|
|
// / - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
|
|
// / + `nullptr == event`
|
|
func ZetDebugAcknowledgeEvent(
|
|
hDebug ZetDebugSessionHandle, // hDebug [in] debug session handle
|
|
event *ZetDebugEvent, // event [in] a pointer to a ::zet_debug_event_t.
|
|
) (ZeResult, error) {
|
|
return zecall.Call[ZeResult]("zetDebugAcknowledgeEvent", uintptr(hDebug), uintptr(unsafe.Pointer(event)))
|
|
}
|
|
|
|
// ZetDebugInterrupt Interrupt device threads.
|
|
// /
|
|
// / @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_DEVICE_REQUIRES_RESET
|
|
// / - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
|
|
// / - ::ZE_RESULT_ERROR_UNKNOWN
|
|
// / - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
|
|
// / + `nullptr == hDebug`
|
|
// / - ::ZE_RESULT_ERROR_NOT_AVAILABLE
|
|
// / + the thread is already stopped or unavailable
|
|
func ZetDebugInterrupt(
|
|
hDebug ZetDebugSessionHandle, // hDebug [in] debug session handle
|
|
thread *ZeDeviceThread, // thread [in] the thread to interrupt (gozel hack: converted to a hidden pointer from a struct value)
|
|
) (ZeResult, error) {
|
|
return zecall.Call[ZeResult]("zetDebugInterrupt", uintptr(hDebug), uintptr(unsafe.Pointer(thread)))
|
|
}
|
|
|
|
// ZetDebugResume Resume device threads.
|
|
// /
|
|
// / @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_DEVICE_REQUIRES_RESET
|
|
// / - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
|
|
// / - ::ZE_RESULT_ERROR_UNKNOWN
|
|
// / - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
|
|
// / + `nullptr == hDebug`
|
|
// / - ::ZE_RESULT_ERROR_NOT_AVAILABLE
|
|
// / + the thread is already running or unavailable
|
|
func ZetDebugResume(
|
|
hDebug ZetDebugSessionHandle, // hDebug [in] debug session handle
|
|
thread *ZeDeviceThread, // thread [in] the thread to resume (gozel hack: converted to a hidden pointer from a struct value)
|
|
) (ZeResult, error) {
|
|
return zecall.Call[ZeResult]("zetDebugResume", uintptr(hDebug), uintptr(unsafe.Pointer(thread)))
|
|
}
|
|
|
|
// ZetDebugMemorySpaceType (zet_debug_memory_space_type_t) Supported device memory space types.
|
|
type ZetDebugMemorySpaceType uintptr
|
|
|
|
const (
|
|
ZET_DEBUG_MEMORY_SPACE_TYPE_DEFAULT ZetDebugMemorySpaceType = 0 // ZET_DEBUG_MEMORY_SPACE_TYPE_DEFAULT default memory space (attribute may be omitted)
|
|
ZET_DEBUG_MEMORY_SPACE_TYPE_SLM ZetDebugMemorySpaceType = 1 // ZET_DEBUG_MEMORY_SPACE_TYPE_SLM shared local memory space (GPU-only)
|
|
ZET_DEBUG_MEMORY_SPACE_TYPE_ELF ZetDebugMemorySpaceType = 2 // ZET_DEBUG_MEMORY_SPACE_TYPE_ELF ELF file memory space
|
|
ZET_DEBUG_MEMORY_SPACE_TYPE_BARRIER ZetDebugMemorySpaceType = 3 // ZET_DEBUG_MEMORY_SPACE_TYPE_BARRIER Barrier memory space
|
|
ZET_DEBUG_MEMORY_SPACE_TYPE_FORCE_UINT32 ZetDebugMemorySpaceType = 0x7fffffff // ZET_DEBUG_MEMORY_SPACE_TYPE_FORCE_UINT32 Value marking end of ZET_DEBUG_MEMORY_SPACE_TYPE_* ENUMs
|
|
|
|
)
|
|
|
|
// ZetDebugMemorySpaceDesc (zet_debug_memory_space_desc_t) Device memory space descriptor
|
|
type ZetDebugMemorySpaceDesc struct {
|
|
Stype ZetStructureType // 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).
|
|
Type ZetDebugMemorySpaceType // Type [in] type of memory space
|
|
Address uint64 // Address [in] the virtual address within the memory space
|
|
|
|
}
|
|
|
|
// ZetDebugReadMemory Read memory.
|
|
// /
|
|
// / @details
|
|
// / - The thread identifier 'all' can be used for accessing the default
|
|
// / memory space, e.g. for setting breakpoints.
|
|
// /
|
|
// / @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_DEVICE_REQUIRES_RESET
|
|
// / - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
|
|
// / - ::ZE_RESULT_ERROR_UNKNOWN
|
|
// / - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
|
|
// / + `nullptr == hDebug`
|
|
// / - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
|
|
// / + `nullptr == desc`
|
|
// / + `nullptr == buffer`
|
|
// / - ::ZE_RESULT_ERROR_INVALID_ENUMERATION
|
|
// / + `::ZET_DEBUG_MEMORY_SPACE_TYPE_BARRIER < desc->type`
|
|
// / - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION
|
|
// / - ::ZE_RESULT_ERROR_NOT_AVAILABLE
|
|
// / + the thread is running or unavailable
|
|
// / + the memory cannot be accessed from the supplied thread
|
|
func ZetDebugReadMemory(
|
|
hDebug ZetDebugSessionHandle, // hDebug [in] debug session handle
|
|
thread *ZeDeviceThread, // thread [in] the thread identifier. (gozel hack: converted to a hidden pointer from a struct value)
|
|
desc *ZetDebugMemorySpaceDesc, // desc [in] memory space descriptor
|
|
size uintptr, // size [in] the number of bytes to read
|
|
buffer unsafe.Pointer, // buffer [in,out] a buffer to hold a copy of the memory
|
|
) (ZeResult, error) {
|
|
return zecall.Call[ZeResult]("zetDebugReadMemory", uintptr(hDebug), uintptr(unsafe.Pointer(thread)), uintptr(unsafe.Pointer(desc)), uintptr(size), uintptr(unsafe.Pointer(buffer)))
|
|
}
|
|
|
|
// ZetDebugWriteMemory Write memory.
|
|
// /
|
|
// / @details
|
|
// / - The thread identifier 'all' can be used for accessing the default
|
|
// / memory space, e.g. for setting breakpoints.
|
|
// /
|
|
// / @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_DEVICE_REQUIRES_RESET
|
|
// / - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
|
|
// / - ::ZE_RESULT_ERROR_UNKNOWN
|
|
// / - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
|
|
// / + `nullptr == hDebug`
|
|
// / - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
|
|
// / + `nullptr == desc`
|
|
// / + `nullptr == buffer`
|
|
// / - ::ZE_RESULT_ERROR_INVALID_ENUMERATION
|
|
// / + `::ZET_DEBUG_MEMORY_SPACE_TYPE_BARRIER < desc->type`
|
|
// / - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION
|
|
// / - ::ZE_RESULT_ERROR_NOT_AVAILABLE
|
|
// / + the thread is running or unavailable
|
|
// / + the memory cannot be accessed from the supplied thread
|
|
func ZetDebugWriteMemory(
|
|
hDebug ZetDebugSessionHandle, // hDebug [in] debug session handle
|
|
thread *ZeDeviceThread, // thread [in] the thread identifier. (gozel hack: converted to a hidden pointer from a struct value)
|
|
desc *ZetDebugMemorySpaceDesc, // desc [in] memory space descriptor
|
|
size uintptr, // size [in] the number of bytes to write
|
|
buffer unsafe.Pointer, // buffer [in] a buffer holding the pattern to write
|
|
) (ZeResult, error) {
|
|
return zecall.Call[ZeResult]("zetDebugWriteMemory", uintptr(hDebug), uintptr(unsafe.Pointer(thread)), uintptr(unsafe.Pointer(desc)), uintptr(size), uintptr(unsafe.Pointer(buffer)))
|
|
}
|
|
|
|
// ZetDebugRegsetFlags (zet_debug_regset_flags_t) Supported general register set flags.
|
|
type ZetDebugRegsetFlags uint32
|
|
|
|
const (
|
|
ZET_DEBUG_REGSET_FLAG_READABLE ZetDebugRegsetFlags = /* ZE_BIT(0) */ (1 << 0) // ZET_DEBUG_REGSET_FLAG_READABLE register set is readable
|
|
ZET_DEBUG_REGSET_FLAG_WRITEABLE ZetDebugRegsetFlags = /* ZE_BIT(1) */ (1 << 1) // ZET_DEBUG_REGSET_FLAG_WRITEABLE register set is writeable
|
|
ZET_DEBUG_REGSET_FLAG_FORCE_UINT32 ZetDebugRegsetFlags = 0x7fffffff // ZET_DEBUG_REGSET_FLAG_FORCE_UINT32 Value marking end of ZET_DEBUG_REGSET_FLAG_* ENUMs
|
|
|
|
)
|
|
|
|
// ZetDebugRegsetProperties (zet_debug_regset_properties_t) Device register set properties queried using
|
|
// / ::zetDebugGetRegisterSetProperties.
|
|
type ZetDebugRegsetProperties struct {
|
|
Stype ZetStructureType // 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).
|
|
Type uint32 // Type [out] device-specific register set type
|
|
Version uint32 // Version [out] device-specific version of this register set
|
|
Generalflags ZetDebugRegsetFlags // Generalflags [out] general register set flags
|
|
Deviceflags uint32 // Deviceflags [out] device-specific register set flags
|
|
Count uint32 // Count [out] number of registers in the set
|
|
Bitsize uint32 // Bitsize [out] the size of a register in bits
|
|
Bytesize uint32 // Bytesize [out] the size required for reading or writing a register in bytes
|
|
|
|
}
|
|
|
|
// ZetDebugGetRegisterSetProperties Retrieves debug register set properties.
|
|
// /
|
|
// / @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 == pCount`
|
|
func ZetDebugGetRegisterSetProperties(
|
|
hDevice ZetDeviceHandle, // hDevice [in] device handle
|
|
pCount *uint32, // pCount [in,out] pointer to the number of register set properties. if count is zero, then the driver shall update the value with the total number of register set properties available. if count is greater than the number of register set properties available, then the driver shall update the value with the correct number of registry set properties available.
|
|
pRegisterSetProperties *ZetDebugRegsetProperties, // pRegisterSetProperties [in,out][optional][range(0, *pCount)] array of query results for register set properties. if count is less than the number of register set properties available, then driver shall only retrieve that number of register set properties.
|
|
) (ZeResult, error) {
|
|
return zecall.Call[ZeResult]("zetDebugGetRegisterSetProperties", uintptr(hDevice), uintptr(unsafe.Pointer(pCount)), uintptr(unsafe.Pointer(pRegisterSetProperties)))
|
|
}
|
|
|
|
// ZetDebugGetThreadRegisterSetProperties Retrieves debug register set properties for a given thread.
|
|
// /
|
|
// / @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_DEVICE_REQUIRES_RESET
|
|
// / - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
|
|
// / - ::ZE_RESULT_ERROR_UNKNOWN
|
|
// / - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
|
|
// / + `nullptr == hDebug`
|
|
// / - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
|
|
// / + `nullptr == pCount`
|
|
// / - ::ZE_RESULT_ERROR_NOT_AVAILABLE
|
|
// / + the thread is running or unavailable
|
|
// / - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
|
|
// / + the thread argument specifies more than one or a non-existant thread
|
|
func ZetDebugGetThreadRegisterSetProperties(
|
|
hDebug ZetDebugSessionHandle, // hDebug [in] debug session handle
|
|
thread *ZeDeviceThread, // thread [in] the thread identifier specifying a single stopped thread (gozel hack: converted to a hidden pointer from a struct value)
|
|
pCount *uint32, // pCount [in,out] pointer to the number of register set properties. if count is zero, then the driver shall update the value with the total number of register set properties available. if count is greater than the number of register set properties available, then the driver shall update the value with the correct number of registry set properties available.
|
|
pRegisterSetProperties *ZetDebugRegsetProperties, // pRegisterSetProperties [in,out][optional][range(0, *pCount)] array of query results for register set properties. if count is less than the number of register set properties available, then driver shall only retrieve that number of register set properties.
|
|
) (ZeResult, error) {
|
|
return zecall.Call[ZeResult]("zetDebugGetThreadRegisterSetProperties", uintptr(hDebug), uintptr(unsafe.Pointer(thread)), uintptr(unsafe.Pointer(pCount)), uintptr(unsafe.Pointer(pRegisterSetProperties)))
|
|
}
|
|
|
|
// ZetDebugReadRegisters Read register state.
|
|
// /
|
|
// / @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_DEVICE_REQUIRES_RESET
|
|
// / - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
|
|
// / - ::ZE_RESULT_ERROR_UNKNOWN
|
|
// / - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
|
|
// / + `nullptr == hDebug`
|
|
// / - ::ZE_RESULT_ERROR_NOT_AVAILABLE
|
|
// / + the thread is running or unavailable
|
|
func ZetDebugReadRegisters(
|
|
hDebug ZetDebugSessionHandle, // hDebug [in] debug session handle
|
|
thread *ZeDeviceThread, // thread [in] the thread identifier (gozel hack: converted to a hidden pointer from a struct value)
|
|
typ uint32, // typ [in] register set type
|
|
start uint32, // start [in] the starting offset into the register state area; must be less than the `count` member of ::zet_debug_regset_properties_t for the type
|
|
count uint32, // count [in] the number of registers to read; start+count must be less than or equal to the `count` member of ::zet_debug_regset_properties_t for the type
|
|
pRegisterValues unsafe.Pointer, // pRegisterValues [in,out][optional][range(0, count)] buffer of register values
|
|
) (ZeResult, error) {
|
|
return zecall.Call[ZeResult]("zetDebugReadRegisters", uintptr(hDebug), uintptr(unsafe.Pointer(thread)), uintptr(typ), uintptr(start), uintptr(count), uintptr(unsafe.Pointer(pRegisterValues)))
|
|
}
|
|
|
|
// ZetDebugWriteRegisters Write register state.
|
|
// /
|
|
// / @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_DEVICE_REQUIRES_RESET
|
|
// / - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
|
|
// / - ::ZE_RESULT_ERROR_UNKNOWN
|
|
// / - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
|
|
// / + `nullptr == hDebug`
|
|
// / - ::ZE_RESULT_ERROR_NOT_AVAILABLE
|
|
// / + the thread is running or unavailable
|
|
func ZetDebugWriteRegisters(
|
|
hDebug ZetDebugSessionHandle, // hDebug [in] debug session handle
|
|
thread *ZeDeviceThread, // thread [in] the thread identifier (gozel hack: converted to a hidden pointer from a struct value)
|
|
typ uint32, // typ [in] register set type
|
|
start uint32, // start [in] the starting offset into the register state area; must be less than the `count` member of ::zet_debug_regset_properties_t for the type
|
|
count uint32, // count [in] the number of registers to write; start+count must be less than or equal to the `count` member of ::zet_debug_regset_properties_t for the type
|
|
pRegisterValues unsafe.Pointer, // pRegisterValues [in,out][optional][range(0, count)] buffer of register values
|
|
) (ZeResult, error) {
|
|
return zecall.Call[ZeResult]("zetDebugWriteRegisters", uintptr(hDebug), uintptr(unsafe.Pointer(thread)), uintptr(typ), uintptr(start), uintptr(count), uintptr(unsafe.Pointer(pRegisterValues)))
|
|
}
|