#![allow(warnings)] /* automatically generated by rust-bindgen 0.72.1 */ pub const _STDINT_H: u32 = 1; pub const _FEATURES_H: u32 = 1; pub const _DEFAULT_SOURCE: u32 = 1; pub const __USE_ISOC11: u32 = 1; pub const __USE_ISOC99: u32 = 1; pub const __USE_ISOC95: u32 = 1; pub const __USE_POSIX_IMPLICITLY: u32 = 1; pub const _POSIX_SOURCE: u32 = 1; pub const _POSIX_C_SOURCE: u32 = 200809; pub const __USE_POSIX: u32 = 1; pub const __USE_POSIX2: u32 = 1; pub const __USE_POSIX199309: u32 = 1; pub const __USE_POSIX199506: u32 = 1; pub const __USE_XOPEN2K: u32 = 1; pub const __USE_XOPEN2K8: u32 = 1; pub const _ATFILE_SOURCE: u32 = 1; pub const __USE_MISC: u32 = 1; pub const __USE_ATFILE: u32 = 1; pub const __USE_FORTIFY_LEVEL: u32 = 0; pub const __GLIBC_USE_DEPRECATED_GETS: u32 = 0; pub const _STDC_PREDEF_H: u32 = 1; pub const __STDC_IEC_559__: u32 = 1; pub const __STDC_IEC_559_COMPLEX__: u32 = 1; pub const __STDC_ISO_10646__: u32 = 201706; pub const __GNU_LIBRARY__: u32 = 6; pub const __GLIBC__: u32 = 2; pub const __GLIBC_MINOR__: u32 = 28; pub const _SYS_CDEFS_H: u32 = 1; pub const __glibc_c99_flexarr_available: u32 = 1; pub const __WORDSIZE: u32 = 64; pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1; pub const __SYSCALL_WORDSIZE: u32 = 64; pub const __HAVE_GENERIC_SELECTION: u32 = 1; pub const __GLIBC_USE_LIB_EXT2: u32 = 0; pub const __GLIBC_USE_IEC_60559_BFP_EXT: u32 = 0; pub const __GLIBC_USE_IEC_60559_FUNCS_EXT: u32 = 0; pub const __GLIBC_USE_IEC_60559_TYPES_EXT: u32 = 0; pub const _BITS_TYPES_H: u32 = 1; pub const _BITS_TYPESIZES_H: u32 = 1; pub const __OFF_T_MATCHES_OFF64_T: u32 = 1; pub const __INO_T_MATCHES_INO64_T: u32 = 1; pub const __RLIM_T_MATCHES_RLIM64_T: u32 = 1; pub const __FD_SETSIZE: u32 = 1024; pub const _BITS_WCHAR_H: u32 = 1; pub const _BITS_STDINT_INTN_H: u32 = 1; pub const _BITS_STDINT_UINTN_H: u32 = 1; pub const INT8_MIN: i32 = -128; pub const INT16_MIN: i32 = -32768; pub const INT32_MIN: i32 = -2147483648; pub const INT8_MAX: u32 = 127; pub const INT16_MAX: u32 = 32767; pub const INT32_MAX: u32 = 2147483647; pub const UINT8_MAX: u32 = 255; pub const UINT16_MAX: u32 = 65535; pub const UINT32_MAX: u32 = 4294967295; pub const INT_LEAST8_MIN: i32 = -128; pub const INT_LEAST16_MIN: i32 = -32768; pub const INT_LEAST32_MIN: i32 = -2147483648; pub const INT_LEAST8_MAX: u32 = 127; pub const INT_LEAST16_MAX: u32 = 32767; pub const INT_LEAST32_MAX: u32 = 2147483647; pub const UINT_LEAST8_MAX: u32 = 255; pub const UINT_LEAST16_MAX: u32 = 65535; pub const UINT_LEAST32_MAX: u32 = 4294967295; pub const INT_FAST8_MIN: i32 = -128; pub const INT_FAST16_MIN: i64 = -9223372036854775808; pub const INT_FAST32_MIN: i64 = -9223372036854775808; pub const INT_FAST8_MAX: u32 = 127; pub const INT_FAST16_MAX: u64 = 9223372036854775807; pub const INT_FAST32_MAX: u64 = 9223372036854775807; pub const UINT_FAST8_MAX: u32 = 255; pub const UINT_FAST16_MAX: i32 = -1; pub const UINT_FAST32_MAX: i32 = -1; pub const INTPTR_MIN: i64 = -9223372036854775808; pub const INTPTR_MAX: u64 = 9223372036854775807; pub const UINTPTR_MAX: i32 = -1; pub const PTRDIFF_MIN: i64 = -9223372036854775808; pub const PTRDIFF_MAX: u64 = 9223372036854775807; pub const SIG_ATOMIC_MIN: i32 = -2147483648; pub const SIG_ATOMIC_MAX: u32 = 2147483647; pub const SIZE_MAX: i32 = -1; pub const WINT_MIN: u32 = 0; pub const WINT_MAX: u32 = 4294967295; pub const __bool_true_false_are_defined: u32 = 1; pub const true_: u32 = 1; pub const false_: u32 = 0; pub const RSMI_MAX_NUM_FREQUENCIES: u32 = 33; pub const RSMI_MAX_FAN_SPEED: u32 = 255; pub const RSMI_NUM_VOLTAGE_CURVE_POINTS: u32 = 3; pub const RSMI_MAX_NUM_PM_POLICIES: u32 = 32; pub const RSMI_MAX_POLICY_NAME: u32 = 32; pub const MAX_EVENT_NOTIFICATION_MSG_SIZE: u32 = 96; pub const CPU_NODE_INDEX: u32 = 4294967295; pub const RSMI_MAX_UTILIZATION_VALUES: u32 = 4; pub const RSMI_MAX_CACHE_TYPES: u32 = 10; pub const CENTRIGRADE_TO_MILLI_CENTIGRADE: u32 = 1000; pub const RSMI_NUM_HBM_INSTANCES: u32 = 4; pub const RSMI_MAX_NUM_VCNS: u32 = 4; pub const RSMI_MAX_NUM_JPEG_ENGS: u32 = 32; pub const RSMI_MAX_NUM_CLKS: u32 = 4; pub const RSMI_MAX_NUM_XGMI_LINKS: u32 = 8; pub const RSMI_MAX_NUM_GFX_CLKS: u32 = 8; pub const RSMI_MAX_NUM_XCC: u32 = 8; pub const RSMI_MAX_NUM_XCP: u32 = 8; pub const MAX_RSMI_NAME_LENGTH: u32 = 64; pub const CU_OCCUPANCY_INVALID: u32 = 4294967295; pub const MAX_UMC_CHAN_NUM: u32 = 32; pub const MAX_XHCL_LINK_NUM: u32 = 7; pub const RSMI_MAX_SE_CNT: u32 = 8; pub const RSMI_DEFAULT_VARIANT: i32 = -1; pub type __u_char = ::std::os::raw::c_uchar; pub type __u_short = ::std::os::raw::c_ushort; pub type __u_int = ::std::os::raw::c_uint; pub type __u_long = ::std::os::raw::c_ulong; pub type __int8_t = ::std::os::raw::c_schar; pub type __uint8_t = ::std::os::raw::c_uchar; pub type __int16_t = ::std::os::raw::c_short; pub type __uint16_t = ::std::os::raw::c_ushort; pub type __int32_t = ::std::os::raw::c_int; pub type __uint32_t = ::std::os::raw::c_uint; pub type __int64_t = ::std::os::raw::c_long; pub type __uint64_t = ::std::os::raw::c_ulong; pub type __int_least8_t = __int8_t; pub type __uint_least8_t = __uint8_t; pub type __int_least16_t = __int16_t; pub type __uint_least16_t = __uint16_t; pub type __int_least32_t = __int32_t; pub type __uint_least32_t = __uint32_t; pub type __int_least64_t = __int64_t; pub type __uint_least64_t = __uint64_t; pub type __quad_t = ::std::os::raw::c_long; pub type __u_quad_t = ::std::os::raw::c_ulong; pub type __intmax_t = ::std::os::raw::c_long; pub type __uintmax_t = ::std::os::raw::c_ulong; pub type __dev_t = ::std::os::raw::c_ulong; pub type __uid_t = ::std::os::raw::c_uint; pub type __gid_t = ::std::os::raw::c_uint; pub type __ino_t = ::std::os::raw::c_ulong; pub type __ino64_t = ::std::os::raw::c_ulong; pub type __mode_t = ::std::os::raw::c_uint; pub type __nlink_t = ::std::os::raw::c_ulong; pub type __off_t = ::std::os::raw::c_long; pub type __off64_t = ::std::os::raw::c_long; pub type __pid_t = ::std::os::raw::c_int; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __fsid_t { pub __val: [::std::os::raw::c_int; 2usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of __fsid_t"][::std::mem::size_of::<__fsid_t>() - 8usize]; ["Alignment of __fsid_t"][::std::mem::align_of::<__fsid_t>() - 4usize]; ["Offset of field: __fsid_t::__val"][::std::mem::offset_of!(__fsid_t, __val) - 0usize]; }; pub type __clock_t = ::std::os::raw::c_long; pub type __rlim_t = ::std::os::raw::c_ulong; pub type __rlim64_t = ::std::os::raw::c_ulong; pub type __id_t = ::std::os::raw::c_uint; pub type __time_t = ::std::os::raw::c_long; pub type __useconds_t = ::std::os::raw::c_uint; pub type __suseconds_t = ::std::os::raw::c_long; pub type __daddr_t = ::std::os::raw::c_int; pub type __key_t = ::std::os::raw::c_int; pub type __clockid_t = ::std::os::raw::c_int; pub type __timer_t = *mut ::std::os::raw::c_void; pub type __blksize_t = ::std::os::raw::c_long; pub type __blkcnt_t = ::std::os::raw::c_long; pub type __blkcnt64_t = ::std::os::raw::c_long; pub type __fsblkcnt_t = ::std::os::raw::c_ulong; pub type __fsblkcnt64_t = ::std::os::raw::c_ulong; pub type __fsfilcnt_t = ::std::os::raw::c_ulong; pub type __fsfilcnt64_t = ::std::os::raw::c_ulong; pub type __fsword_t = ::std::os::raw::c_long; pub type __ssize_t = ::std::os::raw::c_long; pub type __syscall_slong_t = ::std::os::raw::c_long; pub type __syscall_ulong_t = ::std::os::raw::c_ulong; pub type __loff_t = __off64_t; pub type __caddr_t = *mut ::std::os::raw::c_char; pub type __intptr_t = ::std::os::raw::c_long; pub type __socklen_t = ::std::os::raw::c_uint; pub type __sig_atomic_t = ::std::os::raw::c_int; pub type int_least8_t = __int_least8_t; pub type int_least16_t = __int_least16_t; pub type int_least32_t = __int_least32_t; pub type int_least64_t = __int_least64_t; pub type uint_least8_t = __uint_least8_t; pub type uint_least16_t = __uint_least16_t; pub type uint_least32_t = __uint_least32_t; pub type uint_least64_t = __uint_least64_t; pub type int_fast8_t = ::std::os::raw::c_schar; pub type int_fast16_t = ::std::os::raw::c_long; pub type int_fast32_t = ::std::os::raw::c_long; pub type int_fast64_t = ::std::os::raw::c_long; pub type uint_fast8_t = ::std::os::raw::c_uchar; pub type uint_fast16_t = ::std::os::raw::c_ulong; pub type uint_fast32_t = ::std::os::raw::c_ulong; pub type uint_fast64_t = ::std::os::raw::c_ulong; pub type intmax_t = __intmax_t; pub type uintmax_t = __uintmax_t; pub type wchar_t = ::std::os::raw::c_int; #[repr(C)] #[repr(align(16))] #[derive(Debug, Copy, Clone)] pub struct max_align_t { pub __clang_max_align_nonce1: ::std::os::raw::c_longlong, pub __bindgen_padding_0: u64, pub __clang_max_align_nonce2: u128, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of max_align_t"][::std::mem::size_of::() - 32usize]; ["Alignment of max_align_t"][::std::mem::align_of::() - 16usize]; ["Offset of field: max_align_t::__clang_max_align_nonce1"] [::std::mem::offset_of!(max_align_t, __clang_max_align_nonce1) - 0usize]; ["Offset of field: max_align_t::__clang_max_align_nonce2"] [::std::mem::offset_of!(max_align_t, __clang_max_align_nonce2) - 16usize]; }; #[doc = "!< Operation was successful"] pub const rsmi_status_t_RSMI_STATUS_SUCCESS: rsmi_status_t = 0; #[doc = "!< Passed in arguments are not valid"] pub const rsmi_status_t_RSMI_STATUS_INVALID_ARGS: rsmi_status_t = 1; #[doc = "!< The requested information or\n!< action is not available for the\n!< given input, on the given system"] pub const rsmi_status_t_RSMI_STATUS_NOT_SUPPORTED: rsmi_status_t = 2; #[doc = "!< Problem accessing a file. This\n!< may because the operation is not\n!< supported by the Linux kernel\n!< version running on the executing\n!< machine"] pub const rsmi_status_t_RSMI_STATUS_FILE_ERROR: rsmi_status_t = 3; #[doc = "!< Permission denied/EACCESS file\n!< error. Many functions require\n!< root access to run."] pub const rsmi_status_t_RSMI_STATUS_PERMISSION: rsmi_status_t = 4; #[doc = "!< Unable to acquire memory or other\n!< resource"] pub const rsmi_status_t_RSMI_STATUS_OUT_OF_RESOURCES: rsmi_status_t = 5; #[doc = "!< An internal exception was caught"] pub const rsmi_status_t_RSMI_STATUS_INTERNAL_EXCEPTION: rsmi_status_t = 6; #[doc = "!< The provided input is out of\n!< allowable or safe range"] pub const rsmi_status_t_RSMI_STATUS_INPUT_OUT_OF_BOUNDS: rsmi_status_t = 7; #[doc = "!< An error occurred when rsmi\n!< initializing internal data\n!< structures"] pub const rsmi_status_t_RSMI_STATUS_INIT_ERROR: rsmi_status_t = 8; pub const rsmi_status_t_RSMI_INITIALIZATION_ERROR: rsmi_status_t = 8; #[doc = "!< The requested function has not\n!< yet been implemented in the\n!< current system for the current\n!< devices"] pub const rsmi_status_t_RSMI_STATUS_NOT_YET_IMPLEMENTED: rsmi_status_t = 9; #[doc = "!< An item was searched for but not\n!< found"] pub const rsmi_status_t_RSMI_STATUS_NOT_FOUND: rsmi_status_t = 10; #[doc = "!< Not enough resources were\n!< available for the operation"] pub const rsmi_status_t_RSMI_STATUS_INSUFFICIENT_SIZE: rsmi_status_t = 11; #[doc = "!< An interrupt occurred during\n!< execution of function"] pub const rsmi_status_t_RSMI_STATUS_INTERRUPT: rsmi_status_t = 12; #[doc = "!< An unexpected amount of data\n!< was read"] pub const rsmi_status_t_RSMI_STATUS_UNEXPECTED_SIZE: rsmi_status_t = 13; #[doc = "!< No data was found for a given\n!< input"] pub const rsmi_status_t_RSMI_STATUS_NO_DATA: rsmi_status_t = 14; #[doc = "!< The data read or provided to\n!< function is not what was expected"] pub const rsmi_status_t_RSMI_STATUS_UNEXPECTED_DATA: rsmi_status_t = 15; #[doc = "!< A resource or mutex could not be\n!< acquired because it is already\n!< being used"] pub const rsmi_status_t_RSMI_STATUS_BUSY: rsmi_status_t = 16; #[doc = "!< An internal reference counter\n!< exceeded INT32_MAX"] pub const rsmi_status_t_RSMI_STATUS_REFCOUNT_OVERFLOW: rsmi_status_t = 17; #[doc = "!< Requested setting is unavailable\n!< for the current device"] pub const rsmi_status_t_RSMI_STATUS_SETTING_UNAVAILABLE: rsmi_status_t = 18; #[doc = "!< Could not successfully restart\n!< the gpu driver"] pub const rsmi_status_t_RSMI_STATUS_GPU_RESTART_ERR: rsmi_status_t = 19; pub const rsmi_status_t_RSMI_STATUS_NO_DEVICE: rsmi_status_t = 20; #[doc = "!< An unknown error occurred"] pub const rsmi_status_t_RSMI_STATUS_UNKNOWN_ERROR: rsmi_status_t = 4294967295; #[doc = " @brief Error codes retured by rocm_smi_lib functions"] pub type rsmi_status_t = ::std::os::raw::c_uint; #[doc = "!< Attempt to add all GPUs found\n!< (including non-) to the list\n!< of devices from which SMI\n!< information can be retrieved. By\n!< default, only devices are\n!< enumerated by RSMI."] pub const rsmi_init_flags_t_RSMI_INIT_FLAG_ALL_GPUS: rsmi_init_flags_t = 1; #[doc = "!< No mutex"] pub const rsmi_init_flags_t_RSMI_INIT_FLAG_NO_MUTEX: rsmi_init_flags_t = 144115188075855872; #[doc = "!< The mutex limit to thread"] pub const rsmi_init_flags_t_RSMI_INIT_FLAG_THRAD_ONLY_MUTEX: rsmi_init_flags_t = 288230376151711744; #[doc = "!< Reserved for test"] pub const rsmi_init_flags_t_RSMI_INIT_FLAG_RESRV_TEST1: rsmi_init_flags_t = 576460752303423488; #[doc = " @brief Initialization flags\n\n Initialization flags may be OR'd together and passed to ::rsmi_init()."] pub type rsmi_init_flags_t = ::std::os::raw::c_ulong; #[doc = "!< Cannot find the driver"] pub const rsmi_driver_state_t_RSMI_DRIVER_NOT_FOUND: rsmi_driver_state_t = 0; #[doc = "!< Driver loaded and live"] pub const rsmi_driver_state_t_RSMI_DRIVER_MODULE_STATE_LIVE: rsmi_driver_state_t = 1; #[doc = "!< Driver is loading(coming)"] pub const rsmi_driver_state_t_RSMI_DRIVER_MODULE_STATE_LOADING: rsmi_driver_state_t = 2; #[doc = "!< Driver is unloading(going)"] pub const rsmi_driver_state_t_RSMI_DRIVER_MODULE_STATE_UNLOADING: rsmi_driver_state_t = 3; #[doc = "!< Driver state unknown"] pub const rsmi_driver_state_t_RSMI_DRIVER_MODULE_STATE_UNKNOWN: rsmi_driver_state_t = 4; #[doc = " @brief Driver loading status\n\n The driver loading status from initState sysfs"] pub type rsmi_driver_state_t = ::std::os::raw::c_uint; #[doc = "!< Performance level is \"auto\""] pub const rsmi_dev_perf_level_t_RSMI_DEV_PERF_LEVEL_AUTO: rsmi_dev_perf_level_t = 0; pub const rsmi_dev_perf_level_t_RSMI_DEV_PERF_LEVEL_FIRST: rsmi_dev_perf_level_t = 0; #[doc = "!< Keep PowerPlay levels \"low\",\n!< regardless of workload"] pub const rsmi_dev_perf_level_t_RSMI_DEV_PERF_LEVEL_LOW: rsmi_dev_perf_level_t = 1; #[doc = "!< Keep PowerPlay levels \"high\",\n!< regardless of workload"] pub const rsmi_dev_perf_level_t_RSMI_DEV_PERF_LEVEL_HIGH: rsmi_dev_perf_level_t = 2; #[doc = "!< Only use values defined by manually\n!< setting the RSMI_CLK_TYPE_SYS speed"] pub const rsmi_dev_perf_level_t_RSMI_DEV_PERF_LEVEL_MANUAL: rsmi_dev_perf_level_t = 3; #[doc = "!< Stable power state with profiling\n!< clocks"] pub const rsmi_dev_perf_level_t_RSMI_DEV_PERF_LEVEL_STABLE_STD: rsmi_dev_perf_level_t = 4; #[doc = "!< Stable power state with peak clocks"] pub const rsmi_dev_perf_level_t_RSMI_DEV_PERF_LEVEL_STABLE_PEAK: rsmi_dev_perf_level_t = 5; #[doc = "!< Stable power state with minimum\n!< memory clock"] pub const rsmi_dev_perf_level_t_RSMI_DEV_PERF_LEVEL_STABLE_MIN_MCLK: rsmi_dev_perf_level_t = 6; #[doc = "!< Stable power state with minimum\n!< system clock"] pub const rsmi_dev_perf_level_t_RSMI_DEV_PERF_LEVEL_STABLE_MIN_SCLK: rsmi_dev_perf_level_t = 7; #[doc = "!< Performance determinism state"] pub const rsmi_dev_perf_level_t_RSMI_DEV_PERF_LEVEL_DETERMINISM: rsmi_dev_perf_level_t = 8; pub const rsmi_dev_perf_level_t_RSMI_DEV_PERF_LEVEL_LAST: rsmi_dev_perf_level_t = 8; #[doc = "!< Unknown performance level"] pub const rsmi_dev_perf_level_t_RSMI_DEV_PERF_LEVEL_UNKNOWN: rsmi_dev_perf_level_t = 256; #[doc = " @brief PowerPlay performance levels"] pub type rsmi_dev_perf_level_t = ::std::os::raw::c_uint; #[doc = " @brief The dpm policy."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct rsmi_dpm_policy_entry_t { pub policy_id: u32, pub policy_description: [::std::os::raw::c_char; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rsmi_dpm_policy_entry_t"][::std::mem::size_of::() - 36usize]; ["Alignment of rsmi_dpm_policy_entry_t"] [::std::mem::align_of::() - 4usize]; ["Offset of field: rsmi_dpm_policy_entry_t::policy_id"] [::std::mem::offset_of!(rsmi_dpm_policy_entry_t, policy_id) - 0usize]; ["Offset of field: rsmi_dpm_policy_entry_t::policy_description"] [::std::mem::offset_of!(rsmi_dpm_policy_entry_t, policy_description) - 4usize]; }; #[doc = " @brief This structure holds information about dpm policies."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct rsmi_dpm_policy_t { #[doc = " The number of supported policies"] pub num_supported: u32, #[doc = " The current policy index"] pub current: u32, #[doc = " List of policies.\n Only the first num_supported policies are valid."] pub policies: [rsmi_dpm_policy_entry_t; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rsmi_dpm_policy_t"][::std::mem::size_of::() - 1160usize]; ["Alignment of rsmi_dpm_policy_t"][::std::mem::align_of::() - 4usize]; ["Offset of field: rsmi_dpm_policy_t::num_supported"] [::std::mem::offset_of!(rsmi_dpm_policy_t, num_supported) - 0usize]; ["Offset of field: rsmi_dpm_policy_t::current"] [::std::mem::offset_of!(rsmi_dpm_policy_t, current) - 4usize]; ["Offset of field: rsmi_dpm_policy_t::policies"] [::std::mem::offset_of!(rsmi_dpm_policy_t, policies) - 8usize]; }; #[doc = " \\cond Ignore in docs."] pub use self::rsmi_dev_perf_level_t as rsmi_dev_perf_level; pub const rsmi_sw_component_t_RSMI_SW_COMP_FIRST: rsmi_sw_component_t = 0; #[doc = "!< Driver"] pub const rsmi_sw_component_t_RSMI_SW_COMP_DRIVER: rsmi_sw_component_t = 0; pub const rsmi_sw_component_t_RSMI_SW_COMP_LAST: rsmi_sw_component_t = 0; #[doc = " @brief Software components"] pub type rsmi_sw_component_t = ::std::os::raw::c_uint; #[doc = " @brief Handle to performance event counter"] pub type rsmi_event_handle_t = usize; #[doc = "!< Data Fabric (XGMI) related events"] pub const rsmi_event_group_t_RSMI_EVNT_GRP_XGMI: rsmi_event_group_t = 0; #[doc = "!< XGMI Outbound data"] pub const rsmi_event_group_t_RSMI_EVNT_GRP_XGMI_DATA_OUT: rsmi_event_group_t = 10; pub const rsmi_event_group_t_RSMI_EVNT_GRP_INVALID: rsmi_event_group_t = 4294967295; #[doc = " Event Groups\n\n @brief Enum denoting an event group. The value of the enum is the\n base value for all the event enums in the group."] pub type rsmi_event_group_t = ::std::os::raw::c_uint; pub const rsmi_event_type_t_RSMI_EVNT_FIRST: rsmi_event_type_t = 0; pub const rsmi_event_type_t_RSMI_EVNT_XGMI_FIRST: rsmi_event_type_t = 0; #[doc = "!< NOPs sent to neighbor 0"] pub const rsmi_event_type_t_RSMI_EVNT_XGMI_0_NOP_TX: rsmi_event_type_t = 0; #[doc = "!< Outgoing requests to\n!< neighbor 0"] pub const rsmi_event_type_t_RSMI_EVNT_XGMI_0_REQUEST_TX: rsmi_event_type_t = 1; #[doc = "!< Outgoing responses to\n!< neighbor 0"] pub const rsmi_event_type_t_RSMI_EVNT_XGMI_0_RESPONSE_TX: rsmi_event_type_t = 2; #[doc = " @brief\n\n Data beats sent to neighbor 0; Each beat represents 32 bytes.

\n\n XGMI throughput can be calculated by multiplying a BEATs event\n such as ::RSMI_EVNT_XGMI_0_BEATS_TX by 32 and dividing by\n the time for which event collection occurred,\n ::rsmi_counter_value_t.time_running (which is in nanoseconds). To get\n bytes per second, multiply this value by 109.
\n
\n Throughput = BEATS/time_running * 109 (bytes/second)
"] pub const rsmi_event_type_t_RSMI_EVNT_XGMI_0_BEATS_TX: rsmi_event_type_t = 3; #[doc = "!< NOPs sent to neighbor 1"] pub const rsmi_event_type_t_RSMI_EVNT_XGMI_1_NOP_TX: rsmi_event_type_t = 4; #[doc = "!< Outgoing requests to\n!< neighbor 1"] pub const rsmi_event_type_t_RSMI_EVNT_XGMI_1_REQUEST_TX: rsmi_event_type_t = 5; #[doc = "!< Outgoing responses to\n!< neighbor 1"] pub const rsmi_event_type_t_RSMI_EVNT_XGMI_1_RESPONSE_TX: rsmi_event_type_t = 6; #[doc = "!< Data beats sent to\n!< neighbor 1; Each beat\n!< represents 32 bytes"] pub const rsmi_event_type_t_RSMI_EVNT_XGMI_1_BEATS_TX: rsmi_event_type_t = 7; pub const rsmi_event_type_t_RSMI_EVNT_XGMI_LAST: rsmi_event_type_t = 7; pub const rsmi_event_type_t_RSMI_EVNT_XGMI_DATA_OUT_FIRST: rsmi_event_type_t = 10; pub const rsmi_event_type_t_RSMI_EVNT_XGMI_DATA_OUT_0: rsmi_event_type_t = 10; #[doc = "!< Outbound beats to neighbor 1"] pub const rsmi_event_type_t_RSMI_EVNT_XGMI_DATA_OUT_1: rsmi_event_type_t = 11; #[doc = "!< Outbound beats to neighbor 2"] pub const rsmi_event_type_t_RSMI_EVNT_XGMI_DATA_OUT_2: rsmi_event_type_t = 12; #[doc = "!< Outbound beats to neighbor 3"] pub const rsmi_event_type_t_RSMI_EVNT_XGMI_DATA_OUT_3: rsmi_event_type_t = 13; #[doc = "!< Outbound beats to neighbor 4"] pub const rsmi_event_type_t_RSMI_EVNT_XGMI_DATA_OUT_4: rsmi_event_type_t = 14; #[doc = "!< Outbound beats to neighbor 5"] pub const rsmi_event_type_t_RSMI_EVNT_XGMI_DATA_OUT_5: rsmi_event_type_t = 15; pub const rsmi_event_type_t_RSMI_EVNT_XGMI_DATA_OUT_LAST: rsmi_event_type_t = 15; pub const rsmi_event_type_t_RSMI_EVNT_LAST: rsmi_event_type_t = 15; #[doc = " Event types\n @brief Event type enum. Events belonging to a particular event group\n ::rsmi_event_group_t should begin enumerating at the ::rsmi_event_group_t\n value for that group."] pub type rsmi_event_type_t = ::std::os::raw::c_uint; #[doc = "!< Start the counter"] pub const rsmi_counter_command_t_RSMI_CNTR_CMD_START: rsmi_counter_command_t = 0; #[doc = "!< Stop the counter; note that this should not\n!< be used before reading."] pub const rsmi_counter_command_t_RSMI_CNTR_CMD_STOP: rsmi_counter_command_t = 1; #[doc = " Event counter commands"] pub type rsmi_counter_command_t = ::std::os::raw::c_uint; #[doc = " Counter value"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct rsmi_counter_value_t { #[doc = "!< Counter value"] pub value: u64, #[doc = "!< Time that the counter was enabled\n!< (in nanoseconds)"] pub time_enabled: u64, #[doc = "!< Time that the counter was running\n!< (in nanoseconds)"] pub time_running: u64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rsmi_counter_value_t"][::std::mem::size_of::() - 24usize]; ["Alignment of rsmi_counter_value_t"][::std::mem::align_of::() - 8usize]; ["Offset of field: rsmi_counter_value_t::value"] [::std::mem::offset_of!(rsmi_counter_value_t, value) - 0usize]; ["Offset of field: rsmi_counter_value_t::time_enabled"] [::std::mem::offset_of!(rsmi_counter_value_t, time_enabled) - 8usize]; ["Offset of field: rsmi_counter_value_t::time_running"] [::std::mem::offset_of!(rsmi_counter_value_t, time_running) - 16usize]; }; pub const kfd_smi_event_KFD_SMI_EVENT_NONE: kfd_smi_event = 0; pub const kfd_smi_event_KFD_SMI_EVENT_VMFAULT: kfd_smi_event = 1; pub const kfd_smi_event_KFD_SMI_EVENT_THERMAL_THROTTLE: kfd_smi_event = 2; pub const kfd_smi_event_KFD_SMI_EVENT_GPU_PRE_RESET: kfd_smi_event = 3; pub const kfd_smi_event_KFD_SMI_EVENT_GPU_POST_RESET: kfd_smi_event = 4; pub const kfd_smi_event_KFD_SMI_EVENT_MIGRATE_START: kfd_smi_event = 5; pub const kfd_smi_event_KFD_SMI_EVENT_MIGRATE_END: kfd_smi_event = 6; pub const kfd_smi_event_KFD_SMI_EVENT_PAGE_FAULT_START: kfd_smi_event = 7; pub const kfd_smi_event_KFD_SMI_EVENT_PAGE_FAULT_END: kfd_smi_event = 8; pub const kfd_smi_event_KFD_SMI_EVENT_QUEUE_EVICTION: kfd_smi_event = 9; pub const kfd_smi_event_KFD_SMI_EVENT_QUEUE_RESTORE: kfd_smi_event = 10; pub const kfd_smi_event_KFD_SMI_EVENT_UNMAP_FROM_GPU: kfd_smi_event = 11; pub const kfd_smi_event_KFD_SMI_EVENT_ALL_PROCESS: kfd_smi_event = 64; pub type kfd_smi_event = ::std::os::raw::c_uint; #[doc = "!< Unused"] pub const rsmi_evt_notification_type_t_RSMI_EVT_NOTIF_NONE: rsmi_evt_notification_type_t = 0; #[doc = "!< VM page fault"] pub const rsmi_evt_notification_type_t_RSMI_EVT_NOTIF_VMFAULT: rsmi_evt_notification_type_t = 1; pub const rsmi_evt_notification_type_t_RSMI_EVT_NOTIF_FIRST: rsmi_evt_notification_type_t = 1; pub const rsmi_evt_notification_type_t_RSMI_EVT_NOTIF_THERMAL_THROTTLE: rsmi_evt_notification_type_t = 2; pub const rsmi_evt_notification_type_t_RSMI_EVT_NOTIF_GPU_PRE_RESET: rsmi_evt_notification_type_t = 3; pub const rsmi_evt_notification_type_t_RSMI_EVT_NOTIF_GPU_POST_RESET: rsmi_evt_notification_type_t = 4; pub const rsmi_evt_notification_type_t_RSMI_EVT_NOTIF_EVENT_MIGRATE_START: rsmi_evt_notification_type_t = 5; pub const rsmi_evt_notification_type_t_RSMI_EVT_NOTIF_EVENT_MIGRATE_END: rsmi_evt_notification_type_t = 6; pub const rsmi_evt_notification_type_t_RSMI_EVT_NOTIF_EVENT_PAGE_FAULT_START: rsmi_evt_notification_type_t = 7; pub const rsmi_evt_notification_type_t_RSMI_EVT_NOTIF_EVENT_PAGE_FAULT_END: rsmi_evt_notification_type_t = 8; pub const rsmi_evt_notification_type_t_RSMI_EVT_NOTIF_EVENT_QUEUE_EVICTION: rsmi_evt_notification_type_t = 9; pub const rsmi_evt_notification_type_t_RSMI_EVT_NOTIF_EVENT_QUEUE_RESTORE: rsmi_evt_notification_type_t = 10; pub const rsmi_evt_notification_type_t_RSMI_EVT_NOTIF_EVENT_UNMAP_FROM_GPU: rsmi_evt_notification_type_t = 11; pub const rsmi_evt_notification_type_t_RSMI_EVT_NOTIF_EVENT_ALL_PROCESS: rsmi_evt_notification_type_t = 64; pub const rsmi_evt_notification_type_t_RSMI_EVT_NOTIF_LAST: rsmi_evt_notification_type_t = 64; #[doc = " Event notification event types"] pub type rsmi_evt_notification_type_t = ::std::os::raw::c_uint; #[doc = " Event notification data returned from event notification API"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct rsmi_evt_notification_data_t { #[doc = "!< Index of device that corresponds to the event"] pub dv_ind: u32, #[doc = "!< Event type"] pub event: rsmi_evt_notification_type_t, #[doc = "!< Event message"] pub message: [::std::os::raw::c_char; 96usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rsmi_evt_notification_data_t"] [::std::mem::size_of::() - 104usize]; ["Alignment of rsmi_evt_notification_data_t"] [::std::mem::align_of::() - 4usize]; ["Offset of field: rsmi_evt_notification_data_t::dv_ind"] [::std::mem::offset_of!(rsmi_evt_notification_data_t, dv_ind) - 0usize]; ["Offset of field: rsmi_evt_notification_data_t::event"] [::std::mem::offset_of!(rsmi_evt_notification_data_t, event) - 4usize]; ["Offset of field: rsmi_evt_notification_data_t::message"] [::std::mem::offset_of!(rsmi_evt_notification_data_t, message) - 8usize]; }; #[doc = "!< System clock"] pub const rsmi_clk_type_t_RSMI_CLK_TYPE_SYS: rsmi_clk_type_t = 0; pub const rsmi_clk_type_t_RSMI_CLK_TYPE_FIRST: rsmi_clk_type_t = 0; #[doc = "!< Data Fabric clock (for ASICs\n!< running on a separate clock)"] pub const rsmi_clk_type_t_RSMI_CLK_TYPE_DF: rsmi_clk_type_t = 1; #[doc = "!< Display Controller Engine clock"] pub const rsmi_clk_type_t_RSMI_CLK_TYPE_DCEF: rsmi_clk_type_t = 2; #[doc = "!< SOC clock"] pub const rsmi_clk_type_t_RSMI_CLK_TYPE_SOC: rsmi_clk_type_t = 3; #[doc = "!< Memory clock"] pub const rsmi_clk_type_t_RSMI_CLK_TYPE_MEM: rsmi_clk_type_t = 4; #[doc = "!< PCIE clock"] pub const rsmi_clk_type_t_RSMI_CLK_TYPE_PCIE: rsmi_clk_type_t = 5; pub const rsmi_clk_type_t_RSMI_CLK_TYPE_LAST: rsmi_clk_type_t = 4; pub const rsmi_clk_type_t_RSMI_CLK_INVALID: rsmi_clk_type_t = 4294967295; #[doc = " Clock types"] pub type rsmi_clk_type_t = ::std::os::raw::c_uint; #[doc = " \\cond Ignore in docs."] pub use self::rsmi_clk_type_t as rsmi_clk_type; pub const rsmi_compute_partition_type_t_RSMI_COMPUTE_PARTITION_INVALID: rsmi_compute_partition_type_t = 0; #[doc = "!< Single GPU mode (SPX)- All XCCs work\n!< together with shared memory"] pub const rsmi_compute_partition_type_t_RSMI_COMPUTE_PARTITION_SPX: rsmi_compute_partition_type_t = 1; #[doc = "!< Dual GPU mode (DPX)- Half XCCs work\n!< together with shared memory"] pub const rsmi_compute_partition_type_t_RSMI_COMPUTE_PARTITION_DPX: rsmi_compute_partition_type_t = 2; #[doc = "!< Triple GPU mode (TPX)- One-third XCCs\n!< work together with shared memory"] pub const rsmi_compute_partition_type_t_RSMI_COMPUTE_PARTITION_TPX: rsmi_compute_partition_type_t = 3; #[doc = "!< Quad GPU mode (QPX)- Quarter XCCs\n!< work together with shared memory"] pub const rsmi_compute_partition_type_t_RSMI_COMPUTE_PARTITION_QPX: rsmi_compute_partition_type_t = 4; #[doc = "!< Core mode (CPX)- Per-chip XCC with\n!< shared memory"] pub const rsmi_compute_partition_type_t_RSMI_COMPUTE_PARTITION_CPX: rsmi_compute_partition_type_t = 5; #[doc = " @brief Compute Partition. This enum is used to identify\n various compute partitioning settings."] pub type rsmi_compute_partition_type_t = ::std::os::raw::c_uint; #[doc = " \\cond Ignore in docs."] pub use self::rsmi_compute_partition_type_t as rsmi_compute_partition_type; pub const rsmi_memory_partition_type_t_RSMI_MEMORY_PARTITION_UNKNOWN: rsmi_memory_partition_type_t = 0; #[doc = "!< NPS1 - All CCD & XCD data is interleaved\n!< accross all 8 HBM stacks (all stacks/1)."] pub const rsmi_memory_partition_type_t_RSMI_MEMORY_PARTITION_NPS1: rsmi_memory_partition_type_t = 1; #[doc = "!< NPS2 - 2 sets of CCDs or 4 XCD interleaved\n!< accross the 4 HBM stacks per AID pair\n!< (8 stacks/2)."] pub const rsmi_memory_partition_type_t_RSMI_MEMORY_PARTITION_NPS2: rsmi_memory_partition_type_t = 2; #[doc = "!< NPS4 - Each XCD data is interleaved accross\n!< accross 2 (or single) HBM stacks\n!< (8 stacks/8 or 8 stacks/4)."] pub const rsmi_memory_partition_type_t_RSMI_MEMORY_PARTITION_NPS4: rsmi_memory_partition_type_t = 3; #[doc = "!< NPS8 - Each XCD uses a single HBM stack\n!< (8 stacks/8). Or each XCD uses a single\n!< HBM stack & CCDs share 2 non-interleaved\n!< HBM stacks on its AID\n!< (AID[1,2,3] = 6 stacks/6)."] pub const rsmi_memory_partition_type_t_RSMI_MEMORY_PARTITION_NPS8: rsmi_memory_partition_type_t = 4; #[doc = " @brief Memory Partitions. This enum is used to identify various\n memory partition types."] pub type rsmi_memory_partition_type_t = ::std::os::raw::c_uint; #[doc = " \\cond Ignore in docs."] pub use self::rsmi_memory_partition_type_t as rsmi_memory_partition_type; #[doc = "!< Temperature current value."] pub const rsmi_temperature_metric_t_RSMI_TEMP_CURRENT: rsmi_temperature_metric_t = 0; pub const rsmi_temperature_metric_t_RSMI_TEMP_FIRST: rsmi_temperature_metric_t = 0; #[doc = "!< Temperature max value."] pub const rsmi_temperature_metric_t_RSMI_TEMP_MAX: rsmi_temperature_metric_t = 1; #[doc = "!< Temperature min value."] pub const rsmi_temperature_metric_t_RSMI_TEMP_MIN: rsmi_temperature_metric_t = 2; #[doc = "!< Temperature hysteresis value for max limit.\n!< (This is an absolute temperature, not a\n!< delta)."] pub const rsmi_temperature_metric_t_RSMI_TEMP_MAX_HYST: rsmi_temperature_metric_t = 3; #[doc = "!< Temperature hysteresis value for min limit.\n!< (This is an absolute temperature,\n!< not a delta)."] pub const rsmi_temperature_metric_t_RSMI_TEMP_MIN_HYST: rsmi_temperature_metric_t = 4; #[doc = "!< Temperature critical max value, typically\n!< greater than corresponding temp_max values."] pub const rsmi_temperature_metric_t_RSMI_TEMP_CRITICAL: rsmi_temperature_metric_t = 5; #[doc = "!< Temperature hysteresis value for critical\n!< limit. (This is an absolute temperature,\n!< not a delta)."] pub const rsmi_temperature_metric_t_RSMI_TEMP_CRITICAL_HYST: rsmi_temperature_metric_t = 6; #[doc = "!< Temperature emergency max value, for chips\n!< supporting more than two upper temperature\n!< limits. Must be equal or greater than\n!< corresponding temp_crit values."] pub const rsmi_temperature_metric_t_RSMI_TEMP_EMERGENCY: rsmi_temperature_metric_t = 7; #[doc = "!< Temperature hysteresis value for emergency\n!< limit. (This is an absolute temperature,\n!< not a delta)."] pub const rsmi_temperature_metric_t_RSMI_TEMP_EMERGENCY_HYST: rsmi_temperature_metric_t = 8; #[doc = "!< Temperature critical min value, typically\n!< lower than corresponding temperature\n!< minimum values."] pub const rsmi_temperature_metric_t_RSMI_TEMP_CRIT_MIN: rsmi_temperature_metric_t = 9; #[doc = "!< Temperature hysteresis value for critical\n!< minimum limit. (This is an absolute\n!< temperature, not a delta)."] pub const rsmi_temperature_metric_t_RSMI_TEMP_CRIT_MIN_HYST: rsmi_temperature_metric_t = 10; #[doc = "!< Temperature offset which is added to the"] pub const rsmi_temperature_metric_t_RSMI_TEMP_OFFSET: rsmi_temperature_metric_t = 11; #[doc = "!< Historical minimum temperature."] pub const rsmi_temperature_metric_t_RSMI_TEMP_LOWEST: rsmi_temperature_metric_t = 12; #[doc = "!< Historical maximum temperature."] pub const rsmi_temperature_metric_t_RSMI_TEMP_HIGHEST: rsmi_temperature_metric_t = 13; pub const rsmi_temperature_metric_t_RSMI_TEMP_LAST: rsmi_temperature_metric_t = 13; #[doc = " @brief Temperature Metrics. This enum is used to identify various\n temperature metrics. Corresponding values will be in millidegress\n Celcius."] pub type rsmi_temperature_metric_t = ::std::os::raw::c_uint; #[doc = " \\cond Ignore in docs."] pub use self::rsmi_temperature_metric_t as rsmi_temperature_metric; pub const rsmi_temperature_type_t_RSMI_TEMP_TYPE_FIRST: rsmi_temperature_type_t = 0; #[doc = "!< Edge GPU temperature"] pub const rsmi_temperature_type_t_RSMI_TEMP_TYPE_EDGE: rsmi_temperature_type_t = 0; #[doc = "!< Junction/hotspot\n!< temperature"] pub const rsmi_temperature_type_t_RSMI_TEMP_TYPE_JUNCTION: rsmi_temperature_type_t = 1; #[doc = "!< VRAM temperature"] pub const rsmi_temperature_type_t_RSMI_TEMP_TYPE_MEMORY: rsmi_temperature_type_t = 2; pub const rsmi_temperature_type_t_RSMI_TEMP_TYPE_VR_GFX: rsmi_temperature_type_t = 3; pub const rsmi_temperature_type_t_RSMI_TEMP_TYPE_VR_SOC: rsmi_temperature_type_t = 4; pub const rsmi_temperature_type_t_RSMI_TEMP_TYPE_VR_MEM0: rsmi_temperature_type_t = 5; pub const rsmi_temperature_type_t_RSMI_TEMP_TYPE_VR_MEM1: rsmi_temperature_type_t = 6; #[doc = "!< HBM temperature instance 0"] pub const rsmi_temperature_type_t_RSMI_TEMP_TYPE_HBM_0: rsmi_temperature_type_t = 7; #[doc = "!< HBM temperature instance 1"] pub const rsmi_temperature_type_t_RSMI_TEMP_TYPE_HBM_1: rsmi_temperature_type_t = 8; #[doc = "!< HBM temperature instance 2"] pub const rsmi_temperature_type_t_RSMI_TEMP_TYPE_HBM_2: rsmi_temperature_type_t = 9; #[doc = "!< HBM temperature instance 3"] pub const rsmi_temperature_type_t_RSMI_TEMP_TYPE_HBM_3: rsmi_temperature_type_t = 10; pub const rsmi_temperature_type_t_RSMI_TEMP_TYPE_CORE: rsmi_temperature_type_t = 11; pub const rsmi_temperature_type_t_RSMI_TEMP_TYPE_LAST: rsmi_temperature_type_t = 11; #[doc = "!< Invalid type"] pub const rsmi_temperature_type_t_RSMI_TEMP_TYPE_INVALID: rsmi_temperature_type_t = 4294967295; #[doc = " @brief This enumeration is used to indicate from which part of the device a\n temperature reading should be obtained."] pub type rsmi_temperature_type_t = ::std::os::raw::c_uint; pub const rsmi_activity_metric_t_RSMI_ACTIVITY_GFX: rsmi_activity_metric_t = 1; #[doc = "!< memory controller"] pub const rsmi_activity_metric_t_RSMI_ACTIVITY_UMC: rsmi_activity_metric_t = 2; #[doc = "!< UVD or VCN"] pub const rsmi_activity_metric_t_RSMI_ACTIVITY_MM: rsmi_activity_metric_t = 4; #[doc = " @brief Activity (Utilization) Metrics. This enum is used to identify\n various activity metrics.\n"] pub type rsmi_activity_metric_t = ::std::os::raw::c_uint; #[doc = "!< Voltage current value."] pub const rsmi_voltage_metric_t_RSMI_VOLT_CURRENT: rsmi_voltage_metric_t = 0; pub const rsmi_voltage_metric_t_RSMI_VOLT_FIRST: rsmi_voltage_metric_t = 0; #[doc = "!< Voltage max value."] pub const rsmi_voltage_metric_t_RSMI_VOLT_MAX: rsmi_voltage_metric_t = 1; #[doc = "!< Voltage critical min value."] pub const rsmi_voltage_metric_t_RSMI_VOLT_MIN_CRIT: rsmi_voltage_metric_t = 2; #[doc = "!< Voltage min value."] pub const rsmi_voltage_metric_t_RSMI_VOLT_MIN: rsmi_voltage_metric_t = 3; #[doc = "!< Voltage critical max value."] pub const rsmi_voltage_metric_t_RSMI_VOLT_MAX_CRIT: rsmi_voltage_metric_t = 4; #[doc = "!< Average voltage."] pub const rsmi_voltage_metric_t_RSMI_VOLT_AVERAGE: rsmi_voltage_metric_t = 5; #[doc = "!< Historical minimum voltage."] pub const rsmi_voltage_metric_t_RSMI_VOLT_LOWEST: rsmi_voltage_metric_t = 6; #[doc = "!< Historical maximum voltage."] pub const rsmi_voltage_metric_t_RSMI_VOLT_HIGHEST: rsmi_voltage_metric_t = 7; pub const rsmi_voltage_metric_t_RSMI_VOLT_LAST: rsmi_voltage_metric_t = 7; #[doc = " @brief Voltage Metrics. This enum is used to identify various\n Volatge metrics. Corresponding values will be in millivolt.\n"] pub type rsmi_voltage_metric_t = ::std::os::raw::c_uint; pub const rsmi_voltage_type_t_RSMI_VOLT_TYPE_FIRST: rsmi_voltage_type_t = 0; #[doc = "!< Vddgfx GPU\n!< voltage"] pub const rsmi_voltage_type_t_RSMI_VOLT_TYPE_VDDGFX: rsmi_voltage_type_t = 0; pub const rsmi_voltage_type_t_RSMI_VOLT_TYPE_LAST: rsmi_voltage_type_t = 0; #[doc = "!< Invalid type"] pub const rsmi_voltage_type_t_RSMI_VOLT_TYPE_INVALID: rsmi_voltage_type_t = 4294967295; #[doc = " @brief This ennumeration is used to indicate which type of\n voltage reading should be obtained."] pub type rsmi_voltage_type_t = ::std::os::raw::c_uint; #[doc = "!< Custom Power Profile"] pub const rsmi_power_profile_preset_masks_t_RSMI_PWR_PROF_PRST_CUSTOM_MASK: rsmi_power_profile_preset_masks_t = 1; #[doc = "!< Video Power Profile"] pub const rsmi_power_profile_preset_masks_t_RSMI_PWR_PROF_PRST_VIDEO_MASK: rsmi_power_profile_preset_masks_t = 2; #[doc = "!< Power Saving Profile"] pub const rsmi_power_profile_preset_masks_t_RSMI_PWR_PROF_PRST_POWER_SAVING_MASK: rsmi_power_profile_preset_masks_t = 4; #[doc = "!< Compute Saving Profile"] pub const rsmi_power_profile_preset_masks_t_RSMI_PWR_PROF_PRST_COMPUTE_MASK: rsmi_power_profile_preset_masks_t = 8; #[doc = "!< VR Power Profile"] pub const rsmi_power_profile_preset_masks_t_RSMI_PWR_PROF_PRST_VR_MASK: rsmi_power_profile_preset_masks_t = 16; pub const rsmi_power_profile_preset_masks_t_RSMI_PWR_PROF_PRST_3D_FULL_SCR_MASK: rsmi_power_profile_preset_masks_t = 32; #[doc = "!< Default Boot Up Profile"] pub const rsmi_power_profile_preset_masks_t_RSMI_PWR_PROF_PRST_BOOTUP_DEFAULT: rsmi_power_profile_preset_masks_t = 64; pub const rsmi_power_profile_preset_masks_t_RSMI_PWR_PROF_PRST_LAST: rsmi_power_profile_preset_masks_t = 64; pub const rsmi_power_profile_preset_masks_t_RSMI_PWR_PROF_PRST_INVALID: rsmi_power_profile_preset_masks_t = 18446744073709551615; #[doc = " @brief Pre-set Profile Selections. These bitmasks can be AND'd with the\n ::rsmi_power_profile_status_t.available_profiles returned from\n ::rsmi_dev_power_profile_presets_get to determine which power profiles\n are supported by the system."] pub type rsmi_power_profile_preset_masks_t = ::std::os::raw::c_ulong; #[doc = " \\cond Ignore in docs."] pub use self::rsmi_power_profile_preset_masks_t as rsmi_power_profile_preset_masks; #[doc = "!< Used to indicate an\n!< invalid block"] pub const rsmi_gpu_block_t_RSMI_GPU_BLOCK_INVALID: rsmi_gpu_block_t = 0; pub const rsmi_gpu_block_t_RSMI_GPU_BLOCK_FIRST: rsmi_gpu_block_t = 1; #[doc = "!< UMC block"] pub const rsmi_gpu_block_t_RSMI_GPU_BLOCK_UMC: rsmi_gpu_block_t = 1; #[doc = "!< SDMA block"] pub const rsmi_gpu_block_t_RSMI_GPU_BLOCK_SDMA: rsmi_gpu_block_t = 2; #[doc = "!< GFX block"] pub const rsmi_gpu_block_t_RSMI_GPU_BLOCK_GFX: rsmi_gpu_block_t = 4; #[doc = "!< MMHUB block"] pub const rsmi_gpu_block_t_RSMI_GPU_BLOCK_MMHUB: rsmi_gpu_block_t = 8; #[doc = "!< ATHUB block"] pub const rsmi_gpu_block_t_RSMI_GPU_BLOCK_ATHUB: rsmi_gpu_block_t = 16; #[doc = "!< PCIE_BIF block"] pub const rsmi_gpu_block_t_RSMI_GPU_BLOCK_PCIE_BIF: rsmi_gpu_block_t = 32; #[doc = "!< HDP block"] pub const rsmi_gpu_block_t_RSMI_GPU_BLOCK_HDP: rsmi_gpu_block_t = 64; #[doc = "!< XGMI block"] pub const rsmi_gpu_block_t_RSMI_GPU_BLOCK_XGMI_WAFL: rsmi_gpu_block_t = 128; #[doc = "!< DF block"] pub const rsmi_gpu_block_t_RSMI_GPU_BLOCK_DF: rsmi_gpu_block_t = 256; #[doc = "!< SMN block"] pub const rsmi_gpu_block_t_RSMI_GPU_BLOCK_SMN: rsmi_gpu_block_t = 512; #[doc = "!< SEM block"] pub const rsmi_gpu_block_t_RSMI_GPU_BLOCK_SEM: rsmi_gpu_block_t = 1024; #[doc = "!< MP0 block"] pub const rsmi_gpu_block_t_RSMI_GPU_BLOCK_MP0: rsmi_gpu_block_t = 2048; #[doc = "!< MP1 block"] pub const rsmi_gpu_block_t_RSMI_GPU_BLOCK_MP1: rsmi_gpu_block_t = 4096; #[doc = "!< Fuse block"] pub const rsmi_gpu_block_t_RSMI_GPU_BLOCK_FUSE: rsmi_gpu_block_t = 8192; #[doc = "!< MCA block"] pub const rsmi_gpu_block_t_RSMI_GPU_BLOCK_MCA: rsmi_gpu_block_t = 16384; #[doc = "!< VCN block"] pub const rsmi_gpu_block_t_RSMI_GPU_BLOCK_VCN: rsmi_gpu_block_t = 32768; #[doc = "!< JPEG block"] pub const rsmi_gpu_block_t_RSMI_GPU_BLOCK_JPEG: rsmi_gpu_block_t = 65536; #[doc = "!< IH block"] pub const rsmi_gpu_block_t_RSMI_GPU_BLOCK_IH: rsmi_gpu_block_t = 131072; #[doc = "!< MPIO block"] pub const rsmi_gpu_block_t_RSMI_GPU_BLOCK_MPIO: rsmi_gpu_block_t = 262144; #[doc = "!< The highest bit position\n!< for supported blocks"] pub const rsmi_gpu_block_t_RSMI_GPU_BLOCK_LAST: rsmi_gpu_block_t = 262144; pub const rsmi_gpu_block_t_RSMI_GPU_BLOCK_RESERVED: rsmi_gpu_block_t = 9223372036854775808; #[doc = " @brief This enum is used to identify different GPU blocks."] pub type rsmi_gpu_block_t = ::std::os::raw::c_ulong; #[doc = " \\cond Ignore in docs."] pub use self::rsmi_gpu_block_t as rsmi_gpu_block; #[doc = "!< No current errors"] pub const rsmi_ras_err_state_t_RSMI_RAS_ERR_STATE_NONE: rsmi_ras_err_state_t = 0; #[doc = "!< ECC is disabled"] pub const rsmi_ras_err_state_t_RSMI_RAS_ERR_STATE_DISABLED: rsmi_ras_err_state_t = 1; #[doc = "!< ECC errors present, but type unknown"] pub const rsmi_ras_err_state_t_RSMI_RAS_ERR_STATE_PARITY: rsmi_ras_err_state_t = 2; #[doc = "!< Single correctable error"] pub const rsmi_ras_err_state_t_RSMI_RAS_ERR_STATE_SING_C: rsmi_ras_err_state_t = 3; #[doc = "!< Multiple uncorrectable errors"] pub const rsmi_ras_err_state_t_RSMI_RAS_ERR_STATE_MULT_UC: rsmi_ras_err_state_t = 4; #[doc = "!< Firmware detected error and isolated\n!< page. Treat as uncorrectable."] pub const rsmi_ras_err_state_t_RSMI_RAS_ERR_STATE_POISON: rsmi_ras_err_state_t = 5; #[doc = "!< ECC is enabled"] pub const rsmi_ras_err_state_t_RSMI_RAS_ERR_STATE_ENABLED: rsmi_ras_err_state_t = 6; pub const rsmi_ras_err_state_t_RSMI_RAS_ERR_STATE_LAST: rsmi_ras_err_state_t = 6; pub const rsmi_ras_err_state_t_RSMI_RAS_ERR_STATE_INVALID: rsmi_ras_err_state_t = 4294967295; #[doc = " @brief The current ECC state"] pub type rsmi_ras_err_state_t = ::std::os::raw::c_uint; pub const rsmi_memory_type_t_RSMI_MEM_TYPE_FIRST: rsmi_memory_type_t = 0; #[doc = "!< VRAM memory"] pub const rsmi_memory_type_t_RSMI_MEM_TYPE_VRAM: rsmi_memory_type_t = 0; #[doc = "!< VRAM memory that is visible"] pub const rsmi_memory_type_t_RSMI_MEM_TYPE_VIS_VRAM: rsmi_memory_type_t = 1; #[doc = "!< GTT memory"] pub const rsmi_memory_type_t_RSMI_MEM_TYPE_GTT: rsmi_memory_type_t = 2; pub const rsmi_memory_type_t_RSMI_MEM_TYPE_LAST: rsmi_memory_type_t = 2; #[doc = " @brief Types of memory"] pub type rsmi_memory_type_t = ::std::os::raw::c_uint; #[doc = "!< Index used for the minimum frequency value"] pub const rsmi_freq_ind_t_RSMI_FREQ_IND_MIN: rsmi_freq_ind_t = 0; #[doc = "!< Index used for the maximum frequency value"] pub const rsmi_freq_ind_t_RSMI_FREQ_IND_MAX: rsmi_freq_ind_t = 1; #[doc = "!< An invalid frequency index"] pub const rsmi_freq_ind_t_RSMI_FREQ_IND_INVALID: rsmi_freq_ind_t = 4294967295; #[doc = " @brief The values of this enum are used as frequency identifiers."] pub type rsmi_freq_ind_t = ::std::os::raw::c_uint; #[doc = " \\cond Ignore in docs."] pub use self::rsmi_freq_ind_t as rsmi_freq_ind; pub const rsmi_pcie_slot_type_t_RSMI_PCIE_SLOT_PCIE: rsmi_pcie_slot_type_t = 0; pub const rsmi_pcie_slot_type_t_RSMI_PCIE_SLOT_CEM: rsmi_pcie_slot_type_t = 1; pub const rsmi_pcie_slot_type_t_RSMI_PCIE_SLOT_OAM: rsmi_pcie_slot_type_t = 2; #[doc = "!< An unknown"] pub const rsmi_pcie_slot_type_t_RSMI_PCIE_SLOT_UNKNOWN: rsmi_pcie_slot_type_t = 3; #[doc = " @brief The values of this enum are used as PCIe slot type."] pub type rsmi_pcie_slot_type_t = ::std::os::raw::c_uint; #[doc = " \\cond Ignore in docs."] pub use self::rsmi_pcie_slot_type_t as rsmi_pcie_slot_type; pub const rsmi_fw_block_t_RSMI_FW_BLOCK_FIRST: rsmi_fw_block_t = 0; pub const rsmi_fw_block_t_RSMI_FW_BLOCK_ASD: rsmi_fw_block_t = 0; pub const rsmi_fw_block_t_RSMI_FW_BLOCK_CE: rsmi_fw_block_t = 1; pub const rsmi_fw_block_t_RSMI_FW_BLOCK_DMCU: rsmi_fw_block_t = 2; pub const rsmi_fw_block_t_RSMI_FW_BLOCK_MC: rsmi_fw_block_t = 3; pub const rsmi_fw_block_t_RSMI_FW_BLOCK_ME: rsmi_fw_block_t = 4; pub const rsmi_fw_block_t_RSMI_FW_BLOCK_MEC: rsmi_fw_block_t = 5; pub const rsmi_fw_block_t_RSMI_FW_BLOCK_MEC2: rsmi_fw_block_t = 6; pub const rsmi_fw_block_t_RSMI_FW_BLOCK_MES: rsmi_fw_block_t = 7; pub const rsmi_fw_block_t_RSMI_FW_BLOCK_MES_KIQ: rsmi_fw_block_t = 8; pub const rsmi_fw_block_t_RSMI_FW_BLOCK_PFP: rsmi_fw_block_t = 9; pub const rsmi_fw_block_t_RSMI_FW_BLOCK_RLC: rsmi_fw_block_t = 10; pub const rsmi_fw_block_t_RSMI_FW_BLOCK_RLC_SRLC: rsmi_fw_block_t = 11; pub const rsmi_fw_block_t_RSMI_FW_BLOCK_RLC_SRLG: rsmi_fw_block_t = 12; pub const rsmi_fw_block_t_RSMI_FW_BLOCK_RLC_SRLS: rsmi_fw_block_t = 13; pub const rsmi_fw_block_t_RSMI_FW_BLOCK_SDMA: rsmi_fw_block_t = 14; pub const rsmi_fw_block_t_RSMI_FW_BLOCK_SDMA2: rsmi_fw_block_t = 15; pub const rsmi_fw_block_t_RSMI_FW_BLOCK_SMC: rsmi_fw_block_t = 16; pub const rsmi_fw_block_t_RSMI_FW_BLOCK_SOS: rsmi_fw_block_t = 17; pub const rsmi_fw_block_t_RSMI_FW_BLOCK_TA_RAS: rsmi_fw_block_t = 18; pub const rsmi_fw_block_t_RSMI_FW_BLOCK_TA_XGMI: rsmi_fw_block_t = 19; pub const rsmi_fw_block_t_RSMI_FW_BLOCK_UVD: rsmi_fw_block_t = 20; pub const rsmi_fw_block_t_RSMI_FW_BLOCK_VCE: rsmi_fw_block_t = 21; pub const rsmi_fw_block_t_RSMI_FW_BLOCK_VCN: rsmi_fw_block_t = 22; pub const rsmi_fw_block_t_RSMI_FW_BLOCK_LAST: rsmi_fw_block_t = 22; #[doc = " @brief The values of this enum are used to identify the various firmware\n blocks."] pub type rsmi_fw_block_t = ::std::os::raw::c_uint; pub const rsmi_xgmi_status_t_RSMI_XGMI_STATUS_NO_ERRORS: rsmi_xgmi_status_t = 0; pub const rsmi_xgmi_status_t_RSMI_XGMI_STATUS_ERROR: rsmi_xgmi_status_t = 1; pub const rsmi_xgmi_status_t_RSMI_XGMI_STATUS_MULTIPLE_ERRORS: rsmi_xgmi_status_t = 2; #[doc = " @brief XGMI Status"] pub type rsmi_xgmi_status_t = ::std::os::raw::c_uint; #[doc = " @brief Bitfield used in various RSMI calls"] pub type rsmi_bit_field_t = u64; #[doc = " \\cond Ignore in docs."] pub type rsmi_bit_field = rsmi_bit_field_t; #[doc = "!< Reserved. This gpu page is reserved\n!< and not available for use"] pub const rsmi_memory_page_status_t_RSMI_MEM_PAGE_STATUS_RESERVED: rsmi_memory_page_status_t = 0; #[doc = "!< Pending. This gpu page is marked\n!< as bad and will be marked reserved\n!< at the next window."] pub const rsmi_memory_page_status_t_RSMI_MEM_PAGE_STATUS_PENDING: rsmi_memory_page_status_t = 1; #[doc = "!< Unable to reserve this page"] pub const rsmi_memory_page_status_t_RSMI_MEM_PAGE_STATUS_UNRESERVABLE: rsmi_memory_page_status_t = 2; #[doc = " @brief Reserved Memory Page States"] pub type rsmi_memory_page_status_t = ::std::os::raw::c_uint; #[doc = "!< unknown type."] pub const _RSMI_IO_LINK_TYPE_RSMI_IOLINK_TYPE_UNDEFINED: _RSMI_IO_LINK_TYPE = 0; #[doc = "!< PCI Express"] pub const _RSMI_IO_LINK_TYPE_RSMI_IOLINK_TYPE_PCIEXPRESS: _RSMI_IO_LINK_TYPE = 1; #[doc = "!< XGMI"] pub const _RSMI_IO_LINK_TYPE_RSMI_IOLINK_TYPE_XGMI: _RSMI_IO_LINK_TYPE = 2; #[doc = "!< Number of IO Link types"] pub const _RSMI_IO_LINK_TYPE_RSMI_IOLINK_TYPE_NUMIOLINKTYPES: _RSMI_IO_LINK_TYPE = 3; #[doc = "!< Max of IO Link types"] pub const _RSMI_IO_LINK_TYPE_RSMI_IOLINK_TYPE_SIZE: _RSMI_IO_LINK_TYPE = 4294967295; #[doc = " @brief Types for IO Link"] pub type _RSMI_IO_LINK_TYPE = ::std::os::raw::c_uint; #[doc = " @brief Types for IO Link"] pub use self::_RSMI_IO_LINK_TYPE as RSMI_IO_LINK_TYPE; pub const RSMI_UTILIZATION_COUNTER_TYPE_RSMI_UTILIZATION_COUNTER_FIRST: RSMI_UTILIZATION_COUNTER_TYPE = 0; pub const RSMI_UTILIZATION_COUNTER_TYPE_RSMI_COARSE_GRAIN_GFX_ACTIVITY: RSMI_UTILIZATION_COUNTER_TYPE = 0; #[doc = "!< Memory Activity"] pub const RSMI_UTILIZATION_COUNTER_TYPE_RSMI_COARSE_GRAIN_MEM_ACTIVITY: RSMI_UTILIZATION_COUNTER_TYPE = 1; #[doc = "!< Decoder Activity\n!< Fine grain activity counters"] pub const RSMI_UTILIZATION_COUNTER_TYPE_RSMI_COARSE_DECODER_ACTIVITY: RSMI_UTILIZATION_COUNTER_TYPE = 2; pub const RSMI_UTILIZATION_COUNTER_TYPE_RSMI_FINE_GRAIN_GFX_ACTIVITY: RSMI_UTILIZATION_COUNTER_TYPE = 100; pub const RSMI_UTILIZATION_COUNTER_TYPE_RSMI_FINE_GRAIN_MEM_ACTIVITY: RSMI_UTILIZATION_COUNTER_TYPE = 101; pub const RSMI_UTILIZATION_COUNTER_TYPE_RSMI_FINE_DECODER_ACTIVITY: RSMI_UTILIZATION_COUNTER_TYPE = 102; pub const RSMI_UTILIZATION_COUNTER_TYPE_RSMI_UTILIZATION_COUNTER_LAST: RSMI_UTILIZATION_COUNTER_TYPE = 102; #[doc = " @brief The utilization counter type"] pub type RSMI_UTILIZATION_COUNTER_TYPE = ::std::os::raw::c_uint; pub const RSMI_DF_BW_TYPE_RSMI_DF_BW_TYPE_FIRST: RSMI_DF_BW_TYPE = 0; #[doc = "!< Read bandwidth of DF"] pub const RSMI_DF_BW_TYPE_RSMI_DF_BW_TYPE_R: RSMI_DF_BW_TYPE = 0; #[doc = "!< Write bandwidth of DF"] pub const RSMI_DF_BW_TYPE_RSMI_DF_BW_TYPE_W: RSMI_DF_BW_TYPE = 1; #[doc = "!< Read and write bandwidth of DF"] pub const RSMI_DF_BW_TYPE_RSMI_DF_BW_TYPE_R_W: RSMI_DF_BW_TYPE = 2; #[doc = "!< All types bandwidth of DF"] pub const RSMI_DF_BW_TYPE_RSMI_DF_BW_TYPE_ALL: RSMI_DF_BW_TYPE = 3; pub const RSMI_DF_BW_TYPE_RSMI_DF_BW_TYPE_LAST: RSMI_DF_BW_TYPE = 3; #[doc = " @brief The df bandwidth type"] pub type RSMI_DF_BW_TYPE = ::std::os::raw::c_uint; pub const RSMI_XHCL_LINK_TYPE_RSMI_XHCL_LINK_TYPE_FIRST: RSMI_XHCL_LINK_TYPE = 0; pub const RSMI_XHCL_LINK_TYPE_RSMI_XHCL_LINK_TYPE_GPU: RSMI_XHCL_LINK_TYPE = 0; pub const RSMI_XHCL_LINK_TYPE_RSMI_XHCL_LINK_TYPE_SWITCH: RSMI_XHCL_LINK_TYPE = 1; pub const RSMI_XHCL_LINK_TYPE_RSMI_XHCL_LINK_TYPE_LAST: RSMI_XHCL_LINK_TYPE = 1; #[doc = " @brief The xhcl link type"] pub type RSMI_XHCL_LINK_TYPE = ::std::os::raw::c_uint; #[doc = "!< Average Power"] pub const RSMI_POWER_TYPE_RSMI_AVERAGE_POWER: RSMI_POWER_TYPE = 0; #[doc = "!< Current / Instant Power"] pub const RSMI_POWER_TYPE_RSMI_CURRENT_POWER: RSMI_POWER_TYPE = 1; #[doc = "!< Invalid / Undetected Power"] pub const RSMI_POWER_TYPE_RSMI_INVALID_POWER: RSMI_POWER_TYPE = 4294967295; #[doc = " @brief Power types"] pub type RSMI_POWER_TYPE = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct rsmi_utilization_counter_t { #[doc = "!< Utilization counter type"] pub type_: RSMI_UTILIZATION_COUNTER_TYPE, #[doc = "!< Coarse grain activity counter value (average)"] pub value: u64, #[doc = "!< Utilization counter value (individual values)"] pub fine_value: [u64; 4usize], pub fine_value_count: u16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rsmi_utilization_counter_t"] [::std::mem::size_of::() - 56usize]; ["Alignment of rsmi_utilization_counter_t"] [::std::mem::align_of::() - 8usize]; ["Offset of field: rsmi_utilization_counter_t::type_"] [::std::mem::offset_of!(rsmi_utilization_counter_t, type_) - 0usize]; ["Offset of field: rsmi_utilization_counter_t::value"] [::std::mem::offset_of!(rsmi_utilization_counter_t, value) - 8usize]; ["Offset of field: rsmi_utilization_counter_t::fine_value"] [::std::mem::offset_of!(rsmi_utilization_counter_t, fine_value) - 16usize]; ["Offset of field: rsmi_utilization_counter_t::fine_value_count"] [::std::mem::offset_of!(rsmi_utilization_counter_t, fine_value_count) - 48usize]; }; #[doc = " @brief Reserved Memory Page Record"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct rsmi_retired_page_record_t { #[doc = "!< Start address of page"] pub page_address: u64, #[doc = "!< Page size"] pub page_size: u64, #[doc = "!< Page \"reserved\" status"] pub status: rsmi_memory_page_status_t, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rsmi_retired_page_record_t"] [::std::mem::size_of::() - 24usize]; ["Alignment of rsmi_retired_page_record_t"] [::std::mem::align_of::() - 8usize]; ["Offset of field: rsmi_retired_page_record_t::page_address"] [::std::mem::offset_of!(rsmi_retired_page_record_t, page_address) - 0usize]; ["Offset of field: rsmi_retired_page_record_t::page_size"] [::std::mem::offset_of!(rsmi_retired_page_record_t, page_size) - 8usize]; ["Offset of field: rsmi_retired_page_record_t::status"] [::std::mem::offset_of!(rsmi_retired_page_record_t, status) - 16usize]; }; #[doc = " @brief This structure contains information about which power profiles are\n supported by the system for a given device, and which power profile is\n currently active."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct rsmi_power_profile_status_t { #[doc = " Which profiles are supported by this system"] pub available_profiles: rsmi_bit_field_t, #[doc = " Which power profile is currently active"] pub current: rsmi_power_profile_preset_masks_t, #[doc = " How many power profiles are available"] pub num_profiles: u32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rsmi_power_profile_status_t"] [::std::mem::size_of::() - 24usize]; ["Alignment of rsmi_power_profile_status_t"] [::std::mem::align_of::() - 8usize]; ["Offset of field: rsmi_power_profile_status_t::available_profiles"] [::std::mem::offset_of!(rsmi_power_profile_status_t, available_profiles) - 0usize]; ["Offset of field: rsmi_power_profile_status_t::current"] [::std::mem::offset_of!(rsmi_power_profile_status_t, current) - 8usize]; ["Offset of field: rsmi_power_profile_status_t::num_profiles"] [::std::mem::offset_of!(rsmi_power_profile_status_t, num_profiles) - 16usize]; }; #[doc = " \\cond Ignore in docs."] pub type rsmi_power_profile_status = rsmi_power_profile_status_t; #[doc = " @brief This structure holds information about clock frequencies."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct rsmi_frequencies_t { #[doc = " Deep Sleep frequency is only supported by some GPUs"] pub has_deep_sleep: bool, #[doc = " The number of supported frequencies"] pub num_supported: u32, #[doc = " The current frequency index"] pub current: u32, #[doc = " List of frequencies.\n Only the first num_supported frequencies are valid."] pub frequency: [u64; 33usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rsmi_frequencies_t"][::std::mem::size_of::() - 280usize]; ["Alignment of rsmi_frequencies_t"][::std::mem::align_of::() - 8usize]; ["Offset of field: rsmi_frequencies_t::has_deep_sleep"] [::std::mem::offset_of!(rsmi_frequencies_t, has_deep_sleep) - 0usize]; ["Offset of field: rsmi_frequencies_t::num_supported"] [::std::mem::offset_of!(rsmi_frequencies_t, num_supported) - 4usize]; ["Offset of field: rsmi_frequencies_t::current"] [::std::mem::offset_of!(rsmi_frequencies_t, current) - 8usize]; ["Offset of field: rsmi_frequencies_t::frequency"] [::std::mem::offset_of!(rsmi_frequencies_t, frequency) - 16usize]; }; #[doc = " \\cond Ignore in docs."] pub type rsmi_frequencies = rsmi_frequencies_t; #[doc = " @brief IO Link P2P Capability"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct rsmi_p2p_capability_t { pub is_iolink_coherent: u8, pub is_iolink_atomics_32bit: u8, pub is_iolink_atomics_64bit: u8, pub is_iolink_dma: u8, pub is_iolink_bi_directional: u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rsmi_p2p_capability_t"][::std::mem::size_of::() - 5usize]; ["Alignment of rsmi_p2p_capability_t"] [::std::mem::align_of::() - 1usize]; ["Offset of field: rsmi_p2p_capability_t::is_iolink_coherent"] [::std::mem::offset_of!(rsmi_p2p_capability_t, is_iolink_coherent) - 0usize]; ["Offset of field: rsmi_p2p_capability_t::is_iolink_atomics_32bit"] [::std::mem::offset_of!(rsmi_p2p_capability_t, is_iolink_atomics_32bit) - 1usize]; ["Offset of field: rsmi_p2p_capability_t::is_iolink_atomics_64bit"] [::std::mem::offset_of!(rsmi_p2p_capability_t, is_iolink_atomics_64bit) - 2usize]; ["Offset of field: rsmi_p2p_capability_t::is_iolink_dma"] [::std::mem::offset_of!(rsmi_p2p_capability_t, is_iolink_dma) - 3usize]; ["Offset of field: rsmi_p2p_capability_t::is_iolink_bi_directional"] [::std::mem::offset_of!(rsmi_p2p_capability_t, is_iolink_bi_directional) - 4usize]; }; #[doc = " @brief This structure holds information about the possible PCIe\n bandwidths. Specifically, the possible transfer rates and their\n associated numbers of lanes are stored here."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct rsmi_pcie_bandwidth_t { #[doc = " Transfer rates (T/s) that are possible"] pub transfer_rate: rsmi_frequencies_t, #[doc = " List of lanes for corresponding transfer rate.\n Only the first num_supported bandwidths are valid."] pub lanes: [u32; 33usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rsmi_pcie_bandwidth_t"][::std::mem::size_of::() - 416usize]; ["Alignment of rsmi_pcie_bandwidth_t"] [::std::mem::align_of::() - 8usize]; ["Offset of field: rsmi_pcie_bandwidth_t::transfer_rate"] [::std::mem::offset_of!(rsmi_pcie_bandwidth_t, transfer_rate) - 0usize]; ["Offset of field: rsmi_pcie_bandwidth_t::lanes"] [::std::mem::offset_of!(rsmi_pcie_bandwidth_t, lanes) - 280usize]; }; #[doc = " \\cond Ignore in docs."] pub type rsmi_pcie_bandwidth = rsmi_pcie_bandwidth_t; #[doc = " @brief This structure holds information about the possible activity\n averages. Specifically, the utilization counters."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct rsmi_activity_metric_counter_t { #[doc = "!< Average graphics activity"] pub average_gfx_activity: u16, #[doc = "!< memory controller"] pub average_umc_activity: u16, #[doc = "!< UVD or VCN"] pub average_mm_activity: u16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rsmi_activity_metric_counter_t"] [::std::mem::size_of::() - 6usize]; ["Alignment of rsmi_activity_metric_counter_t"] [::std::mem::align_of::() - 2usize]; ["Offset of field: rsmi_activity_metric_counter_t::average_gfx_activity"] [::std::mem::offset_of!(rsmi_activity_metric_counter_t, average_gfx_activity) - 0usize]; ["Offset of field: rsmi_activity_metric_counter_t::average_umc_activity"] [::std::mem::offset_of!(rsmi_activity_metric_counter_t, average_umc_activity) - 2usize]; ["Offset of field: rsmi_activity_metric_counter_t::average_mm_activity"] [::std::mem::offset_of!(rsmi_activity_metric_counter_t, average_mm_activity) - 4usize]; }; #[doc = " @brief This structure holds hy_version information."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct rsmi_hy_version_t { #[doc = "!< Major version"] pub hy_major: u32, #[doc = "!< Minor version"] pub hy_minor: u32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rsmi_hy_version_t"][::std::mem::size_of::() - 8usize]; ["Alignment of rsmi_hy_version_t"][::std::mem::align_of::() - 4usize]; ["Offset of field: rsmi_hy_version_t::hy_major"] [::std::mem::offset_of!(rsmi_hy_version_t, hy_major) - 0usize]; ["Offset of field: rsmi_hy_version_t::hy_minor"] [::std::mem::offset_of!(rsmi_hy_version_t, hy_minor) - 4usize]; }; #[doc = " @brief This structure holds version information."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct rsmi_version_t { #[doc = "!< Major version"] pub major: u32, #[doc = "!< Minor version"] pub minor: u32, #[doc = "!< Patch, build or stepping version"] pub patch: u32, #[doc = "!< Build string"] pub build: *const ::std::os::raw::c_char, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rsmi_version_t"][::std::mem::size_of::() - 24usize]; ["Alignment of rsmi_version_t"][::std::mem::align_of::() - 8usize]; ["Offset of field: rsmi_version_t::major"] [::std::mem::offset_of!(rsmi_version_t, major) - 0usize]; ["Offset of field: rsmi_version_t::minor"] [::std::mem::offset_of!(rsmi_version_t, minor) - 4usize]; ["Offset of field: rsmi_version_t::patch"] [::std::mem::offset_of!(rsmi_version_t, patch) - 8usize]; ["Offset of field: rsmi_version_t::build"] [::std::mem::offset_of!(rsmi_version_t, build) - 16usize]; }; #[doc = " \\cond Ignore in docs."] pub type rsmi_version = rsmi_version_t; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct rsmi_gpu_cache_info_t { pub num_cache_types: u32, pub cache: [rsmi_gpu_cache_info_t__bindgen_ty_1; 10usize], } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct rsmi_gpu_cache_info_t__bindgen_ty_1 { pub cache_size_kb: u32, pub cache_level: u32, pub flags: u32, pub max_num_cu_shared: u32, pub num_cache_instance: u32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rsmi_gpu_cache_info_t__bindgen_ty_1"] [::std::mem::size_of::() - 20usize]; ["Alignment of rsmi_gpu_cache_info_t__bindgen_ty_1"] [::std::mem::align_of::() - 4usize]; ["Offset of field: rsmi_gpu_cache_info_t__bindgen_ty_1::cache_size_kb"] [::std::mem::offset_of!(rsmi_gpu_cache_info_t__bindgen_ty_1, cache_size_kb) - 0usize]; ["Offset of field: rsmi_gpu_cache_info_t__bindgen_ty_1::cache_level"] [::std::mem::offset_of!(rsmi_gpu_cache_info_t__bindgen_ty_1, cache_level) - 4usize]; ["Offset of field: rsmi_gpu_cache_info_t__bindgen_ty_1::flags"] [::std::mem::offset_of!(rsmi_gpu_cache_info_t__bindgen_ty_1, flags) - 8usize]; ["Offset of field: rsmi_gpu_cache_info_t__bindgen_ty_1::max_num_cu_shared"] [::std::mem::offset_of!(rsmi_gpu_cache_info_t__bindgen_ty_1, max_num_cu_shared) - 12usize]; ["Offset of field: rsmi_gpu_cache_info_t__bindgen_ty_1::num_cache_instance"] [::std::mem::offset_of!(rsmi_gpu_cache_info_t__bindgen_ty_1, num_cache_instance) - 16usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rsmi_gpu_cache_info_t"][::std::mem::size_of::() - 204usize]; ["Alignment of rsmi_gpu_cache_info_t"] [::std::mem::align_of::() - 4usize]; ["Offset of field: rsmi_gpu_cache_info_t::num_cache_types"] [::std::mem::offset_of!(rsmi_gpu_cache_info_t, num_cache_types) - 0usize]; ["Offset of field: rsmi_gpu_cache_info_t::cache"] [::std::mem::offset_of!(rsmi_gpu_cache_info_t, cache) - 4usize]; }; #[doc = " \\cond Ignore in docs."] pub type rsmi_gpu_cache_info = rsmi_gpu_cache_info_t; #[doc = " @brief This structure represents a range (e.g., frequencies or voltages)."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct rsmi_range_t { #[doc = "!< Lower bound of range"] pub lower_bound: u64, #[doc = "!< Upper bound of range"] pub upper_bound: u64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rsmi_range_t"][::std::mem::size_of::() - 16usize]; ["Alignment of rsmi_range_t"][::std::mem::align_of::() - 8usize]; ["Offset of field: rsmi_range_t::lower_bound"] [::std::mem::offset_of!(rsmi_range_t, lower_bound) - 0usize]; ["Offset of field: rsmi_range_t::upper_bound"] [::std::mem::offset_of!(rsmi_range_t, upper_bound) - 8usize]; }; #[doc = " \\cond Ignore in docs."] pub type rsmi_range = rsmi_range_t; #[doc = " @brief This structure represents a point on the frequency-voltage plane."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct rsmi_od_vddc_point_t { #[doc = "!< Frequency coordinate (in Hz)"] pub frequency: u64, #[doc = "!< Voltage coordinate (in mV)"] pub voltage: u64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rsmi_od_vddc_point_t"][::std::mem::size_of::() - 16usize]; ["Alignment of rsmi_od_vddc_point_t"][::std::mem::align_of::() - 8usize]; ["Offset of field: rsmi_od_vddc_point_t::frequency"] [::std::mem::offset_of!(rsmi_od_vddc_point_t, frequency) - 0usize]; ["Offset of field: rsmi_od_vddc_point_t::voltage"] [::std::mem::offset_of!(rsmi_od_vddc_point_t, voltage) - 8usize]; }; #[doc = " \\cond Ignore in docs."] pub type rsmi_od_vddc_point = rsmi_od_vddc_point_t; #[doc = " @brief This structure holds 2 ::rsmi_range_t's, one for frequency and one for\n voltage. These 2 ranges indicate the range of possible values for the\n corresponding ::rsmi_od_vddc_point_t."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct rsmi_freq_volt_region_t { #[doc = "!< The frequency range for this VDDC Curve point"] pub freq_range: rsmi_range_t, #[doc = "!< The voltage range for this VDDC Curve point"] pub volt_range: rsmi_range_t, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rsmi_freq_volt_region_t"][::std::mem::size_of::() - 32usize]; ["Alignment of rsmi_freq_volt_region_t"] [::std::mem::align_of::() - 8usize]; ["Offset of field: rsmi_freq_volt_region_t::freq_range"] [::std::mem::offset_of!(rsmi_freq_volt_region_t, freq_range) - 0usize]; ["Offset of field: rsmi_freq_volt_region_t::volt_range"] [::std::mem::offset_of!(rsmi_freq_volt_region_t, volt_range) - 16usize]; }; #[doc = " \\cond Ignore in docs."] pub type rsmi_freq_volt_region = rsmi_freq_volt_region_t; #[doc = " ::RSMI_NUM_VOLTAGE_CURVE_POINTS number of ::rsmi_od_vddc_point_t's"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct rsmi_od_volt_curve_t { #[doc = " Array of ::RSMI_NUM_VOLTAGE_CURVE_POINTS ::rsmi_od_vddc_point_t's that\n make up the voltage frequency curve points."] pub vc_points: [rsmi_od_vddc_point_t; 3usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rsmi_od_volt_curve_t"][::std::mem::size_of::() - 48usize]; ["Alignment of rsmi_od_volt_curve_t"][::std::mem::align_of::() - 8usize]; ["Offset of field: rsmi_od_volt_curve_t::vc_points"] [::std::mem::offset_of!(rsmi_od_volt_curve_t, vc_points) - 0usize]; }; #[doc = " \\cond Ignore in docs."] pub type rsmi_od_volt_curve = rsmi_od_volt_curve_t; #[doc = " @brief This structure holds the frequency-voltage values for a device."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct rsmi_od_volt_freq_data_t { #[doc = "!< The current SCLK frequency range"] pub curr_sclk_range: rsmi_range_t, #[doc = "!< The current MCLK frequency range;\n!< (upper bound only)"] pub curr_mclk_range: rsmi_range_t, #[doc = "!< The range possible of SCLK values"] pub sclk_freq_limits: rsmi_range_t, #[doc = "!< The range possible of MCLK values"] pub mclk_freq_limits: rsmi_range_t, #[doc = " @brief The current voltage curve"] pub curve: rsmi_od_volt_curve_t, #[doc = "!< The number of voltage curve regions"] pub num_regions: u32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rsmi_od_volt_freq_data_t"] [::std::mem::size_of::() - 120usize]; ["Alignment of rsmi_od_volt_freq_data_t"] [::std::mem::align_of::() - 8usize]; ["Offset of field: rsmi_od_volt_freq_data_t::curr_sclk_range"] [::std::mem::offset_of!(rsmi_od_volt_freq_data_t, curr_sclk_range) - 0usize]; ["Offset of field: rsmi_od_volt_freq_data_t::curr_mclk_range"] [::std::mem::offset_of!(rsmi_od_volt_freq_data_t, curr_mclk_range) - 16usize]; ["Offset of field: rsmi_od_volt_freq_data_t::sclk_freq_limits"] [::std::mem::offset_of!(rsmi_od_volt_freq_data_t, sclk_freq_limits) - 32usize]; ["Offset of field: rsmi_od_volt_freq_data_t::mclk_freq_limits"] [::std::mem::offset_of!(rsmi_od_volt_freq_data_t, mclk_freq_limits) - 48usize]; ["Offset of field: rsmi_od_volt_freq_data_t::curve"] [::std::mem::offset_of!(rsmi_od_volt_freq_data_t, curve) - 64usize]; ["Offset of field: rsmi_od_volt_freq_data_t::num_regions"] [::std::mem::offset_of!(rsmi_od_volt_freq_data_t, num_regions) - 112usize]; }; #[doc = " \\cond Ignore in docs."] pub type rsmi_od_volt_freq_data = rsmi_od_volt_freq_data_t; #[doc = " @brief Size and version information of metrics data"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct metrics_table_header_t { #[doc = " \\cond Ignore in docs."] pub structure_size: u16, pub format_revision: u8, pub content_revision: u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of metrics_table_header_t"][::std::mem::size_of::() - 4usize]; ["Alignment of metrics_table_header_t"] [::std::mem::align_of::() - 2usize]; ["Offset of field: metrics_table_header_t::structure_size"] [::std::mem::offset_of!(metrics_table_header_t, structure_size) - 0usize]; ["Offset of field: metrics_table_header_t::format_revision"] [::std::mem::offset_of!(metrics_table_header_t, format_revision) - 2usize]; ["Offset of field: metrics_table_header_t::content_revision"] [::std::mem::offset_of!(metrics_table_header_t, content_revision) - 3usize]; }; #[doc = " @brief The following structures hold the gpu statistics for a device."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct gpu_xcp_metrics_t { pub gfx_busy_inst: [u32; 8usize], pub jpeg_busy: [u16; 32usize], pub vcn_busy: [u16; 4usize], pub gfx_busy_acc: [u64; 8usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of gpu_xcp_metrics_t"][::std::mem::size_of::() - 168usize]; ["Alignment of gpu_xcp_metrics_t"][::std::mem::align_of::() - 8usize]; ["Offset of field: gpu_xcp_metrics_t::gfx_busy_inst"] [::std::mem::offset_of!(gpu_xcp_metrics_t, gfx_busy_inst) - 0usize]; ["Offset of field: gpu_xcp_metrics_t::jpeg_busy"] [::std::mem::offset_of!(gpu_xcp_metrics_t, jpeg_busy) - 32usize]; ["Offset of field: gpu_xcp_metrics_t::vcn_busy"] [::std::mem::offset_of!(gpu_xcp_metrics_t, vcn_busy) - 96usize]; ["Offset of field: gpu_xcp_metrics_t::gfx_busy_acc"] [::std::mem::offset_of!(gpu_xcp_metrics_t, gfx_busy_acc) - 104usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct rsmi_gpu_metrics_t { #[doc = " \\cond Ignore in docs."] pub common_header: metrics_table_header_t, pub temperature_edge: u16, pub temperature_hotspot: u16, pub temperature_mem: u16, pub temperature_vrgfx: u16, pub temperature_vrsoc: u16, pub temperature_vrmem: u16, pub average_gfx_activity: u16, pub average_umc_activity: u16, pub average_mm_activity: u16, pub average_socket_power: u16, pub energy_accumulator: u64, pub system_clock_counter: u64, pub average_gfxclk_frequency: u16, pub average_socclk_frequency: u16, pub average_uclk_frequency: u16, pub average_vclk0_frequency: u16, pub average_dclk0_frequency: u16, pub average_vclk1_frequency: u16, pub average_dclk1_frequency: u16, pub current_gfxclk: u16, pub current_socclk: u16, pub current_uclk: u16, pub current_vclk0: u16, pub current_dclk0: u16, pub current_vclk1: u16, pub current_dclk1: u16, pub throttle_status: u32, pub current_fan_speed: u16, pub pcie_link_width: u16, pub pcie_link_speed: u16, pub gfx_activity_acc: u32, pub mem_activity_acc: u32, pub temperature_hbm: [u16; 4usize], pub firmware_timestamp: u64, pub voltage_soc: u16, pub voltage_gfx: u16, pub voltage_mem: u16, pub indep_throttle_status: u64, pub current_socket_power: u16, pub vcn_activity: [u16; 4usize], pub gfxclk_lock_status: u32, pub xgmi_link_width: u16, pub xgmi_link_speed: u16, pub pcie_bandwidth_acc: u64, pub pcie_bandwidth_inst: u64, pub pcie_l0_to_recov_count_acc: u64, pub pcie_replay_count_acc: u64, pub pcie_replay_rover_count_acc: u64, pub xgmi_read_data_acc: [u64; 8usize], pub xgmi_write_data_acc: [u64; 8usize], pub current_gfxclks: [u16; 8usize], pub current_socclks: [u16; 4usize], pub current_vclk0s: [u16; 4usize], pub current_dclk0s: [u16; 4usize], pub jpeg_activity: [u16; 32usize], pub pcie_nak_sent_count_acc: u32, pub pcie_nak_rcvd_count_acc: u32, pub accumulation_counter: u64, #[doc = " Accumulated throttler residencies"] pub prochot_residency_acc: u64, #[doc = " Accumulated throttler residencies\n\n Prochot (thermal) - PPT (power)\n Package Power Tracking (PPT) violation % (greater than 0% is a violation);\n aka PVIOL\n\n Ex. PVIOL/TVIOL calculations\n Where A and B are measurments recorded at prior points in time.\n Typically A is the earlier measured value and B is the latest measured value.\n\n PVIOL % = (PptResidencyAcc (B) - PptResidencyAcc (A)) * 100/ (AccumulationCounter (B) - AccumulationCounter (A))\n TVIOL % = (SocketThmResidencyAcc (B) - SocketThmResidencyAcc (A)) * 100 / (AccumulationCounter (B) - AccumulationCounter (A))"] pub ppt_residency_acc: u64, #[doc = " Accumulated throttler residencies\n\n Socket (thermal)\t-\n Socket thermal violation % (greater than 0% is a violation);\n aka TVIOL\n\n Ex. PVIOL/TVIOL calculations\n Where A and B are measurments recorded at prior points in time.\n Typically A is the earlier measured value and B is the latest measured value.\n\n PVIOL % = (PptResidencyAcc (B) - PptResidencyAcc (A)) * 100/ (AccumulationCounter (B) - AccumulationCounter (A))\n TVIOL % = (SocketThmResidencyAcc (B) - SocketThmResidencyAcc (A)) * 100 / (AccumulationCounter (B) - AccumulationCounter (A))"] pub socket_thm_residency_acc: u64, pub vr_thm_residency_acc: u64, pub hbm_thm_residency_acc: u64, pub num_partition: u16, pub xcp_stats: [gpu_xcp_metrics_t; 8usize], pub pcie_lc_perf_other_end_recovery: u32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rsmi_gpu_metrics_t"][::std::mem::size_of::() - 1832usize]; ["Alignment of rsmi_gpu_metrics_t"][::std::mem::align_of::() - 8usize]; ["Offset of field: rsmi_gpu_metrics_t::common_header"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, common_header) - 0usize]; ["Offset of field: rsmi_gpu_metrics_t::temperature_edge"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, temperature_edge) - 4usize]; ["Offset of field: rsmi_gpu_metrics_t::temperature_hotspot"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, temperature_hotspot) - 6usize]; ["Offset of field: rsmi_gpu_metrics_t::temperature_mem"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, temperature_mem) - 8usize]; ["Offset of field: rsmi_gpu_metrics_t::temperature_vrgfx"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, temperature_vrgfx) - 10usize]; ["Offset of field: rsmi_gpu_metrics_t::temperature_vrsoc"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, temperature_vrsoc) - 12usize]; ["Offset of field: rsmi_gpu_metrics_t::temperature_vrmem"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, temperature_vrmem) - 14usize]; ["Offset of field: rsmi_gpu_metrics_t::average_gfx_activity"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, average_gfx_activity) - 16usize]; ["Offset of field: rsmi_gpu_metrics_t::average_umc_activity"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, average_umc_activity) - 18usize]; ["Offset of field: rsmi_gpu_metrics_t::average_mm_activity"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, average_mm_activity) - 20usize]; ["Offset of field: rsmi_gpu_metrics_t::average_socket_power"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, average_socket_power) - 22usize]; ["Offset of field: rsmi_gpu_metrics_t::energy_accumulator"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, energy_accumulator) - 24usize]; ["Offset of field: rsmi_gpu_metrics_t::system_clock_counter"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, system_clock_counter) - 32usize]; ["Offset of field: rsmi_gpu_metrics_t::average_gfxclk_frequency"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, average_gfxclk_frequency) - 40usize]; ["Offset of field: rsmi_gpu_metrics_t::average_socclk_frequency"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, average_socclk_frequency) - 42usize]; ["Offset of field: rsmi_gpu_metrics_t::average_uclk_frequency"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, average_uclk_frequency) - 44usize]; ["Offset of field: rsmi_gpu_metrics_t::average_vclk0_frequency"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, average_vclk0_frequency) - 46usize]; ["Offset of field: rsmi_gpu_metrics_t::average_dclk0_frequency"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, average_dclk0_frequency) - 48usize]; ["Offset of field: rsmi_gpu_metrics_t::average_vclk1_frequency"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, average_vclk1_frequency) - 50usize]; ["Offset of field: rsmi_gpu_metrics_t::average_dclk1_frequency"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, average_dclk1_frequency) - 52usize]; ["Offset of field: rsmi_gpu_metrics_t::current_gfxclk"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, current_gfxclk) - 54usize]; ["Offset of field: rsmi_gpu_metrics_t::current_socclk"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, current_socclk) - 56usize]; ["Offset of field: rsmi_gpu_metrics_t::current_uclk"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, current_uclk) - 58usize]; ["Offset of field: rsmi_gpu_metrics_t::current_vclk0"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, current_vclk0) - 60usize]; ["Offset of field: rsmi_gpu_metrics_t::current_dclk0"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, current_dclk0) - 62usize]; ["Offset of field: rsmi_gpu_metrics_t::current_vclk1"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, current_vclk1) - 64usize]; ["Offset of field: rsmi_gpu_metrics_t::current_dclk1"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, current_dclk1) - 66usize]; ["Offset of field: rsmi_gpu_metrics_t::throttle_status"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, throttle_status) - 68usize]; ["Offset of field: rsmi_gpu_metrics_t::current_fan_speed"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, current_fan_speed) - 72usize]; ["Offset of field: rsmi_gpu_metrics_t::pcie_link_width"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, pcie_link_width) - 74usize]; ["Offset of field: rsmi_gpu_metrics_t::pcie_link_speed"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, pcie_link_speed) - 76usize]; ["Offset of field: rsmi_gpu_metrics_t::gfx_activity_acc"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, gfx_activity_acc) - 80usize]; ["Offset of field: rsmi_gpu_metrics_t::mem_activity_acc"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, mem_activity_acc) - 84usize]; ["Offset of field: rsmi_gpu_metrics_t::temperature_hbm"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, temperature_hbm) - 88usize]; ["Offset of field: rsmi_gpu_metrics_t::firmware_timestamp"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, firmware_timestamp) - 96usize]; ["Offset of field: rsmi_gpu_metrics_t::voltage_soc"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, voltage_soc) - 104usize]; ["Offset of field: rsmi_gpu_metrics_t::voltage_gfx"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, voltage_gfx) - 106usize]; ["Offset of field: rsmi_gpu_metrics_t::voltage_mem"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, voltage_mem) - 108usize]; ["Offset of field: rsmi_gpu_metrics_t::indep_throttle_status"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, indep_throttle_status) - 112usize]; ["Offset of field: rsmi_gpu_metrics_t::current_socket_power"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, current_socket_power) - 120usize]; ["Offset of field: rsmi_gpu_metrics_t::vcn_activity"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, vcn_activity) - 122usize]; ["Offset of field: rsmi_gpu_metrics_t::gfxclk_lock_status"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, gfxclk_lock_status) - 132usize]; ["Offset of field: rsmi_gpu_metrics_t::xgmi_link_width"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, xgmi_link_width) - 136usize]; ["Offset of field: rsmi_gpu_metrics_t::xgmi_link_speed"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, xgmi_link_speed) - 138usize]; ["Offset of field: rsmi_gpu_metrics_t::pcie_bandwidth_acc"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, pcie_bandwidth_acc) - 144usize]; ["Offset of field: rsmi_gpu_metrics_t::pcie_bandwidth_inst"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, pcie_bandwidth_inst) - 152usize]; ["Offset of field: rsmi_gpu_metrics_t::pcie_l0_to_recov_count_acc"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, pcie_l0_to_recov_count_acc) - 160usize]; ["Offset of field: rsmi_gpu_metrics_t::pcie_replay_count_acc"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, pcie_replay_count_acc) - 168usize]; ["Offset of field: rsmi_gpu_metrics_t::pcie_replay_rover_count_acc"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, pcie_replay_rover_count_acc) - 176usize]; ["Offset of field: rsmi_gpu_metrics_t::xgmi_read_data_acc"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, xgmi_read_data_acc) - 184usize]; ["Offset of field: rsmi_gpu_metrics_t::xgmi_write_data_acc"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, xgmi_write_data_acc) - 248usize]; ["Offset of field: rsmi_gpu_metrics_t::current_gfxclks"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, current_gfxclks) - 312usize]; ["Offset of field: rsmi_gpu_metrics_t::current_socclks"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, current_socclks) - 328usize]; ["Offset of field: rsmi_gpu_metrics_t::current_vclk0s"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, current_vclk0s) - 336usize]; ["Offset of field: rsmi_gpu_metrics_t::current_dclk0s"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, current_dclk0s) - 344usize]; ["Offset of field: rsmi_gpu_metrics_t::jpeg_activity"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, jpeg_activity) - 352usize]; ["Offset of field: rsmi_gpu_metrics_t::pcie_nak_sent_count_acc"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, pcie_nak_sent_count_acc) - 416usize]; ["Offset of field: rsmi_gpu_metrics_t::pcie_nak_rcvd_count_acc"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, pcie_nak_rcvd_count_acc) - 420usize]; ["Offset of field: rsmi_gpu_metrics_t::accumulation_counter"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, accumulation_counter) - 424usize]; ["Offset of field: rsmi_gpu_metrics_t::prochot_residency_acc"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, prochot_residency_acc) - 432usize]; ["Offset of field: rsmi_gpu_metrics_t::ppt_residency_acc"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, ppt_residency_acc) - 440usize]; ["Offset of field: rsmi_gpu_metrics_t::socket_thm_residency_acc"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, socket_thm_residency_acc) - 448usize]; ["Offset of field: rsmi_gpu_metrics_t::vr_thm_residency_acc"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, vr_thm_residency_acc) - 456usize]; ["Offset of field: rsmi_gpu_metrics_t::hbm_thm_residency_acc"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, hbm_thm_residency_acc) - 464usize]; ["Offset of field: rsmi_gpu_metrics_t::num_partition"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, num_partition) - 472usize]; ["Offset of field: rsmi_gpu_metrics_t::xcp_stats"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, xcp_stats) - 480usize]; ["Offset of field: rsmi_gpu_metrics_t::pcie_lc_perf_other_end_recovery"] [::std::mem::offset_of!(rsmi_gpu_metrics_t, pcie_lc_perf_other_end_recovery) - 1824usize]; }; #[doc = " @brief This structure holds the name value pairs"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct rsmi_name_value_t { #[doc = "!< Name"] pub name: [::std::os::raw::c_char; 64usize], #[doc = "!< Use uint64_t to make it universal"] pub value: u64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rsmi_name_value_t"][::std::mem::size_of::() - 72usize]; ["Alignment of rsmi_name_value_t"][::std::mem::align_of::() - 8usize]; ["Offset of field: rsmi_name_value_t::name"] [::std::mem::offset_of!(rsmi_name_value_t, name) - 0usize]; ["Offset of field: rsmi_name_value_t::value"] [::std::mem::offset_of!(rsmi_name_value_t, value) - 64usize]; }; pub const rsmi_reg_type_t_RSMI_REG_XGMI: rsmi_reg_type_t = 0; pub const rsmi_reg_type_t_RSMI_REG_WAFL: rsmi_reg_type_t = 1; pub const rsmi_reg_type_t_RSMI_REG_PCIE: rsmi_reg_type_t = 2; pub const rsmi_reg_type_t_RSMI_REG_USR: rsmi_reg_type_t = 3; pub const rsmi_reg_type_t_RSMI_REG_USR1: rsmi_reg_type_t = 4; #[doc = " @brief This register type for register table"] pub type rsmi_reg_type_t = ::std::os::raw::c_uint; #[doc = " @brief This structure holds error counts."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct rsmi_error_count_t { #[doc = "!< Accumulated correctable errors"] pub correctable_err: u64, #[doc = "!< Accumulated uncorrectable errors"] pub uncorrectable_err: u64, #[doc = "!< Accumulated deferred errors"] pub deferred_err: u64, pub reserved: [u64; 5usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rsmi_error_count_t"][::std::mem::size_of::() - 64usize]; ["Alignment of rsmi_error_count_t"][::std::mem::align_of::() - 8usize]; ["Offset of field: rsmi_error_count_t::correctable_err"] [::std::mem::offset_of!(rsmi_error_count_t, correctable_err) - 0usize]; ["Offset of field: rsmi_error_count_t::uncorrectable_err"] [::std::mem::offset_of!(rsmi_error_count_t, uncorrectable_err) - 8usize]; ["Offset of field: rsmi_error_count_t::deferred_err"] [::std::mem::offset_of!(rsmi_error_count_t, deferred_err) - 16usize]; ["Offset of field: rsmi_error_count_t::reserved"] [::std::mem::offset_of!(rsmi_error_count_t, reserved) - 24usize]; }; #[doc = " @brief This structure holds ras feature"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct rsmi_ras_feature_info_t { pub ras_eeprom_version: u32, #[doc = "!< ecc_correction_schema mask"] pub ecc_correction_schema_flag: u32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rsmi_ras_feature_info_t"][::std::mem::size_of::() - 8usize]; ["Alignment of rsmi_ras_feature_info_t"] [::std::mem::align_of::() - 4usize]; ["Offset of field: rsmi_ras_feature_info_t::ras_eeprom_version"] [::std::mem::offset_of!(rsmi_ras_feature_info_t, ras_eeprom_version) - 0usize]; ["Offset of field: rsmi_ras_feature_info_t::ecc_correction_schema_flag"] [::std::mem::offset_of!(rsmi_ras_feature_info_t, ecc_correction_schema_flag) - 4usize]; }; #[doc = " @brief This structure contains information specific to a process."] #[repr(C)] #[derive(Debug, Copy, Clone, Default)] pub struct rsmi_process_info_t { #[doc = "!< Process ID"] pub process_id: u32, #[doc = "!< PASID: (Process Address Space ID)"] pub pasid: u32, #[doc = "!< VRAM usage"] pub vram_usage: u64, #[doc = "!< SDMA usage in microseconds"] pub sdma_usage: u64, #[doc = "!< Compute Unit usage in percent"] pub cu_occupancy: u32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rsmi_process_info_t"][::std::mem::size_of::() - 32usize]; ["Alignment of rsmi_process_info_t"][::std::mem::align_of::() - 8usize]; ["Offset of field: rsmi_process_info_t::process_id"] [::std::mem::offset_of!(rsmi_process_info_t, process_id) - 0usize]; ["Offset of field: rsmi_process_info_t::pasid"] [::std::mem::offset_of!(rsmi_process_info_t, pasid) - 4usize]; ["Offset of field: rsmi_process_info_t::vram_usage"] [::std::mem::offset_of!(rsmi_process_info_t, vram_usage) - 8usize]; ["Offset of field: rsmi_process_info_t::sdma_usage"] [::std::mem::offset_of!(rsmi_process_info_t, sdma_usage) - 16usize]; ["Offset of field: rsmi_process_info_t::cu_occupancy"] [::std::mem::offset_of!(rsmi_process_info_t, cu_occupancy) - 24usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct rsmi_process_info_v2_t { pub processId: u32, pub vramUsageSize: u64, pub vramUsageRate: f32, pub usedGpus: ::std::os::raw::c_int, pub gpuIndex: [::std::os::raw::c_int; 16usize], pub gpuUsageRate: [f32; 16usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rsmi_process_info_v2_t"][::std::mem::size_of::() - 152usize]; ["Alignment of rsmi_process_info_v2_t"] [::std::mem::align_of::() - 8usize]; ["Offset of field: rsmi_process_info_v2_t::processId"] [::std::mem::offset_of!(rsmi_process_info_v2_t, processId) - 0usize]; ["Offset of field: rsmi_process_info_v2_t::vramUsageSize"] [::std::mem::offset_of!(rsmi_process_info_v2_t, vramUsageSize) - 8usize]; ["Offset of field: rsmi_process_info_v2_t::vramUsageRate"] [::std::mem::offset_of!(rsmi_process_info_v2_t, vramUsageRate) - 16usize]; ["Offset of field: rsmi_process_info_v2_t::usedGpus"] [::std::mem::offset_of!(rsmi_process_info_v2_t, usedGpus) - 20usize]; ["Offset of field: rsmi_process_info_v2_t::gpuIndex"] [::std::mem::offset_of!(rsmi_process_info_v2_t, gpuIndex) - 24usize]; ["Offset of field: rsmi_process_info_v2_t::gpuUsageRate"] [::std::mem::offset_of!(rsmi_process_info_v2_t, gpuUsageRate) - 88usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct rsmi_func_id_iter_handle { _unused: [u8; 0], } #[doc = " @brief Opaque handle to function-support object"] pub type rsmi_func_id_iter_handle_t = *mut rsmi_func_id_iter_handle; #[doc = " @brief This structure contains information specific to a df bandwidth."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct rsmi_df_bandwidth_info_t { #[doc = "!< Read bandwidth"] pub read_bw: f64, #[doc = "!< Write bandwidth"] pub write_bw: f64, #[doc = "!< Read and write bandwidth"] pub read_write_bw: f64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rsmi_df_bandwidth_info_t"] [::std::mem::size_of::() - 24usize]; ["Alignment of rsmi_df_bandwidth_info_t"] [::std::mem::align_of::() - 8usize]; ["Offset of field: rsmi_df_bandwidth_info_t::read_bw"] [::std::mem::offset_of!(rsmi_df_bandwidth_info_t, read_bw) - 0usize]; ["Offset of field: rsmi_df_bandwidth_info_t::write_bw"] [::std::mem::offset_of!(rsmi_df_bandwidth_info_t, write_bw) - 8usize]; ["Offset of field: rsmi_df_bandwidth_info_t::read_write_bw"] [::std::mem::offset_of!(rsmi_df_bandwidth_info_t, read_write_bw) - 16usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct rsmi_umc_bandwidth_info_t { #[doc = "!< Read bandwidth"] pub read_bw: [f64; 32usize], #[doc = "!< Write bandwidth"] pub write_bw: [f64; 32usize], #[doc = "!< Read and write bandwidth"] pub read_write_bw: [f64; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rsmi_umc_bandwidth_info_t"] [::std::mem::size_of::() - 768usize]; ["Alignment of rsmi_umc_bandwidth_info_t"] [::std::mem::align_of::() - 8usize]; ["Offset of field: rsmi_umc_bandwidth_info_t::read_bw"] [::std::mem::offset_of!(rsmi_umc_bandwidth_info_t, read_bw) - 0usize]; ["Offset of field: rsmi_umc_bandwidth_info_t::write_bw"] [::std::mem::offset_of!(rsmi_umc_bandwidth_info_t, write_bw) - 256usize]; ["Offset of field: rsmi_umc_bandwidth_info_t::read_write_bw"] [::std::mem::offset_of!(rsmi_umc_bandwidth_info_t, read_write_bw) - 512usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct rsmi_xhcl_bandwidth_info_t { pub bw: [f64; 7usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rsmi_xhcl_bandwidth_info_t"] [::std::mem::size_of::() - 56usize]; ["Alignment of rsmi_xhcl_bandwidth_info_t"] [::std::mem::align_of::() - 8usize]; ["Offset of field: rsmi_xhcl_bandwidth_info_t::bw"] [::std::mem::offset_of!(rsmi_xhcl_bandwidth_info_t, bw) - 0usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct rsmi_pcie_bandwidth_info_t { #[doc = "!< Tx bandwidth"] pub tx_bw: f64, #[doc = "!< Rx bandwidth"] pub rx_bw: f64, #[doc = "!< TxRx bandwidth"] pub tx_rx_bw: f64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rsmi_pcie_bandwidth_info_t"] [::std::mem::size_of::() - 24usize]; ["Alignment of rsmi_pcie_bandwidth_info_t"] [::std::mem::align_of::() - 8usize]; ["Offset of field: rsmi_pcie_bandwidth_info_t::tx_bw"] [::std::mem::offset_of!(rsmi_pcie_bandwidth_info_t, tx_bw) - 0usize]; ["Offset of field: rsmi_pcie_bandwidth_info_t::rx_bw"] [::std::mem::offset_of!(rsmi_pcie_bandwidth_info_t, rx_bw) - 8usize]; ["Offset of field: rsmi_pcie_bandwidth_info_t::tx_rx_bw"] [::std::mem::offset_of!(rsmi_pcie_bandwidth_info_t, tx_rx_bw) - 16usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct rsmi_se_usage_info_t { pub percent: [f32; 8usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of rsmi_se_usage_info_t"][::std::mem::size_of::() - 32usize]; ["Alignment of rsmi_se_usage_info_t"][::std::mem::align_of::() - 4usize]; ["Offset of field: rsmi_se_usage_info_t::percent"] [::std::mem::offset_of!(rsmi_se_usage_info_t, percent) - 0usize]; }; #[doc = " @brief This union holds the value of an ::rsmi_func_id_iter_handle_t. The\n value may be a function name, or an ennumerated variant value of types\n such as ::rsmi_memory_type_t, ::rsmi_temperature_metric_t, etc."] #[repr(C)] #[derive(Copy, Clone)] pub union id { #[doc = "!< uint64_t representation of value"] pub id: u64, #[doc = "!< name string (applicable to functions only)"] pub name: *const ::std::os::raw::c_char, pub __bindgen_anon_1: id__bindgen_ty_1, } #[repr(C)] #[derive(Copy, Clone)] pub union id__bindgen_ty_1 { pub memory_type: rsmi_memory_type_t, pub temp_metric: rsmi_temperature_metric_t, pub evnt_type: rsmi_event_type_t, pub evnt_group: rsmi_event_group_t, pub clk_type: rsmi_clk_type_t, pub fw_block: rsmi_fw_block_t, pub gpu_block_type: rsmi_gpu_block_t, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of id__bindgen_ty_1"][::std::mem::size_of::() - 8usize]; ["Alignment of id__bindgen_ty_1"][::std::mem::align_of::() - 8usize]; ["Offset of field: id__bindgen_ty_1::memory_type"] [::std::mem::offset_of!(id__bindgen_ty_1, memory_type) - 0usize]; ["Offset of field: id__bindgen_ty_1::temp_metric"] [::std::mem::offset_of!(id__bindgen_ty_1, temp_metric) - 0usize]; ["Offset of field: id__bindgen_ty_1::evnt_type"] [::std::mem::offset_of!(id__bindgen_ty_1, evnt_type) - 0usize]; ["Offset of field: id__bindgen_ty_1::evnt_group"] [::std::mem::offset_of!(id__bindgen_ty_1, evnt_group) - 0usize]; ["Offset of field: id__bindgen_ty_1::clk_type"] [::std::mem::offset_of!(id__bindgen_ty_1, clk_type) - 0usize]; ["Offset of field: id__bindgen_ty_1::fw_block"] [::std::mem::offset_of!(id__bindgen_ty_1, fw_block) - 0usize]; ["Offset of field: id__bindgen_ty_1::gpu_block_type"] [::std::mem::offset_of!(id__bindgen_ty_1, gpu_block_type) - 0usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of id"][::std::mem::size_of::() - 8usize]; ["Alignment of id"][::std::mem::align_of::() - 8usize]; ["Offset of field: id::id"][::std::mem::offset_of!(id, id) - 0usize]; ["Offset of field: id::name"][::std::mem::offset_of!(id, name) - 0usize]; }; #[doc = " @brief This union holds the value of an ::rsmi_func_id_iter_handle_t. The\n value may be a function name, or an ennumerated variant value of types\n such as ::rsmi_memory_type_t, ::rsmi_temperature_metric_t, etc."] pub type rsmi_func_id_value_t = id; unsafe extern "C" { #[doc = "/\n/** @defgroup InitShutAdmin Initialization and Shutdown\n These functions are used for initialization of ROCm SMI and clean up when\n done.\n @{\n/\n/**\n @brief Initialize ROCm SMI.\n\n @details When called, this initializes internal data structures,\n including those corresponding to sources of information that SMI provides.\n\n @param[in] init_flags Bit flags that tell SMI how to initialze. Values of\n ::rsmi_init_flags_t may be OR'd together and passed through @p init_flags\n to modify how RSMI initializes.\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call."] pub fn rsmi_init(init_flags: u64) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Shutdown ROCm SMI.\n\n @details Do any necessary clean up."] pub fn rsmi_shut_down() -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get driver loading status\n\n @details The status could be not found, live, loading, unloading."] pub fn rsmi_driver_status(state: *mut rsmi_driver_state_t) -> rsmi_status_t; } unsafe extern "C" { #[doc = "/\n/** @defgroup IDQuer Identifier Queries\n These functions provide identification information.\n @{\n/\n/**\n @brief Get the number of devices that have monitor information.\n\n @details The number of devices which have monitors is returned. Monitors\n are referenced by the index which can be between 0 and @p num_devices - 1.\n\n @param[inout] num_devices Caller provided pointer to uint32_t. Upon\n successful call, the value num_devices will contain the number of monitor\n devices.\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call."] pub fn rsmi_num_monitor_devices(num_devices: *mut u32) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the device id associated with the device with provided device\n index.\n\n @details Given a device index @p dv_ind and a pointer to a uint32_t @p id,\n this function will write the device id value to the uint64_t pointed to by\n @p id. This ID is an identification of the type of device, so calling this\n function for different devices will give the same value if they are kind\n of device. Consequently, this function should not be used to distinguish\n one device from another. rsmi_dev_pci_id_get() should be used to get a\n unique identifier.\n\n @param[in] dv_ind a device index\n\n @param[inout] id a pointer to uint64_t to which the device id will be\n written\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_dev_id_get(dv_ind: u32, id: *mut u16) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the device revision associated with the device\n\n @details Given a device index @p dv_ind and a pointer to a uint32_t to\n which the revision will be written\n\n @param[in] dv_ind a device index\n\n @param[inout] revision a pointer to uint32_t to which the device revision\n will be written\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call.\n"] pub fn rsmi_dev_revision_get(dv_ind: u32, revision: *mut u16) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the SKU for a desired device associated with the device with\n provided device index.\n\n @details Given a device index @p dv_ind and a pointer to a char @p sku,\n this function will attempt to obtain the SKU from the Product Information\n FRU chip, present on server ASICs. It will write the sku value to the\n char array pointed to by @p sku.\n\n @param[in] dv_ind a device index\n\n @param[inout] sku a pointer to char to which the sku will be written\n\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_dev_sku_get(dv_ind: u32, sku: *mut u16) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the device vendor id associated with the device with provided\n device index.\n\n @details Given a device index @p dv_ind and a pointer to a uint32_t @p id,\n this function will write the device vendor id value to the uint64_t pointed\n to by @p id.\n\n @param[in] dv_ind a device index\n\n @param[inout] id a pointer to uint64_t to which the device vendor id will\n be written\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_dev_vendor_id_get(dv_ind: u32, id: *mut u16) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the name string for a give PCIe vendor ID\n\n @details Given a device index @p dv_ind, a pointer to a caller provided\n char buffer @p name, and a length of this buffer @p len, this function will\n write the name of the PCIe vendor (up to @p len characters) buffer @p name.\n\n If the integer ID associated with the PCIe vendor is not found in one of the\n system files containing device name information (e.g.\n /usr/share/misc/pci.ids), then this function will return RSMI_STATUS_NOT_FOUND.\n Updating the system name files can be accompplished with\n \"sudo update-pciids\".\n\n @param[in] dv_ind a device index\n\n @param[inout] name a pointer to a caller provided char buffer to which the\n name will be written\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @param[in] len the length of the caller provided buffer @p name.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n @retval ::RSMI_STATUS_NOT_FOUND the vnedor name are not found\n @retval ::RSMI_STATUS_INSUFFICIENT_SIZE is returned if @p len bytes is not\n large enough to hold the entire name. In this case, only @p len bytes will\n be written.\n"] pub fn rsmi_dev_pcie_vendor_name_get( dv_ind: u32, name: *mut ::std::os::raw::c_char, len: usize, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the name string of a gpu device.\n\n @details Given a device index @p dv_ind, a pointer to a caller provided\n char buffer @p name, and a length of this buffer @p len, this function\n will write the name of the device (up to @p len characters) to the buffer\n @p name.\n\n If the integer ID associated with the device is not found in one of the\n system files containing device name information (e.g.\n /usr/share/misc/pci.ids), then this function will return the hex device ID\n as a string. Updating the system name files can be accompplished with\n \"sudo update-pciids\".\n\n @param[in] dv_ind a device index\n\n @param[inout] name a pointer to a caller provided char buffer to which the\n name will be written\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @param[in] len the length of the caller provided buffer @p name.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n @retval ::RSMI_STATUS_INSUFFICIENT_SIZE is returned if @p len bytes is not\n large enough to hold the entire name. In this case, only @p len bytes will\n be written.\n"] pub fn rsmi_dev_name_get( dv_ind: u32, name: *mut ::std::os::raw::c_char, len: usize, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the brand string of a gpu device.\n\n @details Given a device index @p dv_ind, a pointer to a caller provided\n char buffer @p brand, and a length of this buffer @p len, this function\n will write the brand of the device (up to @p len characters) to the buffer\n @p brand.\n\n If the sku associated with the device is not found as one of the values\n contained within rsmi_dev_brand_get, then this function will return the\n device marketing name as a string instead of the brand name.\n\n @param[in] dv_ind a device index\n\n @param[inout] brand a pointer to a caller provided char buffer to which the\n brand will be written\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @param[in] len the length of the caller provided buffer @p brand.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n @retval ::RSMI_STATUS_INSUFFICIENT_SIZE is returned if @p len bytes is not\n large enough to hold the entire name. In this case, only @p len bytes will\n be written.\n"] pub fn rsmi_dev_brand_get( dv_ind: u32, brand: *mut ::std::os::raw::c_char, len: u32, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the name string for a give vendor ID\n\n @details Given a device index @p dv_ind, a pointer to a caller provided\n char buffer @p name, and a length of this buffer @p len, this function will\n write the name of the vendor (up to @p len characters) buffer @p name. The\n @p id may be a device vendor or subsystem vendor ID.\n\n If the integer ID associated with the vendor is not found in one of the\n system files containing device name information (e.g.\n /usr/share/misc/pci.ids), then this function will return the hex vendor ID\n as a string. Updating the system name files can be accompplished with\n \"sudo update-pciids\".\n\n @param[in] dv_ind a device index\n\n @param[inout] name a pointer to a caller provided char buffer to which the\n name will be written\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @param[in] len the length of the caller provided buffer @p name.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n @retval ::RSMI_STATUS_INSUFFICIENT_SIZE is returned if @p len bytes is not\n large enough to hold the entire name. In this case, only @p len bytes will\n be written.\n"] pub fn rsmi_dev_vendor_name_get( dv_ind: u32, name: *mut ::std::os::raw::c_char, len: usize, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the vram vendor string of a gpu device.\n\n @details Given a device index @p dv_ind, a pointer to a caller provided\n char buffer @p brand, and a length of this buffer @p len, this function\n will write the vram vendor of the device (up to @p len characters) to the\n buffer @p brand.\n\n If the vram vendor for the device is not found as one of the values\n contained within rsmi_dev_vram_vendor_get, then this function will return\n the string 'unknown' instead of the vram vendor.\n\n @param[in] dv_ind a device index\n\n @param[inout] brand a pointer to a caller provided char buffer to which the\n vram vendor will be written\n\n @param[in] len the length of the caller provided buffer @p brand.\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call.\n"] pub fn rsmi_dev_vram_vendor_get( dv_ind: u32, brand: *mut ::std::os::raw::c_char, len: u32, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the PCIe slot type of a gpu device.\n\n @details Given a device index @p dv_ind, a pointer to a caller provided\n char buffer @p type, this function will write the PCIe slot type of the\n device to @p type.\n\n\n @param[in] dv_ind a device index\n\n @param[inout] type a pointer to a caller provided buffer to which the\n type info will be written\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call.\n"] pub fn rsmi_dev_pcie_slot_type_get( dv_ind: u32, type_: *mut rsmi_pcie_slot_type_t, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the serial number string for a device\n\n @details Given a device index @p dv_ind, a pointer to a buffer of chars\n @p serial_num, and the length of the provided buffer @p len, this function\n will write the serial number string (up to @p len characters) to the buffer\n pointed to by @p serial_num.\n\n @param[in] dv_ind a device index\n\n @param[inout] serial_num a pointer to caller-provided memory to which the\n serial number will be written\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @param[in] len the length of the caller provided buffer @p serial_num.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n @retval ::RSMI_STATUS_INSUFFICIENT_SIZE is returned if @p len bytes is not\n large enough to hold the entire name. In this case, only @p len bytes will\n be written.\n"] pub fn rsmi_dev_serial_number_get( dv_ind: u32, serial_num: *mut ::std::os::raw::c_char, len: u32, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the subsystem device id associated with the device with\n provided device index.\n\n @details Given a device index @p dv_ind and a pointer to a uint32_t @p id,\n this function will write the subsystem device id value to the uint64_t\n pointed to by @p id.\n\n @param[in] dv_ind a device index\n\n @param[inout] id a pointer to uint64_t to which the subsystem device id\n will be written\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_dev_subsystem_id_get(dv_ind: u32, id: *mut u16) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the name string for the device subsytem\n\n @details Given a device index @p dv_ind, a pointer to a caller provided\n char buffer @p name, and a length of this buffer @p len, this function\n will write the name of the device subsystem (up to @p len characters)\n to the buffer @p name.\n\n If the integer ID associated with the sub-system is not found in one of the\n system files containing device name information (e.g.\n /usr/share/misc/pci.ids), then this function will return the hex sub-system\n ID as a string. Updating the system name files can be accompplished with\n \"sudo update-pciids\".\n\n @param[in] dv_ind a device index\n\n @param[inout] name a pointer to a caller provided char buffer to which the\n name will be written\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @param[in] len the length of the caller provided buffer @p name.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n @retval ::RSMI_STATUS_INSUFFICIENT_SIZE is returned if @p len bytes is not\n large enough to hold the entire name. In this case, only @p len bytes will\n be written.\n"] pub fn rsmi_dev_subsystem_name_get( dv_ind: u32, name: *mut ::std::os::raw::c_char, len: usize, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the drm minor number associated with this device\n\n @details Given a device index @p dv_ind, find its render device file\n /dev/dri/renderDN where N corresponds to its minor number.\n\n @param[in] dv_ind a device index\n\n @param[inout] minor a pointer to a uint32_t into which minor number will\n be copied\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call.\n @retval ::RSMI_STATUS_INIT_ERROR if failed to get minor number during\n initialization.\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_dev_drm_render_minor_get(dv_ind: u32, minor: *mut u32) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the device subsystem vendor id associated with the device with\n provided device index.\n\n @details Given a device index @p dv_ind and a pointer to a uint32_t @p id,\n this function will write the device subsystem vendor id value to the\n uint64_t pointed to by @p id.\n\n @param[in] dv_ind a device index\n\n @param[inout] id a pointer to uint64_t to which the device subsystem vendor\n id will be written\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid"] pub fn rsmi_dev_subsystem_vendor_id_get(dv_ind: u32, id: *mut u16) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get Unique ID\n\n @details Given a device index @p dv_ind and a pointer to a uint64_t @p\n id, this function will write the unique ID of the GPU pointed to @p\n id.\n\n @param[in] dv_ind a device index\n\n @param[inout] id a pointer to uint64_t to which the unique ID of the GPU\n is written\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid"] pub fn rsmi_dev_unique_id_get(dv_ind: u32, id: *mut u64) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the XGMI physical id associated with the device\n\n @details Given a device index @p dv_ind and a pointer to a uint32_t to\n which the XGMI physical id will be written\n\n @param[in] dv_ind a device index\n\n @param[inout] id a pointer to uint32_t to which the XGMI physical id\n will be written\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call.\n"] pub fn rsmi_dev_xgmi_physical_id_get(dv_ind: u32, id: *mut u16) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the GUID, also known as the GPU device id,\n associated with the provided device index indicated by KFD.\n\n @details Given a device index @p dv_ind and a pointer to a uint64_t\n @p guid, this function will write the KFD GPU id value to the\n uint64_t pointed to by @p guid.\n\n @param[in] dv_ind a device index\n\n @param[inout] guid a pointer to uint64_t to which the KFD gpu id will be\n written. If the @p guid parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS. If the GPU ID is not supported with\n the device index queried, gpu_id will return MAX UINT64 value an\n arguments and ::RSMI_STATUS_NOT_SUPPORTED as a response.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_dev_guid_get(dv_ind: u32, guid: *mut u64) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the node id associated with the provided device index\n indicated by KFD.\n\n @details Given a device index @p dv_ind and a pointer to a uint32_t\n @p node_id, this function will write the KFD node id value to the\n uint32_t pointed to by @p node_id.\n\n @param[in] dv_ind a device index\n\n @param[inout] node_id a pointer to uint64_t to which the KFD gpu id will be\n written. If the @p node_id parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS. If @p node_id is not supported with\n the device index queried, @p node_id will return MAX UINT64 value as an\n argument and ::RSMI_STATUS_NOT_SUPPORTED as a response.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_dev_node_id_get(dv_ind: u32, node_id: *mut u32) -> rsmi_status_t; } unsafe extern "C" { #[doc = "/\n/** @defgroup PCIeQuer PCIe Queries\n These functions provide information about PCIe.\n @{\n/\n/**\n @brief Get the list of possible PCIe bandwidths that are available.\n\n @details Given a device index @p dv_ind and a pointer to a to an\n ::rsmi_pcie_bandwidth_t structure @p bandwidth, this function will fill in\n @p bandwidth with the possible T/s values and associated number of lanes,\n and indication of the current selection.\n\n @param[in] dv_ind a device index\n\n @param[inout] bandwidth a pointer to a caller provided\n ::rsmi_pcie_bandwidth_t structure to which the frequency information will be\n written\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call.\n @retval ::RSMI_STATUS_UNEXPECTED_DATA Data read or provided was not as\n expected\n"] pub fn rsmi_dev_pci_bandwidth_get( dv_ind: u32, bandwidth: *mut rsmi_pcie_bandwidth_t, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the unique PCI device identifier associated for a device\n\n @details Give a device index @p dv_ind and a pointer to a uint64_t @p\n bdfid, this function will write the Bus/Device/Function PCI identifier\n (BDFID) associated with device @p dv_ind to the value pointed to by\n @p bdfid.\n\n The format of @p bdfid will be as follows:\n\n BDFID = ((DOMAIN & 0xFFFFFFFF) << 32) | ((Partition & 0xF) << 28)\n | ((BUS & 0xFF) << 8) | ((DEVICE & 0x1F) <<3 )\n | (FUNCTION & 0x7)\n\n | Name | Field | KFD property KFD -> PCIe ID (uint64_t)\n -------------- | ------- | ---------------- | ---------------------------- |\n | Domain | [63:32] | \"domain\" | (DOMAIN & 0xFFFFFFFF) << 32 |\n | Partition id | [31:28] | \"location id\" | (LOCATION & 0xF0000000) |\n | Reserved | [27:16] | \"location id\" | N/A |\n | Bus | [15: 8] | \"location id\" | (LOCATION & 0xFF00) |\n | Device | [ 7: 3] | \"location id\" | (LOCATION & 0xF8) |\n | Function | [ 2: 0] | \"location id\" | (LOCATION & 0x7) |\n\n @param[in] dv_ind a device index\n\n @param[inout] bdfid a pointer to uint64_t to which the device bdfid value\n will be written\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid"] pub fn rsmi_dev_pci_id_get(dv_ind: u32, bdfid: *mut u64) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the NUMA node associated with a device\n\n @details Given a device index @p dv_ind and a pointer to a uint32_t @p\n numa_node, this function will retrieve the NUMA node value associated\n with device @p dv_ind and store the value at location pointed to by\n @p numa_node.\n\n @param[in] dv_ind a device index\n\n @param[inout] numa_node pointer to location where NUMA node value will\n be written.\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid"] pub fn rsmi_topo_numa_affinity_get(dv_ind: u32, numa_node: *mut i32) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get PCIe traffic information\n\n @details Give a device index @p dv_ind and pointers to a uint64_t's, @p\n sent, @p received and @p max_pkt_sz, this function will write the number\n of bytes sent and received in 1 second to @p sent and @p received,\n respectively. The maximum possible packet size will be written to\n @p max_pkt_sz.\n\n @param[in] dv_ind a device index\n\n @param[inout] sent a pointer to uint64_t to which the number of bytes sent\n will be written in 1 second. If pointer is NULL, it will be ignored.\n\n @param[inout] received a pointer to uint64_t to which the number of bytes\n received will be written. If pointer is NULL, it will be ignored.\n\n @param[inout] max_pkt_sz a pointer to uint64_t to which the maximum packet\n size will be written. If pointer is NULL, it will be ignored.\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call.\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments"] pub fn rsmi_dev_pci_throughput_get( dv_ind: u32, sent: *mut u64, received: *mut u64, max_pkt_sz: *mut u64, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get PCIe replay counter\n\n @details Given a device index @p dv_ind and a pointer to a uint64_t @p\n counter, this function will write the sum of the number of NAK's received\n by the GPU and the NAK's generated by the GPU to memory pointed to by @p\n counter.\n\n @param[in] dv_ind a device index\n\n @param[inout] counter a pointer to uint64_t to which the sum of the NAK's\n received and generated by the GPU is written\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid"] pub fn rsmi_dev_pci_replay_counter_get(dv_ind: u32, counter: *mut u64) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Control the set of allowed PCIe bandwidths that can be used.\n\n @details Given a device index @p dv_ind and a 64 bit bitmask @p bw_bitmask,\n this function will limit the set of allowable bandwidths. If a bit in @p\n bw_bitmask has a value of 1, then the frequency (as ordered in an\n ::rsmi_frequencies_t returned by ::rsmi_dev_gpu_clk_freq_get()) corresponding\n to that bit index will be allowed.\n\n This function will change the performance level to\n ::RSMI_DEV_PERF_LEVEL_MANUAL in order to modify the set of allowable\n band_widths. Caller will need to set to ::RSMI_DEV_PERF_LEVEL_AUTO in order\n to get back to default state.\n\n All bits with indices greater than or equal to the value of the\n ::rsmi_frequencies_t::num_supported field of ::rsmi_pcie_bandwidth_t will be\n ignored.\n\n @param[in] dv_ind a device index\n\n @param[in] bw_bitmask A bitmask indicating the indices of the\n bandwidths that are to be enabled (1) and disabled (0). Only the lowest\n ::rsmi_frequencies_t::num_supported (of ::rsmi_pcie_bandwidth_t) bits of\n this mask are relevant.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_PERMISSION function requires root access\n"] pub fn rsmi_dev_pci_bandwidth_set(dv_ind: u32, bw_bitmask: u64) -> rsmi_status_t; } unsafe extern "C" { #[doc = "/\n/** @defgroup PowerQuer Power Queries\n These functions provide information about power usage.\n @{\n/\n/**\n @brief Get the average power consumption of the device with provided\n device index.\n\n @details Given a device index @p dv_ind and a pointer to a uint64_t\n @p power, this function will write the current average power consumption\n (in microwatts) to the uint64_t pointed to by @p power.\n\n @deprecated ::rsmi_dev_power_get() is preferred due to providing\n backwards compatibility, which looks at both average and current power\n values. Whereas ::rsmi_dev_power_ave_get only looks for average power\n consumption. Newer ASICs will support current power only.\n\n @param[in] dv_ind a device index\n\n @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0.\n If a device has more than one sensor, it could be greater than 0.\n\n @param[inout] power a pointer to uint64_t to which the average power\n consumption will be written\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid"] pub fn rsmi_dev_power_ave_get(dv_ind: u32, sensor_ind: u32, power: *mut u64) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the current socket power (also known as instant\n power) of the device index provided.\n\n @details Given a device index @p dv_ind and a pointer to a uint64_t\n @p socket_power, this function will write the current socket power\n (in microwatts) to the uint64_t pointed to by @p socket_power.\n\n @param[in] dv_ind a device index\n\n @param[inout] socket_power a pointer to uint64_t to which the current\n socket power will be written to. If this parameter is nullptr,\n this function will return ::RSMI_STATUS_INVALID_ARGS if the function is\n supported with the provided, arguments and ::RSMI_STATUS_NOT_SUPPORTED\n if it is not supported with the provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid"] pub fn rsmi_dev_current_socket_power_get(dv_ind: u32, socket_power: *mut u64) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief A generic get which attempts to retieve current socket power\n (also known as instant power) of the device index provided, if not\n supported tries to get average power consumed by device. Current\n socket power is typically supported by newer devices, whereas average\n power is generally reported on older devices. This function\n aims to provide backwards compatability depending on device support.\n\n @details Given a device index @p dv_ind, a pointer to a uint64_t\n @p power, and @p type this function will write the current socket or\n average power (in microwatts) to the uint64_t pointed to by @p power and\n a pointer to its @p type RSMI_POWER_TYPE read.\n\n @param[in] dv_ind a device index\n\n @param[inout] power a pointer to uint64_t to which the current or average\n power will be written to. If this parameter is nullptr,\n this function will return ::RSMI_STATUS_INVALID_ARGS if the function is\n supported with the provided, arguments and ::RSMI_STATUS_NOT_SUPPORTED\n if it is not supported with the provided arguments.\n\n @param[inout] type a pointer to RSMI_POWER_TYPE object. Returns the type\n of power retrieved from the device. Current power is ::RSMI_CURRENT_POWER\n and average power is ::RSMI_AVERAGE_POWER. If an error occurs,\n returns an invalid power type ::RSMI_INVALID_POWER - example device\n neither supports average power or current power.\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid"] pub fn rsmi_dev_power_get( dv_ind: u32, power: *mut u64, type_: *mut RSMI_POWER_TYPE, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the energy accumulator counter of the device with provided\n device index.\n\n @details Given a device index @p dv_ind, a pointer to a uint64_t\n @p power, and a pointer to a uint64_t @p timestamp, this function will write\n amount of energy consumed to the uint64_t pointed to by @p power,\n and the timestamp to the uint64_t pointed to by @p timestamp.\n The rsmi_dev_power_ave_get() is an average of a short time. This function\n accumulates all energy consumed.\n\n @param[in] dv_ind a device index\n @param[inout] counter_resolution resolution of the counter @p power in\n micro Joules\n\n @param[inout] power a pointer to uint64_t to which the energy\n counter will be written\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @param[inout] timestamp a pointer to uint64_t to which the timestamp\n will be written. Resolution: 1 ns.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid"] pub fn rsmi_dev_energy_count_get( dv_ind: u32, power: *mut u64, counter_resolution: *mut f32, timestamp: *mut u64, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the cap on power which, when reached, causes the system to take\n action to reduce power.\n\n @details When power use rises above the value @p power, the system will\n take action to reduce power use. The power level returned through\n @p power will be in microWatts.\n\n @param[in] dv_ind a device index\n\n @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0.\n If a device has more than one sensor, it could be greater than 0.\n\n @param[inout] cap a pointer to a uint64_t that indicates the power cap,\n in microwatts\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid"] pub fn rsmi_dev_power_cap_get(dv_ind: u32, sensor_ind: u32, cap: *mut u64) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the default power cap for the device specified by @p dv_ind.\n\n @details The maximum power cap be temporarily changed by the user. However,\n this function always returns the default reset power cap. The power level\n returned through @p power will be in microWatts.\n\n @param[in] dv_ind a device index\n\n @param[inout] default_cap a pointer to a uint64_t that indicates the default\n power cap, in microwatts\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid"] pub fn rsmi_dev_power_cap_default_get(dv_ind: u32, default_cap: *mut u64) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the range of valid values for the power cap\n\n @details This function will return the maximum possible valid power cap\n @p max and the minimum possible valid power cap @p min\n\n @param[in] dv_ind a device index\n\n @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0.\n If a device has more than one sensor, it could be greater than 0.\n\n @param[inout] max a pointer to a uint64_t that indicates the maximum\n possible power cap, in microwatts\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @param[inout] min a pointer to a uint64_t that indicates the minimum\n possible power cap, in microwatts\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_dev_power_cap_range_get( dv_ind: u32, sensor_ind: u32, max: *mut u64, min: *mut u64, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = "/\n/** @defgroup PowerCont Power Control\n These functions provide ways to control power usage.\n @{\n/\n/**\n @brief Set the power cap value\n\n @details This function will set the power cap to the provided value @p cap.\n @p cap must be between the minimum and maximum power cap values set by the\n system, which can be obtained from ::rsmi_dev_power_cap_range_get.\n\n @param[in] dv_ind a device index\n\n @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0.\n If a device has more than one sensor, it could be greater than 0.\n\n @param[in] cap a uint64_t that indicates the desired power cap, in\n microwatts\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call.\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n @retval ::RSMI_STATUS_PERMISSION function requires root access\n"] pub fn rsmi_dev_power_cap_set(dv_ind: u32, sensor_ind: u32, cap: u64) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Set the power profile\n\n @details Given a device index @p dv_ind and a @p profile, this function will\n attempt to set the current profile to the provided profile. The provided\n profile must be one of the currently supported profiles, as indicated by a\n call to ::rsmi_dev_power_profile_presets_get()\n\n @param[in] dv_ind a device index\n\n @param[in] reserved Not currently used. Set to 0.\n\n @param[in] profile a ::rsmi_power_profile_preset_masks_t that hold the mask\n of the desired new power profile\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call.\n @retval ::RSMI_STATUS_PERMISSION function requires root access\n"] pub fn rsmi_dev_power_profile_set( dv_ind: u32, reserved: u32, profile: rsmi_power_profile_preset_masks_t, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the total amount of memory that exists\n\n @details Given a device index @p dv_ind, a type of memory @p mem_type, and\n a pointer to a uint64_t @p total, this function will write the total amount\n of @p mem_type memory that exists to the location pointed to by @p total.\n\n @param[in] dv_ind a device index\n\n @param[in] mem_type The type of memory for which the total amount will be\n found\n\n @param[inout] total a pointer to uint64_t to which the total amount of\n memory will be written\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_dev_memory_total_get( dv_ind: u32, mem_type: rsmi_memory_type_t, total: *mut u64, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get gpu cache info.\n\n @details Given a device index @p dv_ind, and a pointer to a cache\n info @p info, this function will write the cache size and level\n to the location pointed to by @p info.\n @param[in] dv_ind a device index\n\n @param[inout] info reference to the cache info struct.\n Must be allocated by user.\n\n @return ::rsmi_status_t | ::RSMI_STATUS_SUCCESS on success, non-zero on fail"] pub fn rsmi_dev_cache_info_get(dv_ind: u32, info: *mut rsmi_gpu_cache_info_t) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the current memory usage\n\n @details Given a device index @p dv_ind, a type of memory @p mem_type, and\n a pointer to a uint64_t @p usage, this function will write the amount of\n @p mem_type memory that that is currently being used to the location\n pointed to by @p used.\n\n @param[in] dv_ind a device index\n\n @param[in] mem_type The type of memory for which the amount being used will\n be found\n\n @param[inout] used a pointer to uint64_t to which the amount of memory\n currently being used will be written\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_dev_memory_usage_get( dv_ind: u32, mem_type: rsmi_memory_type_t, used: *mut u64, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get percentage of time any device memory is being used\n\n @details Given a device index @p dv_ind, this function returns the\n percentage of time that any device memory is being used for the specified\n device.\n\n @param[in] dv_ind a device index\n\n @param[inout] busy_percent a pointer to the uint32_t to which the busy\n percent will be written\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_dev_memory_busy_percent_get(dv_ind: u32, busy_percent: *mut u32) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get information about reserved (\"retired\") memory pages\n\n @details Given a device index @p dv_ind, this function returns retired page\n information @p records corresponding to the device with the provided device\n index @p dv_ind. The number of retired page records is returned through @p\n num_pages. @p records may be NULL on input. In this case, the number of\n records available for retrieval will be returned through @p num_pages.\n\n @param[in] dv_ind a device index\n\n @param[inout] num_pages a pointer to a uint32. As input, the value passed\n through this parameter is the number of ::rsmi_retired_page_record_t's that\n may be safely written to the memory pointed to by @p records. This is the\n limit on how many records will be written to @p records. On return, @p\n num_pages will contain the number of records written to @p records, or the\n number of records that could have been written if enough memory had been\n provided.\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @param[inout] records A pointer to a block of memory to which the\n ::rsmi_retired_page_record_t values will be written. This value may be NULL.\n In this case, this function can be used to query how many records are\n available to read.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n @retval ::RSMI_STATUS_INSUFFICIENT_SIZE is returned if more records were available\n than allowed by the provided, allocated memory."] pub fn rsmi_dev_memory_reserved_pages_get( dv_ind: u32, num_pages: *mut u32, records: *mut rsmi_retired_page_record_t, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @defgroup PhysQuer Physical State Queries\n These functions provide information about the physical characteristics of\n the device.\n @{\n/\n/**\n @brief Get the fan speed in RPMs of the device with the specified device\n index and 0-based sensor index.\n\n @details Given a device index @p dv_ind and a pointer to a uint32_t\n @p speed, this function will write the current fan speed in RPMs to the\n uint32_t pointed to by @p speed\n\n @param[in] dv_ind a device index\n\n @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0.\n If a device has more than one sensor, it could be greater than 0.\n\n @param[inout] speed a pointer to uint32_t to which the speed will be\n written\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_dev_fan_rpms_get(dv_ind: u32, sensor_ind: u32, speed: *mut i64) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the fan speed for the specified device as a value relative to\n ::RSMI_MAX_FAN_SPEED\n\n @details Given a device index @p dv_ind and a pointer to a uint32_t\n @p speed, this function will write the current fan speed (a value\n between 0 and the maximum fan speed, ::RSMI_MAX_FAN_SPEED) to the uint32_t\n pointed to by @p speed\n\n @param[in] dv_ind a device index\n\n @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0.\n If a device has more than one sensor, it could be greater than 0.\n\n @param[inout] speed a pointer to uint32_t to which the speed will be\n written\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_dev_fan_speed_get(dv_ind: u32, sensor_ind: u32, speed: *mut i64) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the max. fan speed of the device with provided device index.\n\n @details Given a device index @p dv_ind and a pointer to a uint32_t\n @p max_speed, this function will write the maximum fan speed possible to\n the uint32_t pointed to by @p max_speed\n\n @param[in] dv_ind a device index\n\n @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0.\n If a device has more than one sensor, it could be greater than 0.\n\n @param[inout] max_speed a pointer to uint32_t to which the maximum speed\n will be written\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_dev_fan_speed_max_get( dv_ind: u32, sensor_ind: u32, max_speed: *mut u64, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the temperature metric value for the specified metric, from the\n specified temperature sensor on the specified device.\n\n @details Given a device index @p dv_ind, a sensor type @p sensor_type, a\n ::rsmi_temperature_metric_t @p metric and a pointer to an int64_t @p\n temperature, this function will write the value of the metric indicated by\n @p metric and @p sensor_type to the memory location @p temperature.\n\n @param[in] dv_ind a device index\n\n @param[in] sensor_type part of device from which temperature should be\n obtained. This should come from the enum ::rsmi_temperature_type_t\n\n @param[in] metric enum indicated which temperature value should be\n retrieved\n\n @param[inout] temperature a pointer to int64_t to which the temperature\n will be written, in millidegrees Celcius.\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_dev_temp_metric_get( dv_ind: u32, sensor_type: u32, metric: rsmi_temperature_metric_t, temperature: *mut i64, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the voltage metric value for the specified metric, from the\n specified voltage sensor on the specified device.\n\n @details Given a device index @p dv_ind, a sensor type @p sensor_type, a\n ::rsmi_voltage_metric_t @p metric and a pointer to an int64_t @p\n voltage, this function will write the value of the metric indicated by\n @p metric and @p sensor_type to the memory location @p voltage.\n\n @param[in] dv_ind a device index\n\n @param[in] sensor_type part of device from which voltage should be\n obtained. This should come from the enum ::rsmi_voltage_type_t\n\n @param[in] metric enum indicated which voltage value should be\n retrieved\n\n @param[inout] voltage a pointer to int64_t to which the voltage\n will be written, in millivolts.\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_dev_volt_metric_get( dv_ind: u32, sensor_type: rsmi_voltage_type_t, metric: rsmi_voltage_metric_t, voltage: *mut i64, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = "/\n/** @defgroup PhysCont Physical State Control\n These functions provide control over the physical state of a device.\n @{\n/\n/**\n @brief Reset the fan to automatic driver control\n\n @details This function returns control of the fan to the system\n\n @param[in] dv_ind a device index\n\n @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0.\n If a device has more than one sensor, it could be greater than 0.\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call.\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n"] pub fn rsmi_dev_fan_reset(dv_ind: u32, sensor_ind: u32) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Set the fan speed for the specified device with the provided speed,\n in RPMs.\n\n @details Given a device index @p dv_ind and a integer value indicating\n speed @p speed, this function will attempt to set the fan speed to @p speed.\n An error will be returned if the specified speed is outside the allowable\n range for the device. The maximum value is 255 and the minimum is 0.\n\n @param[in] dv_ind a device index\n\n @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0.\n If a device has more than one sensor, it could be greater than 0.\n\n @param[in] speed the speed to which the function will attempt to set the fan\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call.\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_PERMISSION function requires root access\n"] pub fn rsmi_dev_fan_speed_set(dv_ind: u32, sensor_ind: u32, speed: u64) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get percentage of time device is busy doing any processing\n\n @details Given a device index @p dv_ind, this function returns the\n percentage of time that the specified device is busy. The device is\n considered busy if any one or more of its sub-blocks are working, and idle\n if none of the sub-blocks are working.\n\n @param[in] dv_ind a device index\n\n @param[inout] busy_percent a pointer to the uint32_t to which the busy\n percent will be written\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_dev_busy_percent_get(dv_ind: u32, busy_percent: *mut u32) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get coarse grain utilization counter of the specified device\n\n @details Given a device index @p dv_ind, the array of the utilization counters,\n the size of the array, this function returns the coarse grain utilization counters\n and timestamp.\n The counter is the accumulated percentages. Every milliseconds the firmware calculates\n % busy count and then accumulates that value in the counter. This provides minimally\n invasive coarse grain GPU usage information.\n\n @param[in] dv_ind a device index\n\n @param[inout] utilization_counters Multiple utilization counters can be retreived with a single\n call. The caller must allocate enough space to the utilization_counters array. The caller also\n needs to set valid RSMI_UTILIZATION_COUNTER_TYPE type for each element of the array.\n ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the provided arguments.\n\n If the function reutrns RSMI_STATUS_SUCCESS, the counter will be set in the value field of\n the rsmi_utilization_counter_t.\n\n @param[in] count The size of utilization_counters array.\n\n @param[inout] timestamp The timestamp when the counter is retreived. Resolution: 1 ns.\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_utilization_count_get( dv_ind: u32, utilization_counters: *mut rsmi_utilization_counter_t, count: u32, timestamp: *mut u64, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get activity metric average utilization counter of the specified device\n\n @details Given a device index @p dv_ind, the activity metric type,\n this function returns the requested utilization counters\n\n @param[in] dv_ind a device index\n\n @param[in] activity_metric_type a metric type\n\n @param[inout] activity_metric_counter Multiple utilization counters can be retrieved with a single\n call. The caller must allocate enough space to the rsmi_activity_metric_counter_t structure.\n\n If the function returns RSMI_STATUS_SUCCESS, the requested type will be set in the corresponding\n field of the counter will be set in the value field of\n the activity_metric_counter_t.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_dev_activity_metric_get( dv_ind: u32, activity_metric_type: rsmi_activity_metric_t, activity_metric_counter: *mut rsmi_activity_metric_counter_t, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get activity metric bandwidth average utilization counter of the specified device\n\n @details Given a device index @p dv_ind, the activity metric type,\n this function returns the requested utilization counters\n\n @param[in] dv_ind a device index\n\n @param[inout] avg_activity average bandwidth utilization counters can be retrieved\n\n If the function returns RSMI_STATUS_SUCCESS, the requested type will be set in the corresponding\n field of the counter will be set in the value field of\n the activity_metric_counter_t.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_dev_activity_avg_mm_get(dv_ind: u32, avg_activity: *mut u16) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the performance level of the device with provided\n device index.\n\n @details Given a device index @p dv_ind and a pointer to a uint32_t @p\n perf, this function will write the ::rsmi_dev_perf_level_t to the uint32_t\n pointed to by @p perf\n\n @param[in] dv_ind a device index\n\n @param[inout] perf a pointer to ::rsmi_dev_perf_level_t to which the\n performance level will be written\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_dev_perf_level_get(dv_ind: u32, perf: *mut rsmi_dev_perf_level_t) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Enter performance determinism mode with provided device index.\n\n @details Given a device index @p dv_ind and @p clkvalue this function\n will enable performance determinism mode, which enforces a GFXCLK frequency\n SoftMax limit per GPU set by the user. This prevents the GFXCLK PLL from\n stretching when running the same workload on different GPUS, making\n performance variation minimal. This call will result in the performance\n level ::rsmi_dev_perf_level_t of the device being\n ::RSMI_DEV_PERF_LEVEL_DETERMINISM.\n\n @param[in] dv_ind a device index\n\n @param[in] clkvalue Softmax value for GFXCLK in MHz.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_perf_determinism_mode_set(dv_ind: u32, clkvalue: u64) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the overdrive percent associated with the device with provided\n device index.\n\n @details Given a device index @p dv_ind and a pointer to a uint32_t @p od,\n this function will write the overdrive percentage to the uint32_t pointed\n to by @p od\n\n @param[in] dv_ind a device index\n\n @param[inout] od a pointer to uint32_t to which the overdrive percentage\n will be written\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_dev_overdrive_level_get(dv_ind: u32, od: *mut u32) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the memory clock overdrive percent associated with the device\n with provided device index.\n\n @details Given a device index @p dv_ind and a pointer to a uint32_t @p od,\n this function will write the memory overdrive percentage to the uint32_t\n pointed to by @p od\n\n @param[in] dv_ind a device index\n\n @param[inout] od a pointer to uint32_t to which the overdrive percentage\n will be written\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_dev_mem_overdrive_level_get(dv_ind: u32, od: *mut u32) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the list of possible system clock speeds of device for a\n specified clock type.\n\n @details Given a device index @p dv_ind, a clock type @p clk_type, and a\n pointer to a to an ::rsmi_frequencies_t structure @p f, this function will\n fill in @p f with the possible clock speeds, and indication of the current\n clock speed selection.\n\n @param[in] dv_ind a device index\n\n @param[in] clk_type the type of clock for which the frequency is desired\n\n @param[inout] f a pointer to a caller provided ::rsmi_frequencies_t structure\n to which the frequency information will be written. Frequency values are in\n Hz.\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n If multiple current frequencies are found, a warning is shown. If no\n current frequency is found, it is reflected as -1. If frequencies are not\n read from low to high a warning is shown as well.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n @retval ::RSMI_STATUS_UNEXPECTED_DATA Data read or provided was not as\n expected\n"] pub fn rsmi_dev_gpu_clk_freq_get( dv_ind: u32, clk_type: rsmi_clk_type_t, f: *mut rsmi_frequencies_t, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Reset the gpu associated with the device with provided device index\n\n @details Given a device index @p dv_ind, this function will reset the GPU\n\n @param[in] dv_ind a device index\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_dev_gpu_reset(dv_ind: u32) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief This function retrieves the voltage/frequency curve information\n\n @details Given a device index @p dv_ind and a pointer to a\n ::rsmi_od_volt_freq_data_t structure @p odv, this function will populate @p\n odv. See ::rsmi_od_volt_freq_data_t for more details.\n\n @param[in] dv_ind a device index\n\n @param[inout] odv a pointer to an ::rsmi_od_volt_freq_data_t structure\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid"] pub fn rsmi_dev_od_volt_info_get( dv_ind: u32, odv: *mut rsmi_od_volt_freq_data_t, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief This function retrieves the gpu metrics information\n\n @details Given a device index @p dv_ind and a pointer to a\n ::rsmi_gpu_metrics_t structure @p pgpu_metrics, this function will populate\n @p pgpu_metrics. See ::rsmi_gpu_metrics_t for more details.\n\n @param[in] dv_ind a device index\n\n @param[inout] pgpu_metrics a pointer to an ::rsmi_gpu_metrics_t structure\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid"] pub fn rsmi_dev_gpu_metrics_info_get( dv_ind: u32, pgpu_metrics: *mut rsmi_gpu_metrics_t, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the pm metrics table with provided device index.\n\n @details Given a device index @p dv_ind, @p pm_metrics pointer,\n and @p num_of_metrics pointer,\n this function will write the pm metrics name value pair\n to the array at @p pm_metrics and the number of metrics retreived to @p num_of_metrics\n Note: the library allocated memory for pm_metrics, and user must call\n free(pm_metrics) to free it after use.\n\n @param[in] dv_ind a device index\n\n @param[inout] pm_metrics A pointerto an array to hold multiple PM metrics. On successs,\n the library will allocate memory of pm_metrics and write metrics to this array.\n The caller must free this memory after usage to avoid memory leak.\n\n @param[inout] num_of_metrics a pointer to uint32_t to which the number of\n metrics is allocated for pm_metrics array as input, and the number of metrics retreived\n as output. If this parameter is NULL, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_dev_pm_metrics_info_get( dv_ind: u32, pm_metrics: *mut *mut rsmi_name_value_t, num_of_metrics: *mut u32, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the register metrics table with provided device index and registertype.\n\n @details Given a device index @p dv_ind, @p reg_type, @p reg_metrics pointer,\n and @p num_of_metrics pointer,\n this function will write the register metrics name value pair\n to the array at @p reg_metrics and the number of metrics retreived to @p num_of_metrics\n Note: the library allocated memory for reg_metrics, and user must call\n free(reg_metrics) to free it after use.\n\n @param[in] dv_ind a device index\n\n @param[in] reg_type The register type\n\n @param[inout] reg_metrics A pointerto an array to hold multiple register metrics. On successs,\n the library will allocate memory of reg_metrics and write metrics to this array.\n The caller must free this memory after usage to avoid memory leak.\n\n @param[inout] num_of_metrics a pointer to uint32_t to which the number of\n metrics is allocated for reg_metrics array as input, and the number of metrics retreived\n as output. If this parameter is NULL, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_dev_reg_table_info_get( dv_ind: u32, reg_type: rsmi_reg_type_t, reg_metrics: *mut *mut rsmi_name_value_t, num_of_metrics: *mut u32, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief This function sets the clock range information\n\n @details Given a device index @p dv_ind, a minimum clock value @p minclkvalue,\n a maximum clock value @p maxclkvalue and a clock type @p clkType this function\n will set the sclk|mclk range\n\n @param[in] dv_ind a device index\n\n @param[in] minclkvalue value to apply to the clock range. Frequency values\n are in MHz.\n\n @param[in] maxclkvalue value to apply to the clock range. Frequency values\n are in MHz.\n\n @param[in] clkType RSMI_CLK_TYPE_SYS | RSMI_CLK_TYPE_MEM range type\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid"] pub fn rsmi_dev_clk_range_set( dv_ind: u32, minclkvalue: u64, maxclkvalue: u64, clkType: rsmi_clk_type_t, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief This function sets the clock min/max level\n\n @details Given a device index @p dv_ind, a clock value @p minclkvalue,\n a maximum clock value @p maxclkvalue and a clock type @p clkType this function\n will set the sclk|mclk range\n\n @param[in] dv_ind a device index\n\n @param[in] level RSMI_FREQ_IND_MIN|RSMI_FREQ_IND_MAX\n\n @param[in] clkvalue value to apply to the clock level. Frequency values\n are in MHz.\n\n @param[in] clkType RSMI_CLK_TYPE_SYS | RSMI_CLK_TYPE_MEM level type\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid"] pub fn rsmi_dev_clk_extremum_set( dv_ind: u32, level: rsmi_freq_ind_t, clkvalue: u64, clkType: rsmi_clk_type_t, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief This function sets the clock frequency information\n\n @details Given a device index @p dv_ind, a frequency level @p level,\n a clock value @p clkvalue and a clock type @p clkType this function\n will set the sclk|mclk range\n\n @param[in] dv_ind a device index\n\n @param[in] level RSMI_FREQ_IND_MIN|RSMI_FREQ_IND_MAX to set the\n minimum (0) or maximum (1) speed.\n\n @param[in] clkvalue value to apply to the clock range. Frequency values\n are in MHz.\n\n @param[in] clkType RSMI_CLK_TYPE_SYS | RSMI_CLK_TYPE_MEM range type\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid"] pub fn rsmi_dev_od_clk_info_set( dv_ind: u32, level: rsmi_freq_ind_t, clkvalue: u64, clkType: rsmi_clk_type_t, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief This function sets 1 of the 3 voltage curve points.\n\n @details Given a device index @p dv_ind, a voltage point @p vpoint\n and a voltage value @p voltvalue this function will set voltage curve point\n\n @param[in] dv_ind a device index\n\n @param[in] vpoint voltage point [0|1|2] on the voltage curve\n\n @param[in] clkvalue clock value component of voltage curve point.\n Frequency values are in MHz.\n\n @param[in] voltvalue voltage value component of voltage curve point.\n Voltage is in mV.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid"] pub fn rsmi_dev_od_volt_info_set( dv_ind: u32, vpoint: u32, clkvalue: u64, voltvalue: u64, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief This function will retrieve the current valid regions in the\n frequency/voltage space.\n\n @details Given a device index @p dv_ind, a pointer to an unsigned integer\n @p num_regions and a buffer of ::rsmi_freq_volt_region_t structures, @p\n buffer, this function will populate @p buffer with the current\n frequency-volt space regions. The caller should assign @p buffer to memory\n that can be written to by this function. The caller should also\n indicate the number of ::rsmi_freq_volt_region_t structures that can safely\n be written to @p buffer in @p num_regions.\n\n The number of regions to expect this function provide (@p num_regions) can\n be obtained by calling ::rsmi_dev_od_volt_info_get().\n\n @param[in] dv_ind a device index\n\n @param[inout] num_regions As input, this is the number of\n ::rsmi_freq_volt_region_t structures that can be written to @p buffer. As\n output, this is the number of ::rsmi_freq_volt_region_t structures that were\n actually written.\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @param[inout] buffer a caller provided buffer to which\n ::rsmi_freq_volt_region_t structures will be written\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid"] pub fn rsmi_dev_od_volt_curve_regions_get( dv_ind: u32, num_regions: *mut u32, buffer: *mut rsmi_freq_volt_region_t, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the list of available preset power profiles and an indication of\n which profile is currently active.\n\n @details Given a device index @p dv_ind and a pointer to a\n ::rsmi_power_profile_status_t @p status, this function will set the bits of\n the ::rsmi_power_profile_status_t.available_profiles bit field of @p status to\n 1 if the profile corresponding to the respective\n ::rsmi_power_profile_preset_masks_t profiles are enabled. For example, if both\n the VIDEO and VR power profiles are available selections, then\n ::RSMI_PWR_PROF_PRST_VIDEO_MASK AND'ed with\n ::rsmi_power_profile_status_t.available_profiles will be non-zero as will\n ::RSMI_PWR_PROF_PRST_VR_MASK AND'ed with\n ::rsmi_power_profile_status_t.available_profiles. Additionally,\n ::rsmi_power_profile_status_t.current will be set to the\n ::rsmi_power_profile_preset_masks_t of the profile that is currently active.\n\n @param[in] dv_ind a device index\n\n @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0.\n If a device has more than one sensor, it could be greater than 0.\n\n @param[inout] status a pointer to ::rsmi_power_profile_status_t that will be\n populated by a call to this function\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_dev_power_profile_presets_get( dv_ind: u32, sensor_ind: u32, status: *mut rsmi_power_profile_status_t, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @defgroup PerfCont Clock, Power and Performance Control\n These functions provide control over clock frequencies, power and\n performance.\n @{\n/\n/**\n @brief Set the PowerPlay performance level associated with the device with\n provided device index with the provided value.\n\n @deprecated ::rsmi_dev_perf_level_set_v1() is preferred, with an\n interface that more closely matches the rest of the rocm_smi API.\n\n @details Given a device index @p dv_ind and an ::rsmi_dev_perf_level_t @p\n perf_level, this function will set the PowerPlay performance level for the\n device to the value @p perf_lvl.\n\n @param[in] dv_ind a device index\n\n @param[in] perf_lvl the value to which the performance level should be set\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call.\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_PERMISSION function requires root access\n"] pub fn rsmi_dev_perf_level_set(dv_ind: u32, perf_lvl: rsmi_dev_perf_level_t) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Set the PowerPlay performance level associated with the device with\n provided device index with the provided value.\n\n @details Given a device index @p dv_ind and an ::rsmi_dev_perf_level_t @p\n perf_level, this function will set the PowerPlay performance level for the\n device to the value @p perf_lvl.\n\n @param[in] dv_ind a device index\n\n @param[in] perf_lvl the value to which the performance level should be set\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call.\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_PERMISSION function requires root access\n"] pub fn rsmi_dev_perf_level_set_v1( dv_ind: u32, perf_lvl: rsmi_dev_perf_level_t, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Set the overdrive percent associated with the device with provided\n device index with the provided value. See details for WARNING.\n\n @deprecated This function is deprecated. ::rsmi_dev_overdrive_level_set_v1\n has the same functionaltiy, with an interface that more closely\n matches the rest of the rocm_smi API.\n\n @details Given a device index @p dv_ind and an overdrive level @p od,\n this function will set the overdrive level for the device to the value\n @p od. The overdrive level is an integer value between 0 and 20, inclusive,\n which represents the overdrive percentage; e.g., a value of 5 specifies\n an overclocking of 5%.\n\n The overdrive level is specific to the gpu system clock.\n\n The overdrive level is the percentage above the maximum Performance Level\n to which overclocking will be limited. The overclocking percentage does\n not apply to clock speeds other than the maximum. This percentage is\n limited to 20%.\n\n ******WARNING******\n Operating your GPU outside of official specifications or outside of\n factory settings, including but not limited to the conducting of\n overclocking (including use of this overclocking software, even if such\n software has been directly or indirectly provided by or otherwise\n affiliated in any way with ), may cause damage to your GPU, system\n components and/or result in system failure, as well as cause other problems.\n DAMAGES CAUSED BY USE OF YOUR GPU OUTSIDE OF OFFICIAL SPECIFICATIONS\n OR OUTSIDE OF FACTORY SETTINGS ARE NOT COVERED UNDER ANY PRODUCT\n WARRANTY AND MAY NOT BE COVERED BY YOUR BOARD OR SYSTEM MANUFACTURER'S\n WARRANTY. Please use this utility with caution.\n\n @param[in] dv_ind a device index\n\n @param[in] od the value to which the overdrive level should be set\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_PERMISSION function requires root access\n"] pub fn rsmi_dev_overdrive_level_set(dv_ind: u32, od: u32) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Set the overdrive percent associated with the device with provided\n device index with the provided value. See details for WARNING.\n\n @details Given a device index @p dv_ind and an overdrive level @p od,\n this function will set the overdrive level for the device to the value\n @p od. The overdrive level is an integer value between 0 and 20, inclusive,\n which represents the overdrive percentage; e.g., a value of 5 specifies\n an overclocking of 5%.\n\n The overdrive level is specific to the gpu system clock.\n\n The overdrive level is the percentage above the maximum Performance Level\n to which overclocking will be limited. The overclocking percentage does\n not apply to clock speeds other than the maximum. This percentage is\n limited to 20%.\n\n ******WARNING******\n Operating your GPU outside of official specifications or outside of\n factory settings, including but not limited to the conducting of\n overclocking (including use of this overclocking software, even if such\n software has been directly or indirectly provided by or otherwise\n affiliated in any way with ), may cause damage to your GPU, system\n components and/or result in system failure, as well as cause other problems.\n DAMAGES CAUSED BY USE OF YOUR GPU OUTSIDE OF OFFICIAL SPECIFICATIONS\n OR OUTSIDE OF FACTORY SETTINGS ARE NOT COVERED UNDER ANY PRODUCT\n WARRANTY AND MAY NOT BE COVERED BY YOUR BOARD OR SYSTEM MANUFACTURER'S\n WARRANTY. Please use this utility with caution.\n\n @param[in] dv_ind a device index\n\n @param[in] od the value to which the overdrive level should be set\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_PERMISSION function requires root access\n"] pub fn rsmi_dev_overdrive_level_set_v1(dv_ind: u32, od: u32) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Control the set of allowed frequencies that can be used for the\n specified clock.\n\n @details Given a device index @p dv_ind, a clock type @p clk_type, and a\n 64 bit bitmask @p freq_bitmask, this function will limit the set of\n allowable frequencies. If a bit in @p freq_bitmask has a value of 1, then\n the frequency (as ordered in an ::rsmi_frequencies_t returned by\n rsmi_dev_gpu_clk_freq_get()) corresponding to that bit index will be\n allowed.\n\n This function will change the performance level to\n ::RSMI_DEV_PERF_LEVEL_MANUAL in order to modify the set of allowable\n frequencies. Caller will need to set to ::RSMI_DEV_PERF_LEVEL_AUTO in order\n to get back to default state.\n\n All bits with indices greater than or equal to\n ::rsmi_frequencies_t::num_supported will be ignored.\n\n @param[in] dv_ind a device index\n\n @param[in] clk_type the type of clock for which the set of frequencies\n will be modified\n\n @param[in] freq_bitmask A bitmask indicating the indices of the\n frequencies that are to be enabled (1) and disabled (0). Only the lowest\n ::rsmi_frequencies_t.num_supported bits of this mask are relevant.\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call.\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_PERMISSION function requires root access\n"] pub fn rsmi_dev_gpu_clk_freq_set( dv_ind: u32, clk_type: rsmi_clk_type_t, freq_bitmask: u64, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the dpm policy for a device\n\n @details Given a device index @p dv_ind, this function will write\n current dpm policy settings to @p policy. All the devices at the same socket\n will have the same policy.\n\n @param[in] dv_ind a device index\n\n @param[in, out] policy the dpm policy for this device.\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVAL\n\n @return ::RSMI_STATUS_SUCCESS is returned upon successful call, non-zero on fail"] pub fn rsmi_dev_soc_pstate_get(dv_ind: u32, policy: *mut rsmi_dpm_policy_t) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Set the dpm policy for a device\n\n @details Given a device index @p dv_ind and a dpm policy @p policy_id,\n this function will set the DPM policy for this device. All the devices at\n the same socket will be set to the same policy.\n\n @note This function requires root access\n\n @param[in] dv_ind a device index\n\n @param[in] policy_id the dpm policy will be modified\n\n @return ::RSMI_STATUS_SUCCESS is returned upon successful call, non-zero on fail"] pub fn rsmi_dev_soc_pstate_set(dv_ind: u32, policy_id: u32) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the xgmi per-link power down policy parameter for a device\n\n\n @details Given a device index @p dv_ind, this function will write\n current xgmi plpd settings to @p xgmi_plpd. All the processors at the same socket\n will have the same policy.\n\n @param[in] dv_ind a device index\n\n @param[in, out] xgmi_plpd the xgmi_plpd policy for this device.\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVAL\n\n @return ::RSMI_STATUS_SUCCESS is returned upon successful call, non-zero on fail"] pub fn rsmi_dev_xgmi_plpd_get(dv_ind: u32, xgmi_plpd: *mut rsmi_dpm_policy_t) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Set the xgmi per-link power down policy parameter for a device\n\n\n @details Given a device index @p dv_ind, and a dpm policy @p plpd_id,\n this function will set the xgmi plpd for this processor. All the processors at\n the same socket will be set to the same policy.\n\n @note This function requires root access\n\n @param[in] processor_handle a processor handle\n\n @param[in] xgmi_plpd_id the xgmi plpd id to set. The id is the id in\n rsmi_soc_pstate_entry_t, which can be obtained by calling\n rsmi_dev_xgmi_plpd_get()\n\n @return ::RSMI_STATUS_SUCCESS is returned upon successful call, non-zero on fail"] pub fn rsmi_dev_xgmi_plpd_set(dv_ind: u32, plpd_id: u32) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the status of the Process Isolation\n\n @details Given a device index @p dv_ind, this function will write\n current process isolation status to @p pisolate. The 0 is the process isolation\n disabled, and the 1 is the process isolation enabled.\n\n @param[in] dv_ind a device index\n\n @param[in, out] pisolate the process isolation status.\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVAL\n\n @return ::RSMI_STATUS_SUCCESS is returned upon successful call, non-zero on fail"] pub fn rsmi_dev_process_isolation_get(dv_ind: u32, pisolate: *mut u32) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Enable/disable the system Process Isolation\n\n @details Given a device index @p dv_ind and a process isolation @p pisolate,\n flag, this function will set the Process Isolation for this device. The 0 is the process\n isolation disabled, and the 1 is the process isolation enabled.\n\n @note This function requires root access\n\n @param[in] dv_ind a device index\n\n @param[in] pisolate the process isolation status to set.\n\n @return ::RSMI_STATUS_SUCCESS is returned upon successful call, non-zero on fail"] pub fn rsmi_dev_process_isolation_set(dv_ind: u32, pisolate: u32) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Run the cleaner shader to clean up data in LDS/GPRs\n\n @details Given a device index @p dv_ind, this function will clear the\n GPU local data of this device. This can be called between user logins to prevent information leak.\n\n @note This function requires root access\n\n @param[in] dv_ind a device index\n\n @return ::RSMI_STATUS_SUCCESS is returned upon successful call, non-zero on fail"] pub fn rsmi_dev_gpu_run_cleaner_shader(dv_ind: u32) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the build version information for the currently running build of\n RSMI.\n\n @details Get the major, minor, patch and build string for RSMI build\n currently in use through @p version\n\n @param[inout] version A pointer to an ::rsmi_version_t structure that will\n be updated with the version information upon return.\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call\n"] pub fn rsmi_version_get(version: *mut rsmi_version_t) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the build version information for the currently running build of\n RSMI.\n\n @details Get the major, minor, patch and build string for RSMI build\n currently in use through @p version\n\n @param[inout] hy_version A pointer to an ::rsmi_hy_version_t structure that will\n be updated with the version information upon return.\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call\n"] pub fn rsmi_hy_version_get(hy_version: *mut rsmi_hy_version_t) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the driver version string for the current system.\n\n @details Given a software component @p component, a pointer to a char\n buffer, @p ver_str, this function will write the driver version string\n (up to @p len characters) for the current system to @p ver_str. The caller\n must ensure that it is safe to write at least @p len characters to @p\n ver_str.\n\n @param[in] component The component for which the version string is being\n requested\n\n @param[inout] ver_str A pointer to a buffer of char's to which the version\n of @p component will be written\n\n @param[in] len the length of the caller provided buffer @p name.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n @retval ::RSMI_STATUS_INSUFFICIENT_SIZE is returned if @p len bytes is not\n large enough to hold the entire name. In this case, only @p len bytes will\n be written."] pub fn rsmi_version_str_get( component: rsmi_sw_component_t, ver_str: *mut ::std::os::raw::c_char, len: u32, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the VBIOS identifer string\n\n @details Given a device ID @p dv_ind, and a pointer to a char buffer,\n @p vbios, this function will write the VBIOS string (up to @p len\n characters) for device @p dv_ind to @p vbios. The caller must ensure that\n it is safe to write at least @p len characters to @p vbios.\n\n @param[in] dv_ind a device index\n\n @param[inout] vbios A pointer to a buffer of char's to which the VBIOS name\n will be written\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @param[in] len The number of char's pointed to by @p vbios which can safely\n be written to by this function.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_dev_vbios_version_get( dv_ind: u32, vbios: *mut ::std::os::raw::c_char, len: u32, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the firmware versions for a device\n\n @details Given a device ID @p dv_ind, and a pointer to a uint64_t,\n @p fw_version, this function will write the FW Versions as a string (up to @p len\n characters) for device @p dv_ind to @p vbios. The caller must ensure that\n it is safe to write at least @p len characters to @p vbios.\n\n @param[in] dv_ind a device index\n\n @param[in] block The firmware block for which the version is being requested\n\n @param[inout] fw_version The version for the firmware block\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_dev_firmware_version_get( dv_ind: u32, block: rsmi_fw_block_t, fw_version: *mut u64, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the target graphics version for a GPU device\n\n @details Given a device ID @p dv_ind and a uint64_t pointer\n @p gfx_version, this function will write the graphics version.\n\n @param[in] dv_ind a device index\n\n @param[inout] gfx_version The device graphics version number indicated by\n KFD. If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS. If device does not support this value,\n will return ::RSMI_STATUS_NOT_SUPPORTED and a maximum UINT64 value as\n @p gfx_version.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_dev_target_graphics_version_get( dv_ind: u32, gfx_version: *mut u64, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Retrieve the error counts for a GPU block\n\n @details Given a device index @p dv_ind, an ::rsmi_gpu_block_t @p block and a\n pointer to an ::rsmi_error_count_t @p ec, this function will write the error\n count values for the GPU block indicated by @p block to memory pointed to by\n @p ec.\n\n @param[in] dv_ind a device index\n\n @param[in] block The block for which error counts should be retrieved\n\n @param[inout] ec A pointer to an ::rsmi_error_count_t to which the error\n counts should be written\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_dev_ecc_count_get( dv_ind: u32, block: rsmi_gpu_block_t, ec: *mut rsmi_error_count_t, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Retrieve the enabled ECC bit-mask\n\n @details Given a device index @p dv_ind, and a pointer to a uint64_t @p\n enabled_mask, this function will write bits to memory pointed to by\n @p enabled_blocks. Upon a successful call, @p enabled_blocks can then be\n AND'd with elements of the ::rsmi_gpu_block_t ennumeration to determine if\n the corresponding block has ECC enabled. Note that whether a block has ECC\n enabled or not in the device is independent of whether there is kernel\n support for error counting for that block. Although a block may be enabled,\n but there may not be kernel support for reading error counters for that\n block.\n\n @param[in] dv_ind a device index\n\n @param[inout] enabled_blocks A pointer to a uint64_t to which the enabled\n blocks bits will be written.\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid"] pub fn rsmi_dev_ecc_enabled_get(dv_ind: u32, enabled_blocks: *mut u64) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Retrieve the ECC status for a GPU block\n\n @details Given a device index @p dv_ind, an ::rsmi_gpu_block_t @p block and\n a pointer to an ::rsmi_ras_err_state_t @p state, this function will write\n the current state for the GPU block indicated by @p block to memory pointed\n to by @p state.\n\n @param[in] dv_ind a device index\n\n @param[in] block The block for which error counts should be retrieved\n\n @param[inout] state A pointer to an ::rsmi_ras_err_state_t to which the\n ECC state should be written\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_dev_ecc_status_get( dv_ind: u32, block: rsmi_gpu_block_t, state: *mut rsmi_ras_err_state_t, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Returns RAS features info.\n\n @details Given a device index @p dv_ind, and\n a pointer to an ::rsmi_ras_feature_info_t @p ras_feature, this function will write\n the ras feature info to memory pointed to by @p ras_feature.\n\n @param[in] dv_ind a device index\n\n @param[inout] ras_feature A pointer to an ::rsmi_ras_feature_info_t to which the\n RAS info should be written\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid"] pub fn rsmi_ras_feature_info_get( dv_ind: u32, ras_feature: *mut rsmi_ras_feature_info_t, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get a description of a provided RSMI error status\n\n @details Set the provided pointer to a const char *, @p status_string, to\n a string containing a description of the provided error code @p status.\n\n @param[in] status The error status for which a description is desired\n\n @param[inout] status_string A pointer to a const char * which will be made\n to point to a description of the provided error code\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call\n"] pub fn rsmi_status_string( status: rsmi_status_t, status_string: *mut *const ::std::os::raw::c_char, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Tell if an event group is supported by a given device\n\n @details Given a device index @p dv_ind and an event group specifier @p\n group, tell if @p group type events are supported by the device associated\n with @p dv_ind\n\n @param[in] dv_ind device index of device being queried\n\n @param[in] group ::rsmi_event_group_t identifier of group for which support\n is being queried\n\n @retval ::RSMI_STATUS_SUCCESS if the device associatee with @p dv_ind\n support counting events of the type indicated by @p group.\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n group\n"] pub fn rsmi_dev_counter_group_supported( dv_ind: u32, group: rsmi_event_group_t, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Create a performance counter object\n\n @details Create a performance counter object of type @p type for the device\n with a device index of @p dv_ind, and write a handle to the object to the\n memory location pointed to by @p evnt_handle. @p evnt_handle can be used\n with other performance event operations. The handle should be deallocated\n with ::rsmi_dev_counter_destroy() when no longer needed.\n\n @param[in] dv_ind a device index\n\n @param[in] type the ::rsmi_event_type_t of performance event to create\n\n @param[inout] evnt_handle A pointer to a ::rsmi_event_handle_t which will be\n associated with a newly allocated counter\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n @retval ::RSMI_STATUS_OUT_OF_RESOURCES unable to allocate memory for counter\n @retval ::RSMI_STATUS_PERMISSION function requires root access\n"] pub fn rsmi_dev_counter_create( dv_ind: u32, type_: rsmi_event_type_t, evnt_handle: *mut rsmi_event_handle_t, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Deallocate a performance counter object\n\n @details Deallocate the performance counter object with the provided\n ::rsmi_event_handle_t @p evnt_handle\n\n @param[in] evnt_handle handle to event object to be deallocated\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n @retval ::RSMI_STATUS_PERMISSION function requires root access\n"] pub fn rsmi_dev_counter_destroy(evnt_handle: rsmi_event_handle_t) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Issue performance counter control commands\n\n @details Issue a command @p cmd on the event counter associated with the\n provided handle @p evt_handle.\n\n @param[in] evt_handle an event handle\n\n @param[in] cmd The event counter command to be issued\n\n @param[inout] cmd_args Currently not used. Should be set to NULL.\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n @retval ::RSMI_STATUS_PERMISSION function requires root access\n"] pub fn rsmi_counter_control( evt_handle: rsmi_event_handle_t, cmd: rsmi_counter_command_t, cmd_args: *mut ::std::os::raw::c_void, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Read the current value of a performance counter\n\n @details Read the current counter value of the counter associated with the\n provided handle @p evt_handle and write the value to the location pointed\n to by @p value.\n\n @param[in] evt_handle an event handle\n\n @param[inout] value pointer to memory of size of ::rsmi_counter_value_t to\n which the counter value will be written\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n @retval ::RSMI_STATUS_PERMISSION function requires root access\n"] pub fn rsmi_counter_read( evt_handle: rsmi_event_handle_t, value: *mut rsmi_counter_value_t, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the number of currently available counters\n\n @details Given a device index @p dv_ind, a performance event group @p grp,\n and a pointer to a uint32_t @p available, this function will write the\n number of @p grp type counters that are available on the device with index\n @p dv_ind to the memory that @p available points to.\n\n @param[in] dv_ind a device index\n\n @param[in] grp an event device group\n\n @param[inout] available A pointer to a uint32_t to which the number of\n available counters will be written\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_counter_available_counters_get( dv_ind: u32, grp: rsmi_event_group_t, available: *mut u32, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get process information about processes currently using GPU\n\n @details Given a non-NULL pointer to an array @p procs of\n ::rsmi_process_info_t's, of length *@p num_items, this function will write\n up to *@p num_items instances of ::rsmi_process_info_t to the memory pointed\n to by @p procs. These instances contain information about each process\n utilizing a GPU. If @p procs is not NULL, @p num_items will be updated with\n the number of processes actually written. If @p procs is NULL, @p num_items\n will be updated with the number of processes for which there is current\n process information. Calling this function with @p procs being NULL is a way\n to determine how much memory should be allocated for when @p procs is not\n NULL.\n\n @param[inout] procs a pointer to memory provided by the caller to which\n process information will be written. This may be NULL in which case only @p\n num_items will be updated with the number of processes found.\n\n @param[inout] num_items A pointer to a uint32_t, which on input, should\n contain the amount of memory in ::rsmi_process_info_t's which have been\n provided by the @p procs argument. On output, if @p procs is non-NULL, this\n will be updated with the number ::rsmi_process_info_t structs actually\n written. If @p procs is NULL, this argument will be updated with the number\n processes for which there is information.\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n @retval ::RSMI_STATUS_INSUFFICIENT_SIZE is returned if there were more\n processes for which information was available, but not enough space was\n provided as indicated by @p procs and @p num_items, on input."] pub fn rsmi_compute_process_info_get( procs: *mut rsmi_process_info_t, num_items: *mut u32, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get process information about a specific process\n\n @details Given a pointer to an ::rsmi_process_info_t @p proc and a process\n id\n @p pid, this function will write the process information for @p pid, if\n available, to the memory pointed to by @p proc.\n\n @param[in] pid The process ID for which process information is being\n requested\n\n @param[inout] proc a pointer to a ::rsmi_process_info_t to which\n process information for @p pid will be written if it is found.\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n @retval ::RSMI_STATUS_NOT_FOUND is returned if there was no process\n information\n found for the provided @p pid\n"] pub fn rsmi_compute_process_info_by_pid_get( pid: u32, proc_: *mut rsmi_process_info_t, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the device indices currently being used by a process\n\n @details Given a process id @p pid, a non-NULL pointer to an array of\n uint32_t's @p dv_indices of length *@p num_devices, this function will\n write up to @p num_devices device indices to the memory pointed to by\n @p dv_indices. If @p dv_indices is not NULL, @p num_devices will be\n updated with the number of gpu's currently being used by process @p pid.\n If @p dv_indices is NULL, @p dv_indices will be updated with the number of\n gpus currently being used by @p pid. Calling this function with @p\n dv_indices being NULL is a way to determine how much memory is required\n for when @p dv_indices is not NULL.\n\n @param[in] pid The process id of the process for which the number of gpus\n currently being used is requested\n\n @param[inout] dv_indices a pointer to memory provided by the caller to\n which indices of devices currently being used by the process will be\n written. This may be NULL in which case only @p num_devices will be\n updated with the number of devices being used.\n\n @param[inout] num_devices A pointer to a uint32_t, which on input, should\n contain the amount of memory in uint32_t's which have been provided by the\n @p dv_indices argument. On output, if @p dv_indices is non-NULL, this will\n be updated with the number uint32_t's actually written. If @p dv_indices is\n NULL, this argument will be updated with the number devices being used.\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n @retval ::RSMI_STATUS_INSUFFICIENT_SIZE is returned if there were more\n gpu indices that could have been written, but not enough space was\n provided as indicated by @p dv_indices and @p num_devices, on input.\n"] pub fn rsmi_compute_process_gpus_get( pid: u32, dv_indices: *mut u32, num_devices: *mut u32, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the info of a process on a specific device.\n\n @details Given a process id @p pid, a @p dv_ind, this function will\n write the process information for pid on the device, if available, to\n the memory pointed to by @p proc.\n\n @param[in] pid The process id of the process for which the gpu\n currently being used is requested.\n\n @param[in] dv_ind a device index where the process running on.\n\n @param[inout] proc a pointer to memory provided by the caller to which\n process information will be written.\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_compute_process_info_by_device_get( pid: u32, dv_ind: u32, proc_: *mut rsmi_process_info_t, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Retrieve the XGMI error status for a device\n\n @details Given a device index @p dv_ind, and a pointer to an\n ::rsmi_xgmi_status_t @p status, this function will write the current XGMI\n error state ::rsmi_xgmi_status_t for the device @p dv_ind to the memory\n pointed to by @p status.\n\n @param[in] dv_ind a device index\n\n @param[inout] status A pointer to an ::rsmi_xgmi_status_t to which the\n XGMI error state should be written\n If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,\n arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n provided arguments.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_dev_xgmi_error_status( dv_ind: u32, status: *mut rsmi_xgmi_status_t, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Reset the XGMI error status for a device\n\n @details Given a device index @p dv_ind, this function will reset the\n current XGMI error state ::rsmi_xgmi_status_t for the device @p dv_ind to\n rsmi_xgmi_status_t::RSMI_XGMI_STATUS_NO_ERRORS\n\n @param[in] dv_ind a device index\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call.\n"] pub fn rsmi_dev_xgmi_error_reset(dv_ind: u32) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Retrieve the XGMI hive id for a device\n\n @details Given a device index @p dv_ind, and a pointer to an\n uint64_t @p hive_id, this function will write the current XGMI\n hive id for the device @p dv_ind to the memory pointed to by @p hive_id.\n\n @param[in] dv_ind a device index\n\n @param[inout] hive_id A pointer to an uint64_t to which the XGMI hive id\n should be written\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_dev_xgmi_hive_id_get(dv_ind: u32, hive_id: *mut u64) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Retrieve the NUMA CPU node number for a device\n\n @details Given a device index @p dv_ind, and a pointer to an\n uint32_t @p numa_node, this function will write the\n node number of NUMA CPU for the device @p dv_ind to the memory\n pointed to by @p numa_node.\n\n @param[in] dv_ind a device index\n\n @param[inout] numa_node A pointer to an uint32_t to which the\n numa node number should be written.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_topo_get_numa_node_number(dv_ind: u32, numa_node: *mut u32) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Retrieve the weight for a connection between 2 GPUs\n\n @details Given a source device index @p dv_ind_src and\n a destination device index @p dv_ind_dst, and a pointer to an\n uint64_t @p weight, this function will write the\n weight for the connection between the device @p dv_ind_src\n and @p dv_ind_dst to the memory pointed to by @p weight.\n\n @param[in] dv_ind_src the source device index\n\n @param[in] dv_ind_dst the destination device index\n\n @param[inout] weight A pointer to an uint64_t to which the\n weight for the connection should be written.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_topo_get_link_weight( dv_ind_src: u32, dv_ind_dst: u32, weight: *mut u64, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Retreive minimal and maximal io link bandwidth between 2 GPUs\n\n @details Given a source device index @p dv_ind_src and\n a destination device index @p dv_ind_dst, pointer to an\n uint64_t @p min_bandwidth, and a pointer to uint64_t @p max_bandiwidth,\n this function will write theoretical minimal and maximal bandwidth limits.\n API works if src and dst are connected via xgmi and have 1 hop distance.\n\n @param[in] dv_ind_src the source device index\n\n @param[in] dv_ind_dst the destination device index\n\n @param[inout] min_bandwidth A pointer to an uint64_t to which the\n minimal bandwidth for the connection should be written.\n\n @param[inout] max_bandwidth A pointer to an uint64_t to which the\n maximal bandwidth for the connection should be written.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid"] pub fn rsmi_minmax_bandwidth_get( dv_ind_src: u32, dv_ind_dst: u32, min_bandwidth: *mut u64, max_bandwidth: *mut u64, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Retrieve the hops and the connection type between GPU to GPU/CPU\n\n @details Given a source device index @p dv_ind_src and\n a destination device index @p dv_ind_dst, and a pointer to an\n uint64_t @p hops and a pointer to an RSMI_IO_LINK_TYPE @p type,\n this function will write the number of hops and the connection type\n between the device @p dv_ind_src and @p dv_ind_dst to the memory\n pointed to by @p hops and @p type.\n\n To query the link type between GPU and CPU, given a source GPU index\n @p dev_ind_srcc and a destination device index @p dv_ind_dst\n CPU_NODE_INDEX(0xFFFFFFFF), a pointer to an\n uint64_t @p hops and a pointer to an RSMI_IO_LINK_TYPE @p type,\n this function will write the number of hops and the connection type\n between the device @p dv_ind_src and CPU to the memory\n pointed to by @p hops and @p type.\n\n @param[in] dv_ind_src the source device index\n\n @param[in] dv_ind_dst the destination device index\n\n @param[inout] hops A pointer to an uint64_t to which the\n hops for the connection should be written.\n\n @param[inout] type A pointer to an ::RSMI_IO_LINK_TYPE to which the\n type for the connection should be written.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_topo_get_link_type( dv_ind_src: u32, dv_ind_dst: u32, hops: *mut u64, type_: *mut RSMI_IO_LINK_TYPE, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Retrieve the hylink status between GPU to GPU/CPU\n\n @details Given a source device index @p dv_ind_src and\n a destination device index @p dv_ind_dst, and a pointer to an\n bool @p is_hylink, this function will write the hylink status\n between the device @p dv_ind_src and @p dv_ind_dst to the memory\n pointed to by @p is_hylink.\n\n @param[in] dv_ind_src the source device index\n\n @param[in] dv_ind_dst the destination device index\n\n @param[inout] is_hylink A pointer to an uint64_t to which the\n hylink status for the connection should be written.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_topo_is_hylink( dv_ind_src: u32, dv_ind_dst: u32, is_hylink: *mut bool, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Return P2P availability status between 2 GPUs\n\n @details Given a source device index @p dv_ind_src and\n a destination device index @p dv_ind_dst, and a pointer to a\n bool @p accessible, this function will write the P2P connection status\n between the device @p dv_ind_src and @p dv_ind_dst to the memory\n pointed to by @p accessible.\n\n @param[in] dv_ind_src the source device index\n\n @param[in] dv_ind_dst the destination device index\n\n @param[inout] accessible A pointer to a bool to which the status for\n the P2P connection availablity should be written.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n"] pub fn rsmi_is_P2P_accessible( dv_ind_src: u32, dv_ind_dst: u32, accessible: *mut bool, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Retrieve connection type and P2P capabilities between 2 GPUs\n\n @platform{gpu_bm_linux} @platform{host} @platform{guest_1vf} @platform{guest_mvf}\n\n @details Given a source processor handle @p processor_handle_src and\n a destination processor handle @p processor_handle_dst, a pointer to an smi_io_link_type_t @p type,\n and a pointer to rsmi_p2p_capability_t @p cap. This function will write the connection type,\n and io link capabilities between the device\n @p processor_handle_src and @p processor_handle_dst to the memory\n pointed to by @p cap and @p type.\n\n @param[in] dv_ind_src the source device index\n\n @param[in] dv_ind_dst the destination device index\n\n @param[inout] type A pointer to an ::RSMI_IO_LINK_TYPE to which the\n type for the connection should be written.\n\n @param[in,out] cap A pointer to an ::rsmi_p2p_capability_t to which the\n io link capabilities should be written.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function"] pub fn rsmi_topo_get_p2p_status( dv_ind_src: u32, dv_ind_dst: u32, type_: *mut RSMI_IO_LINK_TYPE, cap: *mut rsmi_p2p_capability_t, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Retrieves the current compute partitioning for a desired device\n\n @details\n Given a device index @p dv_ind and a string @p compute_partition ,\n and uint32 @p len , this function will attempt to obtain the device's\n current compute partition setting string. Upon successful retreival,\n the obtained device's compute partition settings string shall be stored in\n the passed @p compute_partition char string variable.\n\n @param[in] dv_ind a device index\n\n @param[inout] compute_partition a pointer to a char string variable,\n which the device's current compute partition will be written to.\n\n @param[in] len the length of the caller provided buffer @p compute_partition\n , suggested length is 4 or greater.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n @retval ::RSMI_STATUS_UNEXPECTED_DATA data provided to function is not valid\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function\n @retval ::RSMI_STATUS_INSUFFICIENT_SIZE is returned if @p len bytes is not\n large enough to hold the entire compute partition value. In this case,\n only @p len bytes will be written.\n"] pub fn rsmi_dev_compute_partition_get( dv_ind: u32, compute_partition: *mut ::std::os::raw::c_char, len: u32, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Modifies a selected device's compute partition setting.\n\n @details Given a device index @p dv_ind, a type of compute partition\n @p compute_partition, this function will attempt to update the selected\n device's compute partition setting.\n\n @param[in] dv_ind a device index\n\n @param[in] compute_partition using enum ::rsmi_compute_partition_type_t,\n define what the selected device's compute partition setting should be\n updated to.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_PERMISSION function requires root access\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n @retval ::RSMI_STATUS_SETTING_UNAVAILABLE the provided setting is\n unavailable for current device\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function\n @retval ::RSMI_STATUS_BUSY A resource or mutex could not be acquired\n because it is already being used - device is busy\n"] pub fn rsmi_dev_compute_partition_set( dv_ind: u32, compute_partition: rsmi_compute_partition_type_t, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Retrieves the partition_id for a desired device\n\n @details\n Given a device index @p dv_ind and a uint32_t pointer @p partition_id ,\n this function will attempt to obtain the device's partition ID.\n Upon successful retreival, the obtained device's partition will be stored\n in the passed @p partition_id uint32_t variable. If device does\n not support partitions or is in SPX, a @p partition_id ID of 0 shall\n be returned.\n\n @param[in] dv_ind a device index\n\n @param[inout] partition_id a uint32_t variable,\n which the device's partition_id will be written to.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function\n"] pub fn rsmi_dev_partition_id_get(dv_ind: u32, partition_id: *mut u32) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Retrieves the current memory partition for a desired device\n\n @details\n Given a device index @p dv_ind and a string @p memory_partition ,\n and uint32 @p len , this function will attempt to obtain the device's\n memory partition string. Upon successful retreival, the obtained device's\n memory partition string shall be stored in the passed @p memory_partition\n char string variable.\n\n @param[in] dv_ind a device index\n\n @param[inout] memory_partition a pointer to a char string variable,\n which the device's memory partition will be written to.\n\n @param[in] len the length of the caller provided buffer @p memory_partition ,\n suggested length is 5 or greater.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n @retval ::RSMI_STATUS_UNEXPECTED_DATA data provided to function is not valid\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function\n @retval ::RSMI_STATUS_INSUFFICIENT_SIZE is returned if @p len bytes is not\n large enough to hold the entire memory partition value. In this case,\n only @p len bytes will be written.\n"] pub fn rsmi_dev_memory_partition_get( dv_ind: u32, memory_partition: *mut ::std::os::raw::c_char, len: u32, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Retrieves the available memory partition capabilities\n for a desired device\n\n @details\n Given a device index @p dv_ind and a string @p memory_partition_caps ,\n and uint32 @p len , this function will attempt to obtain the device's\n available memory partition capabilities string. Upon successful\n retreival, the obtained device's available memory partition capablilities\n string shall be stored in the passed @p memory_partition_caps\n char string variable.\n\n @param[in] dv_ind a device index\n\n @param[inout] memory_partition_caps a pointer to a char string variable,\n which the device's available memory partition capabilities will be written to.\n\n @param[in] len the length of the caller provided buffer @p len ,\n suggested length is 30 or greater.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n @retval ::RSMI_STATUS_UNEXPECTED_DATA data provided to function is not valid\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function\n @retval ::RSMI_STATUS_INSUFFICIENT_SIZE is returned if @p len bytes is not\n large enough to hold the entire memory partition value. In this case,\n only @p len bytes will be written.\n"] pub fn rsmi_dev_memory_partition_capabilities_get( dv_ind: u32, memory_partition_caps: *mut ::std::os::raw::c_char, len: u32, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Modifies a selected device's current memory partition setting.\n\n @details Given a device index @p dv_ind and a type of memory partition\n @p memory_partition, this function will attempt to update the selected\n device's memory partition setting.\n\n @param[in] dv_ind a device index\n\n @param[in] memory_partition using enum ::rsmi_memory_partition_type_t,\n define what the selected device's current mode setting should be updated to.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_PERMISSION function requires root access\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function\n @retval ::RSMI_STATUS_GPU_RESTART_ERR could not successfully restart\n the gpu driver\n @retval ::RSMI_STATUS_BUSY A resource or mutex could not be acquired\n because it is already being used - device is busy\n"] pub fn rsmi_dev_memory_partition_set( dv_ind: u32, memory_partition: rsmi_memory_partition_type_t, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get a function name iterator of supported RSMI functions for a device\n\n @details Given a device index @p dv_ind, this function will write a function\n iterator handle to the caller-provided memory pointed to by @p handle. This\n handle can be used to iterate through all the supported functions.\n\n Note that although this function takes in @p dv_ind as an argument,\n ::rsmi_dev_supported_func_iterator_open itself will not be among the\n functions listed as supported. This is because\n ::rsmi_dev_supported_func_iterator_open does not depend on hardware or\n driver support and should always be supported.\n\n @param[in] dv_ind a device index of device for which support information is\n requested\n\n @param[inout] handle A pointer to caller-provided memory to which the\n function iterator will be written.\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call.\n"] pub fn rsmi_dev_supported_func_iterator_open( dv_ind: u32, handle: *mut rsmi_func_id_iter_handle_t, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get a variant iterator for a given handle\n\n @details Given a ::rsmi_func_id_iter_handle_t @p obj_h, this function will\n write a function iterator handle to the caller-provided memory pointed to\n by @p var_iter. This handle can be used to iterate through all the supported\n variants of the provided handle. @p obj_h may be a handle to a function\n object, as provided by a call to ::rsmi_dev_supported_func_iterator_open, or\n it may be a variant itself (from a call to\n ::rsmi_dev_supported_variant_iterator_open), it which case @p var_iter will\n be an iterator of the sub-variants of @p obj_h (e.g., monitors).\n\n This call allocates a small amount of memory to @p var_iter. To free this memory\n ::rsmi_dev_supported_func_iterator_close should be called on the returned\n iterator handle @p var_iter when it is no longer needed.\n\n @param[in] obj_h an iterator handle for which the variants are being requested\n\n @param[inout] var_iter A pointer to caller-provided memory to which the\n sub-variant iterator will be written.\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call.\n"] pub fn rsmi_dev_supported_variant_iterator_open( obj_h: rsmi_func_id_iter_handle_t, var_iter: *mut rsmi_func_id_iter_handle_t, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Advance a function identifer iterator\n\n @details Given a function id iterator handle (::rsmi_func_id_iter_handle_t)\n @p handle, this function will increment the iterator to point to the next\n identifier. After a successful call to this function, obtaining the value\n of the iterator @p handle will provide the value of the next item in the\n list of functions/variants.\n\n If there are no more items in the list, ::RSMI_STATUS_NO_DATA is returned.\n\n @param[in] handle A pointer to an iterator handle to be incremented\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call.\n @retval ::RSMI_STATUS_NO_DATA is returned when list of identifiers has been\n exhausted\n"] pub fn rsmi_func_iter_next(handle: rsmi_func_id_iter_handle_t) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Close a variant iterator handle\n\n @details Given a pointer to an ::rsmi_func_id_iter_handle_t @p handle, this\n function will free the resources being used by the handle\n\n @param[in] handle A pointer to an iterator handle to be closed\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call.\n"] pub fn rsmi_dev_supported_func_iterator_close( handle: *mut rsmi_func_id_iter_handle_t, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the value associated with a function/variant iterator\n\n @details Given an ::rsmi_func_id_iter_handle_t @p handle, this function\n will write the identifier of the function/variant to the user provided\n memory pointed to by @p value.\n\n @p value may point to a function name, a variant id, or a monitor/sensor\n index, depending on what kind of iterator @p handle is\n\n @param[in] handle An iterator for which the value is being requested\n\n @param[inout] value A pointer to an ::rsmi_func_id_value_t provided by the\n caller to which this function will write the value assocaited with @p handle\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call.\n"] pub fn rsmi_func_iter_value_get( handle: rsmi_func_id_iter_handle_t, value: *mut rsmi_func_id_value_t, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Prepare to collect event notifications for a GPU\n\n @details This function prepares to collect events for the GPU with device\n ID @p dv_ind, by initializing any required system parameters. This call\n may open files which will remain open until ::rsmi_event_notification_stop()\n is called.\n\n @param dv_ind a device index corresponding to the device on which to\n listen for events\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call."] pub fn rsmi_event_notification_init(dv_ind: u32) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Specify which events to collect for a device\n\n @details Given a device index @p dv_ind and a @p mask consisting of\n elements of ::rsmi_evt_notification_type_t OR'd together, this function\n will listen for the events specified in @p mask on the device\n corresponding to @p dv_ind.\n\n @param dv_ind a device index corresponding to the device on which to\n listen for events\n\n @param mask Bitmask generated by OR'ing 1 or more elements of\n ::rsmi_evt_notification_type_t indicating which event types to listen for,\n where the rsmi_evt_notification_type_t value indicates the bit field, with\n bit position starting from 1.\n For example, if the mask field is 0x0000000000000003, which means first bit,\n bit 1 (bit position start from 1) and bit 2 are set, which indicate interest\n in receiving RSMI_EVT_NOTIF_VMFAULT (which has a value of 1) and\n RSMI_EVT_NOTIF_THERMAL_THROTTLE event (which has a value of 2).\n\n @retval ::RSMI_STATUS_INIT_ERROR is returned if\n ::rsmi_event_notification_init() has not been called before a call to this\n function\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call"] pub fn rsmi_event_notification_mask_set(dv_ind: u32, mask: u64) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Collect event notifications, waiting a specified amount of time\n\n @details Given a time period @p timeout_ms in milliseconds and a caller-\n provided buffer of ::rsmi_evt_notification_data_t's @p data with a length\n (in ::rsmi_evt_notification_data_t's, also specified by the caller) in the\n memory location pointed to by @p num_elem, this function will collect\n ::rsmi_evt_notification_type_t events for up to @p timeout_ms milliseconds,\n and write up to *@p num_elem event items to @p data. Upon return @p num_elem\n is updated with the number of events that were actually written. If events\n are already present when this function is called, it will write the events\n to the buffer then poll for new events if there is still caller-provided\n buffer available to write any new events that would be found.\n\n This function requires prior calls to ::rsmi_event_notification_init() and\n ::rsmi_event_notification_mask_set(). This function polls for the\n occurrance of the events on the respective devices that were previously\n specified by ::rsmi_event_notification_mask_set().\n\n @param[in] timeout_ms number of milliseconds to wait for an event\n to occur\n\n @param[inout] num_elem pointer to uint32_t, provided by the caller. On\n input, this value tells how many ::rsmi_evt_notification_data_t elements\n are being provided by the caller with @p data. On output, the location\n pointed to by @p num_elem will contain the number of items written to\n the provided buffer.\n\n @param[out] data pointer to a caller-provided memory buffer of size\n @p num_elem ::rsmi_evt_notification_data_t to which this function may safely\n write. If there are events found, up to @p num_elem event items will be\n written to @p data.\n\n @retval ::RSMI_STATUS_SUCCESS The function ran successfully. The events\n that were found are written to @p data and @p num_elems is updated\n with the number of elements that were written.\n\n @retval ::RSMI_STATUS_NO_DATA No events were found to collect.\n"] pub fn rsmi_event_notification_get( timeout_ms: ::std::os::raw::c_int, num_elem: *mut u32, data: *mut rsmi_evt_notification_data_t, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Close any file handles and free any resources used by event\n notification for a GPU\n\n @details Any resources used by event notification for the GPU with\n device index @p dv_ind will be free with this\n function. This includes freeing any memory and closing file handles. This\n should be called for every call to ::rsmi_event_notification_init()\n\n @param[in] dv_ind The device index of the GPU for which event\n notification resources will be free\n\n @retval ::RSMI_STATUS_INVALID_ARGS resources for the given device have\n either already been freed, or were never allocated by\n ::rsmi_event_notification_init()\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call"] pub fn rsmi_event_notification_stop(dv_ind: u32) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the 'metrics_header_info' from the GPU metrics associated with the device\n\n @details Given a device index @p dv_ind and a pointer to a metrics_table_header_t in which\n the 'metrics_header_info' will stored\n\n @param[in] dv_ind a device index\n\n @param[inout] header_value a pointer to metrics_table_header_t to which the device gpu\n metric unit will be stored\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call.\n ::RSMI_STATUS_NOT_SUPPORTED is returned in case the metric unit\n does not exist for the given device\n"] pub fn rsmi_dev_metrics_header_info_get( dv_ind: u32, header_value: *mut metrics_table_header_t, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the 'xcd_counter' from the GPU metrics associated with the device\n\n @details Given a device index @p dv_ind and a pointer to a uint16_t in which\n the 'xcd_counter' will stored\n\n @param[in] dv_ind a device index\n\n @param[inout] xcd_counter_value a pointer to uint16_t to which the device gpu\n metric unit will be stored\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call.\n ::RSMI_STATUS_NOT_SUPPORTED is returned in case the metric unit\n does not exist for the given device\n"] pub fn rsmi_dev_metrics_xcd_counter_get( dv_ind: u32, xcd_counter_value: *mut u16, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the log from the GPU metrics associated with the device\n\n @details Given a device index @p dv_ind it will log all the gpu metric info\n related to the device. The 'logging' feature must be on.\n\n @param[in] dv_ind a device index\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call.\n"] pub fn rsmi_dev_metrics_log_get(dv_ind: u32) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get df bandwidth\n\n @details Given a device index @p dv_ind, this function returns bandwidth of\n df @p rsmi_df_bandwidth_info_t corresponding to the device with the provided\n device index @p dv_ind.\n\n @param[in] dv_ind a device index\n\n @param[in] type using enum ::RSMI_DF_BW_TYPE, define what type of bandwidth\n to get.\n\n @param[inout] df_bw A pointer to caller-provided memory to which the\n rsmi_df_bandwidth_info_t will be written. If this parameter is\n nullptr, this function will return ::RSMI_STATUS_INVALID_ARGS\n Bandwidth is in MB/s.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_INIT_ERROR is returned if BwMonitor init failed\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid"] pub fn rsmi_dev_df_bandwidth_get( dv_ind: u32, type_: RSMI_DF_BW_TYPE, df_bw: *mut rsmi_df_bandwidth_info_t, ) -> rsmi_status_t; } unsafe extern "C" { pub fn rsmi_dev_xhcl_bandwidth_get( dv_ind: u32, link_id: u32, direction: u8, delay: ::std::os::raw::c_int, xhcl_bw: *mut rsmi_xhcl_bandwidth_info_t, ) -> rsmi_status_t; } unsafe extern "C" { pub fn rsmi_dev_umc_bandwidth_get( dv_ind: u32, chan_id: u32, delay: ::std::os::raw::c_int, umc_bw: *mut rsmi_umc_bandwidth_info_t, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get pcie bandwidth\n\n @details Given a device index @p dv_ind, this function returns bandwidth of\n pcie @p rsmi_pcie_bandwidth_info_t corresponding to the channel of device with\n the provided device index @p dv_ind and channel index @p chan_id.\n\n @param[in] dv_ind a device index\n\n @param[in] delay a delay of time\n\n @param[inout] pcie_bw A pointer to caller-provided memory to which the\n rsmi_pcie_bandwidth_info_t will be written. If this parameter is\n nullptr, this function will return ::RSMI_STATUS_INVALID_ARGS\n Bandwidth is in MB/s.\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_INIT_ERROR is returned if BwMonitor init failed\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid"] pub fn rsmi_dev_pcie_bandwidth_get( dv_ind: u32, delay: ::std::os::raw::c_int, pcie_bw: *mut rsmi_pcie_bandwidth_info_t, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get xhcl link number\n\n @details Given a device index @p dv_ind, this function returns number of\n xhcl links corresponding to the device with the provided device index.\n\n @param[in] dv_ind a device index\n\n @param[inout] link_num A pointer to caller-provided memory to which the\n link numger will be written. If this parameter is nullptr, this function\n will return ::RSMI_STATUS_INVALID_ARGS.\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid"] pub fn rsmi_dev_xhcl_link_number_get(dv_ind: u32, link_num: *mut u32) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get xhcl link state\n\n @details Given a device index @p dv_ind and a link index @p link_id, this\n function returns link state corresponding to the provided xhcl link.\n\n @param[in] dv_ind a device index\n\n @param[in] link_id a xhcl link index\n\n @param[inout] link_state A pointer to caller-provided memory to which the\n link state will be written. If this parameter is nullptr, this function\n will return ::RSMI_STATUS_INVALID_ARGS.\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n @retval ::RSMI_STATUS_NO_DATA the provided link is not found"] pub fn rsmi_dev_xhcl_link_state_get( dv_ind: u32, link_id: u32, link_state: *mut u32, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the bdfid of remote device\n\n @details Given a device index @p dv_ind and a link index @p link_id, this\n function returns the type of remote device corresponding to the provided\n xhcl link.\n\n @param[in] dv_ind a device index\n\n @param[in] link_id a xhcl link index\n\n @param[inout] bdfid A pointer to caller-provided memory to which the bdfid\n of remote device will be written. If this parameter is nullptr, this\n function will return ::RSMI_STATUS_INVALID_ARGS.\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n @retval ::RSMI_STATUS_NO_DATA the provided link is not found"] pub fn rsmi_dev_xhcl_link_remote_bdfid_get( dv_ind: u32, link_id: u32, bdfid: *mut u64, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the type of remote device\n\n @details Given a device index @p dv_ind and a link index @p link_id, this\n function returns the type of remote device corresponding to the provided\n xhcl link.\n\n @param[in] dv_ind a device index\n\n @param[in] link_id a xhcl link index\n\n @param[inout] dev_type A pointer to caller-provided memory to which the\n type of remote device will be written. If this parameter is nullptr, this\n function will return ::RSMI_STATUS_INVALID_ARGS.\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n @retval ::RSMI_STATUS_NO_DATA the provided link is not found"] pub fn rsmi_dev_xhcl_link_remote_dev_type_get( dv_ind: u32, link_id: u32, dev_type: *mut RSMI_XHCL_LINK_TYPE, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get CU usage for a device\n\n @details Given a device index @p dv_ind, this function returns usage of cu\n @p percent corresponding to the device with the provided\n device index @p dv_ind.\n\n @param[in] dv_ind a device index\n\n @param[inout] percent A pointer to caller-provided memory to which the\n cu usage will be written. If this parameter is nullptr, this function will\n return ::RSMI_STATUS_INVALID_ARGS\n\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_INIT_ERROR is returned if UsageManager init failed\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid"] pub fn rsmi_dev_cu_usage_get(dv_ind: u32, percent: *mut f32) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the info of a process on a specific device.\n\n @details Given a process id @p pid, a @p dv_ind, this function will\n write the process cu usage for @p pid on the device, if available, to\n the memory pointed to by @p percent.\n\n @param[in] pid The process id of the process for which the device\n currently being used is requested.\n\n @param[in] dv_ind a device index where the process running on.\n\n @param[inout] percent a pointer to memory provided by the caller to which\n process usage will be written.\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call\n @retval ::RSMI_STATUS_INIT_ERROR is returned if UsageManager init failed\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid"] pub fn rsmi_dev_proc_usage_get(pid: u32, dv_ind: u32, percent: *mut f32) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get process information about a specific process\n\n @details Given a pointer to an ::rsmi_process_info_v2_t @p proc and a process\n id\n @p pid, this function will write the process information for @p pid, if\n available, to the memory pointed to by @p proc.\n\n @param[in] pid The process ID for which process information is being\n requested\n\n @param[inout] proc a pointer to a ::rsmi_process_info_v2_t to which\n process information for @p pid will be written if it is found.\n\n @retval ::RSMI_STATUS_SUCCESS is returned upon successful call\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n @retval ::RSMI_STATUS_NOT_FOUND is returned if there was no process\n information\n found for the provided @p pid\n"] pub fn rsmi_compute_process_info_by_pid_get_v2( pid: u32, proc_: *mut rsmi_process_info_v2_t, ) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the ratio of time the HCU is active\n\n @details Given a device index @p dv_ind and a duration of time @p duration,\n this function returns the ratio of time the HCU is active in this duration.\n\n @param[in] dv_ind a device index\n\n @param[in] duration a duration of time\n\n @param[inout] percent A pointer to caller-provided memory to which the\n ratio of time the HCU is active in this duration will be written. If this\n parameter is nullptr, this function will return ::RSMI_STATUS_INVALID_ARGS.\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments"] pub fn rsmi_dev_hcu_util_get(dv_ind: u32, duration: u32, percent: *mut f32) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the ratio of cycles an CU has at least 1 wave assigned, this\n value represents the average of all CUs\n\n @details Given a device index @p dv_ind and a duration of time @p duration,\n this function returns the ratio of cycles an CU has at least 1 wave assigned\n in this duration.\n\n @param[in] dv_ind a device index\n\n @param[in] duration a duration of time\n\n @param[inout] percent A pointer to caller-provided memory to which the\n ratio of cycles an CU has at least 1 wave assigned in this duration will be\n written. If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS.\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments"] pub fn rsmi_dev_cu_util_get(dv_ind: u32, duration: u32, percent: *mut f32) -> rsmi_status_t; } unsafe extern "C" { #[doc = " @brief Get the ratio of number of waves resident on an CU, this value\n represents the average of all CUs\n\n @details Given a device index @p dv_ind and a duration of time @p duration,\n this function returns the ratio of number of waves resident on an CU\n in this duration.\n\n @param[in] dv_ind a device index\n\n @param[in] duration a duration of time\n\n @param[inout] percent A pointer to caller-provided memory to which the\n ratio of number of waves resident on an CU in this duration will be\n written. If this parameter is nullptr, this function will return\n ::RSMI_STATUS_INVALID_ARGS.\n @retval ::RSMI_STATUS_SUCCESS call was successful\n @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid\n @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not\n support this function with the given arguments"] pub fn rsmi_dev_wave_util_get(dv_ind: u32, duration: u32, percent: *mut f32) -> rsmi_status_t; } unsafe extern "C" { pub fn rsmi_dev_se_util_get(dv_ind: u32, se_usage: *mut rsmi_se_usage_info_t) -> rsmi_status_t; } unsafe extern "C" { pub fn rsmi_dev_cu_num_get(dv_ind: u32, cu_cnt: *mut ::std::os::raw::c_int) -> rsmi_status_t; } #[cfg(test)] mod test { use super::*; use std::ffi::{c_char, CStr}; #[test] fn test_rocm_smi() { unsafe { let stat = rsmi_init(0); assert_eq!(stat, 0); let mut build = vec![0u8; 256]; let mut version:rsmi_version_t = rsmi_version_t{ major: 0, minor: 0, patch: 0, build: build.as_mut_ptr() as *const c_char, }; let stat = rsmi_version_get(&mut version); assert_eq!(stat, 0); println!("ROCM SMI Version: {}.{}.{}-{}", version.major, version.minor, version.patch, CStr::from_ptr(version.build).to_string_lossy()); let mut num_devices = 0; rsmi_num_monitor_devices(&mut num_devices); println!("Number of devices: {}", num_devices); let stat = rsmi_shut_down(); assert_eq!(stat, 0); } } }