/* partially generated by rust-bindgen 0.72.1 */
/* generated from: amdsmi-rocm-6.3.0.h */

/* manual tweaks here */
/// A structure whose definition is unknown at this point.
/// The actual definition can be found in the bindings for a specific version of amdsmi.
#[repr(C)]
pub struct OpaqueStruct {
    _data: (),
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type amdsmi_version_t = OpaqueStruct;
pub type amdsmi_asic_info_t = OpaqueStruct;
pub type amdsmi_proc_info_t = OpaqueStruct;
pub type amdsmi_power_info_t = OpaqueStruct;

/// Status code returned by amdsmi.
/// Except from [`AMDSMI_STATUS_SUCCESS`] and a few other statuses, the actual code values depend on the version of amdsmi.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(transparent)]
pub struct amdsmi_status_t(pub ::std::os::raw::c_uint);

// below are some stable status codes that we need
pub const AMDSMI_STATUS_SUCCESS: amdsmi_status_t = amdsmi_status_t(0);
pub const AMDSMI_STATUS_INVAL: amdsmi_status_t = amdsmi_status_t(1);
pub const AMDSMI_STATUS_NOT_SUPPORTED: amdsmi_status_t = amdsmi_status_t(2);
pub const AMDSMI_STATUS_NOT_YET_IMPLEMENTED: amdsmi_status_t = amdsmi_status_t(3);
pub const AMDSMI_STATUS_FAIL_LOAD_MODULE: amdsmi_status_t = amdsmi_status_t(4);
pub const AMDSMI_STATUS_FAIL_LOAD_SYMBOL: amdsmi_status_t = amdsmi_status_t(5);
pub const AMDSMI_STATUS_DRM_ERROR: amdsmi_status_t = amdsmi_status_t(6);
pub const AMDSMI_STATUS_API_FAILED: amdsmi_status_t = amdsmi_status_t(7);
pub const AMDSMI_STATUS_TIMEOUT: amdsmi_status_t = amdsmi_status_t(8);
pub const AMDSMI_STATUS_RETRY: amdsmi_status_t = amdsmi_status_t(9);
pub const AMDSMI_STATUS_NO_PERM: amdsmi_status_t = amdsmi_status_t(10);
pub const AMDSMI_STATUS_INTERRUPT: amdsmi_status_t = amdsmi_status_t(11);
pub const AMDSMI_STATUS_IO: amdsmi_status_t = amdsmi_status_t(12);
pub const AMDSMI_STATUS_ADDRESS_FAULT: amdsmi_status_t = amdsmi_status_t(13);
pub const AMDSMI_STATUS_FILE_ERROR: amdsmi_status_t = amdsmi_status_t(14);
pub const AMDSMI_STATUS_OUT_OF_RESOURCES: amdsmi_status_t = amdsmi_status_t(15);
pub const AMDSMI_STATUS_UNEXPECTED_DATA: amdsmi_status_t = amdsmi_status_t(43);

// other constants
pub const AMDSMI_MAX_FAN_SPEED: u32 = 255;
pub const AMDSMI_GPU_UUID_SIZE: u32 = 38;
/* ---------- */

impl amdsmi_init_flags_t {
    #[doc = "```text\n!< Initialize all processors\n```"]
    pub const AMDSMI_INIT_ALL_PROCESSORS: amdsmi_init_flags_t = amdsmi_init_flags_t(4294967295);
    pub const AMDSMI_INIT_AMD_CPUS: amdsmi_init_flags_t = amdsmi_init_flags_t(1);
    pub const AMDSMI_INIT_AMD_GPUS: amdsmi_init_flags_t = amdsmi_init_flags_t(2);
    pub const AMDSMI_INIT_NON_AMD_CPUS: amdsmi_init_flags_t = amdsmi_init_flags_t(4);
    pub const AMDSMI_INIT_NON_AMD_GPUS: amdsmi_init_flags_t = amdsmi_init_flags_t(8);
    pub const AMDSMI_INIT_AMD_APUS: amdsmi_init_flags_t = amdsmi_init_flags_t(3);
}
#[repr(transparent)]
#[doc = "```text\n @brief Initialization flags\n\n Initialization flags may be OR'd together and passed to ::amdsmi_init().\n```"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct amdsmi_init_flags_t(pub ::std::os::raw::c_uint);
#[doc = "```text\n! opaque handler point to underlying implementation\n```"]
pub type amdsmi_processor_handle = *mut ::std::os::raw::c_void;
pub type amdsmi_socket_handle = *mut ::std::os::raw::c_void;
impl amdsmi_clk_type_t {
    #[doc = "```text\n!< System clock\n```"]
    pub const AMDSMI_CLK_TYPE_SYS: amdsmi_clk_type_t = amdsmi_clk_type_t(0);
    pub const AMDSMI_CLK_TYPE_FIRST: amdsmi_clk_type_t = amdsmi_clk_type_t(0);
    pub const AMDSMI_CLK_TYPE_GFX: amdsmi_clk_type_t = amdsmi_clk_type_t(0);
    #[doc = "```text\n!< Data Fabric clock (for ASICs\n!< running on a separate clock)\n```"]
    pub const AMDSMI_CLK_TYPE_DF: amdsmi_clk_type_t = amdsmi_clk_type_t(1);
    #[doc = "```text\n!< Display Controller Engine clock\n```"]
    pub const AMDSMI_CLK_TYPE_DCEF: amdsmi_clk_type_t = amdsmi_clk_type_t(2);
    pub const AMDSMI_CLK_TYPE_SOC: amdsmi_clk_type_t = amdsmi_clk_type_t(3);
    pub const AMDSMI_CLK_TYPE_MEM: amdsmi_clk_type_t = amdsmi_clk_type_t(4);
    pub const AMDSMI_CLK_TYPE_PCIE: amdsmi_clk_type_t = amdsmi_clk_type_t(5);
    pub const AMDSMI_CLK_TYPE_VCLK0: amdsmi_clk_type_t = amdsmi_clk_type_t(6);
    pub const AMDSMI_CLK_TYPE_VCLK1: amdsmi_clk_type_t = amdsmi_clk_type_t(7);
    pub const AMDSMI_CLK_TYPE_DCLK0: amdsmi_clk_type_t = amdsmi_clk_type_t(8);
    pub const AMDSMI_CLK_TYPE_DCLK1: amdsmi_clk_type_t = amdsmi_clk_type_t(9);
    pub const AMDSMI_CLK_TYPE__MAX: amdsmi_clk_type_t = amdsmi_clk_type_t(9);
}
#[repr(transparent)]
#[doc = "```text\n @brief Clock types\n```"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct amdsmi_clk_type_t(pub ::std::os::raw::c_uint);
impl amdsmi_temperature_type_t {
    pub const AMDSMI_TEMPERATURE_TYPE_EDGE: amdsmi_temperature_type_t =
        amdsmi_temperature_type_t(0);
    pub const AMDSMI_TEMPERATURE_TYPE_FIRST: amdsmi_temperature_type_t =
        amdsmi_temperature_type_t(0);
    pub const AMDSMI_TEMPERATURE_TYPE_HOTSPOT: amdsmi_temperature_type_t =
        amdsmi_temperature_type_t(1);
    pub const AMDSMI_TEMPERATURE_TYPE_JUNCTION: amdsmi_temperature_type_t =
        amdsmi_temperature_type_t(1);
    pub const AMDSMI_TEMPERATURE_TYPE_VRAM: amdsmi_temperature_type_t =
        amdsmi_temperature_type_t(2);
    pub const AMDSMI_TEMPERATURE_TYPE_HBM_0: amdsmi_temperature_type_t =
        amdsmi_temperature_type_t(3);
    pub const AMDSMI_TEMPERATURE_TYPE_HBM_1: amdsmi_temperature_type_t =
        amdsmi_temperature_type_t(4);
    pub const AMDSMI_TEMPERATURE_TYPE_HBM_2: amdsmi_temperature_type_t =
        amdsmi_temperature_type_t(5);
    pub const AMDSMI_TEMPERATURE_TYPE_HBM_3: amdsmi_temperature_type_t =
        amdsmi_temperature_type_t(6);
    pub const AMDSMI_TEMPERATURE_TYPE_PLX: amdsmi_temperature_type_t = amdsmi_temperature_type_t(7);
    pub const AMDSMI_TEMPERATURE_TYPE__MAX: amdsmi_temperature_type_t =
        amdsmi_temperature_type_t(7);
}
#[repr(transparent)]
#[doc = "```text\n @brief This enumeration is used to indicate from which part of the device a\n temperature reading should be obtained.\n```"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct amdsmi_temperature_type_t(pub ::std::os::raw::c_uint);
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct amdsmi_clk_info_t {
    pub clk: u32,
    pub min_clk: u32,
    pub max_clk: u32,
    pub clk_locked: u8,
    pub clk_deep_sleep: u8,
    pub reserved: [u32; 4usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of amdsmi_clk_info_t"][::std::mem::size_of::<amdsmi_clk_info_t>() - 32usize];
    ["Alignment of amdsmi_clk_info_t"][::std::mem::align_of::<amdsmi_clk_info_t>() - 4usize];
    ["Offset of field: amdsmi_clk_info_t::clk"]
        [::std::mem::offset_of!(amdsmi_clk_info_t, clk) - 0usize];
    ["Offset of field: amdsmi_clk_info_t::min_clk"]
        [::std::mem::offset_of!(amdsmi_clk_info_t, min_clk) - 4usize];
    ["Offset of field: amdsmi_clk_info_t::max_clk"]
        [::std::mem::offset_of!(amdsmi_clk_info_t, max_clk) - 8usize];
    ["Offset of field: amdsmi_clk_info_t::clk_locked"]
        [::std::mem::offset_of!(amdsmi_clk_info_t, clk_locked) - 12usize];
    ["Offset of field: amdsmi_clk_info_t::clk_deep_sleep"]
        [::std::mem::offset_of!(amdsmi_clk_info_t, clk_deep_sleep) - 13usize];
    ["Offset of field: amdsmi_clk_info_t::reserved"]
        [::std::mem::offset_of!(amdsmi_clk_info_t, reserved) - 16usize];
};
#[doc = "```text\n amdsmi_engine_usage_t:\n This structure holds common\n GPU activity values seen in both BM or\n SRIOV\n```"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct amdsmi_engine_usage_t {
    pub gfx_activity: u32,
    pub umc_activity: u32,
    pub mm_activity: u32,
    pub reserved: [u32; 13usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of amdsmi_engine_usage_t"][::std::mem::size_of::<amdsmi_engine_usage_t>() - 64usize];
    ["Alignment of amdsmi_engine_usage_t"]
        [::std::mem::align_of::<amdsmi_engine_usage_t>() - 4usize];
    ["Offset of field: amdsmi_engine_usage_t::gfx_activity"]
        [::std::mem::offset_of!(amdsmi_engine_usage_t, gfx_activity) - 0usize];
    ["Offset of field: amdsmi_engine_usage_t::umc_activity"]
        [::std::mem::offset_of!(amdsmi_engine_usage_t, umc_activity) - 4usize];
    ["Offset of field: amdsmi_engine_usage_t::mm_activity"]
        [::std::mem::offset_of!(amdsmi_engine_usage_t, mm_activity) - 8usize];
    ["Offset of field: amdsmi_engine_usage_t::reserved"]
        [::std::mem::offset_of!(amdsmi_engine_usage_t, reserved) - 12usize];
};
pub type amdsmi_process_handle_t = u32;
#[doc = "```text\n in bytes\n```"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct amdsmi_proc_info_t_engine_usage_ {
    pub gfx: u64,
    pub enc: u64,
    pub reserved: [u32; 12usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of amdsmi_proc_info_t_engine_usage_"]
        [::std::mem::size_of::<amdsmi_proc_info_t_engine_usage_>() - 64usize];
    ["Alignment of amdsmi_proc_info_t_engine_usage_"]
        [::std::mem::align_of::<amdsmi_proc_info_t_engine_usage_>() - 8usize];
    ["Offset of field: amdsmi_proc_info_t_engine_usage_::gfx"]
        [::std::mem::offset_of!(amdsmi_proc_info_t_engine_usage_, gfx) - 0usize];
    ["Offset of field: amdsmi_proc_info_t_engine_usage_::enc"]
        [::std::mem::offset_of!(amdsmi_proc_info_t_engine_usage_, enc) - 8usize];
    ["Offset of field: amdsmi_proc_info_t_engine_usage_::reserved"]
        [::std::mem::offset_of!(amdsmi_proc_info_t_engine_usage_, reserved) - 16usize];
};
#[doc = "```text\n How much time the process spend using these engines in ns\n```"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct amdsmi_proc_info_t_memory_usage_ {
    pub gtt_mem: u64,
    pub cpu_mem: u64,
    pub vram_mem: u64,
    pub reserved: [u32; 10usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of amdsmi_proc_info_t_memory_usage_"]
        [::std::mem::size_of::<amdsmi_proc_info_t_memory_usage_>() - 64usize];
    ["Alignment of amdsmi_proc_info_t_memory_usage_"]
        [::std::mem::align_of::<amdsmi_proc_info_t_memory_usage_>() - 8usize];
    ["Offset of field: amdsmi_proc_info_t_memory_usage_::gtt_mem"]
        [::std::mem::offset_of!(amdsmi_proc_info_t_memory_usage_, gtt_mem) - 0usize];
    ["Offset of field: amdsmi_proc_info_t_memory_usage_::cpu_mem"]
        [::std::mem::offset_of!(amdsmi_proc_info_t_memory_usage_, cpu_mem) - 8usize];
    ["Offset of field: amdsmi_proc_info_t_memory_usage_::vram_mem"]
        [::std::mem::offset_of!(amdsmi_proc_info_t_memory_usage_, vram_mem) - 16usize];
    ["Offset of field: amdsmi_proc_info_t_memory_usage_::reserved"]
        [::std::mem::offset_of!(amdsmi_proc_info_t_memory_usage_, reserved) - 24usize];
};
impl amdsmi_temperature_metric_t {
    #[doc = "```text\n!< Temperature current value.\n```"]
    pub const AMDSMI_TEMP_CURRENT: amdsmi_temperature_metric_t = amdsmi_temperature_metric_t(0);
    pub const AMDSMI_TEMP_FIRST: amdsmi_temperature_metric_t = amdsmi_temperature_metric_t(0);
    #[doc = "```text\n!< Temperature max value.\n```"]
    pub const AMDSMI_TEMP_MAX: amdsmi_temperature_metric_t = amdsmi_temperature_metric_t(1);
    #[doc = "```text\n!< Temperature min value.\n```"]
    pub const AMDSMI_TEMP_MIN: amdsmi_temperature_metric_t = amdsmi_temperature_metric_t(2);
    #[doc = "```text\n!< Temperature hysteresis value for max limit.\n!< (This is an absolute temperature, not a\n!< delta).\n```"]
    pub const AMDSMI_TEMP_MAX_HYST: amdsmi_temperature_metric_t = amdsmi_temperature_metric_t(3);
    #[doc = "```text\n!< Temperature hysteresis value for min limit.\n!< (This is an absolute temperature,\n!<  not a delta).\n```"]
    pub const AMDSMI_TEMP_MIN_HYST: amdsmi_temperature_metric_t = amdsmi_temperature_metric_t(4);
    #[doc = "```text\n!< Temperature critical max value, typically\n!<  greater than corresponding temp_max values.\n```"]
    pub const AMDSMI_TEMP_CRITICAL: amdsmi_temperature_metric_t = amdsmi_temperature_metric_t(5);
    #[doc = "```text\n!< Temperature hysteresis value for critical\n!<  limit. (This is an absolute temperature,\n!<  not a delta).\n```"]
    pub const AMDSMI_TEMP_CRITICAL_HYST: amdsmi_temperature_metric_t =
        amdsmi_temperature_metric_t(6);
    #[doc = "```text\n!< 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.\n```"]
    pub const AMDSMI_TEMP_EMERGENCY: amdsmi_temperature_metric_t = amdsmi_temperature_metric_t(7);
    #[doc = "```text\n!< Temperature hysteresis value for emergency\n!<  limit. (This is an absolute temperature,\n!<  not a delta).\n```"]
    pub const AMDSMI_TEMP_EMERGENCY_HYST: amdsmi_temperature_metric_t =
        amdsmi_temperature_metric_t(8);
    #[doc = "```text\n!< Temperature critical min value, typically\n!<  lower than corresponding temperature\n!<  minimum values.\n```"]
    pub const AMDSMI_TEMP_CRIT_MIN: amdsmi_temperature_metric_t = amdsmi_temperature_metric_t(9);
    #[doc = "```text\n!< Temperature hysteresis value for critical\n!< minimum limit. (This is an absolute\n!< temperature, not a delta).\n```"]
    pub const AMDSMI_TEMP_CRIT_MIN_HYST: amdsmi_temperature_metric_t =
        amdsmi_temperature_metric_t(10);
    #[doc = "```text\n!< Temperature offset which is added to the\n```"]
    pub const AMDSMI_TEMP_OFFSET: amdsmi_temperature_metric_t = amdsmi_temperature_metric_t(11);
    #[doc = "```text\n!< Historical minimum temperature.\n```"]
    pub const AMDSMI_TEMP_LOWEST: amdsmi_temperature_metric_t = amdsmi_temperature_metric_t(12);
    #[doc = "```text\n!< Historical maximum temperature.\n```"]
    pub const AMDSMI_TEMP_HIGHEST: amdsmi_temperature_metric_t = amdsmi_temperature_metric_t(13);
    pub const AMDSMI_TEMP_LAST: amdsmi_temperature_metric_t = amdsmi_temperature_metric_t(13);
}
#[repr(transparent)]
#[doc = "```text\n @brief Temperature Metrics.  This enum is used to identify various\n temperature metrics. Corresponding values will be in millidegress\n Celcius.\n```"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct amdsmi_temperature_metric_t(pub ::std::os::raw::c_uint);
impl amdsmi_voltage_metric_t {
    #[doc = "```text\n!< Voltage current value.\n```"]
    pub const AMDSMI_VOLT_CURRENT: amdsmi_voltage_metric_t = amdsmi_voltage_metric_t(0);
    pub const AMDSMI_VOLT_FIRST: amdsmi_voltage_metric_t = amdsmi_voltage_metric_t(0);
    #[doc = "```text\n!< Voltage max value.\n```"]
    pub const AMDSMI_VOLT_MAX: amdsmi_voltage_metric_t = amdsmi_voltage_metric_t(1);
    #[doc = "```text\n!< Voltage critical min value.\n```"]
    pub const AMDSMI_VOLT_MIN_CRIT: amdsmi_voltage_metric_t = amdsmi_voltage_metric_t(2);
    #[doc = "```text\n!< Voltage min value.\n```"]
    pub const AMDSMI_VOLT_MIN: amdsmi_voltage_metric_t = amdsmi_voltage_metric_t(3);
    #[doc = "```text\n!< Voltage critical max value.\n```"]
    pub const AMDSMI_VOLT_MAX_CRIT: amdsmi_voltage_metric_t = amdsmi_voltage_metric_t(4);
    #[doc = "```text\n!< Average voltage.\n```"]
    pub const AMDSMI_VOLT_AVERAGE: amdsmi_voltage_metric_t = amdsmi_voltage_metric_t(5);
    #[doc = "```text\n!< Historical minimum voltage.\n```"]
    pub const AMDSMI_VOLT_LOWEST: amdsmi_voltage_metric_t = amdsmi_voltage_metric_t(6);
    #[doc = "```text\n!< Historical maximum voltage.\n```"]
    pub const AMDSMI_VOLT_HIGHEST: amdsmi_voltage_metric_t = amdsmi_voltage_metric_t(7);
    pub const AMDSMI_VOLT_LAST: amdsmi_voltage_metric_t = amdsmi_voltage_metric_t(7);
}
#[repr(transparent)]
#[doc = "```text\n @brief Voltage Metrics.  This enum is used to identify various\n Volatge metrics. Corresponding values will be in millivolt.\n\n```"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct amdsmi_voltage_metric_t(pub ::std::os::raw::c_uint);
impl amdsmi_voltage_type_t {
    pub const AMDSMI_VOLT_TYPE_FIRST: amdsmi_voltage_type_t = amdsmi_voltage_type_t(0);
    #[doc = "```text\n!< Vddgfx GPU\n!< voltage\n```"]
    pub const AMDSMI_VOLT_TYPE_VDDGFX: amdsmi_voltage_type_t = amdsmi_voltage_type_t(0);
    pub const AMDSMI_VOLT_TYPE_LAST: amdsmi_voltage_type_t = amdsmi_voltage_type_t(0);
    #[doc = "```text\n!< Invalid type\n```"]
    pub const AMDSMI_VOLT_TYPE_INVALID: amdsmi_voltage_type_t = amdsmi_voltage_type_t(4294967295);
}
#[repr(transparent)]
#[doc = "```text\n @brief This ennumeration is used to indicate which type of\n voltage reading should be obtained.\n```"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct amdsmi_voltage_type_t(pub ::std::os::raw::c_uint);
impl amdsmi_memory_type_t {
    pub const AMDSMI_MEM_TYPE_FIRST: amdsmi_memory_type_t = amdsmi_memory_type_t(0);
    #[doc = "```text\n!< VRAM memory\n```"]
    pub const AMDSMI_MEM_TYPE_VRAM: amdsmi_memory_type_t = amdsmi_memory_type_t(0);
    #[doc = "```text\n!< VRAM memory that is visible\n```"]
    pub const AMDSMI_MEM_TYPE_VIS_VRAM: amdsmi_memory_type_t = amdsmi_memory_type_t(1);
    #[doc = "```text\n!< GTT memory\n```"]
    pub const AMDSMI_MEM_TYPE_GTT: amdsmi_memory_type_t = amdsmi_memory_type_t(2);
    pub const AMDSMI_MEM_TYPE_LAST: amdsmi_memory_type_t = amdsmi_memory_type_t(2);
}
#[repr(transparent)]
#[doc = "```text\n @brief Types of memory\n```"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct amdsmi_memory_type_t(pub ::std::os::raw::c_uint);
pub struct libamd_smi {
    __library: ::libloading::Library,
    pub amdsmi_init:
        Result<unsafe extern "C" fn(init_flags: u64) -> amdsmi_status_t, ::libloading::Error>,
    pub amdsmi_shut_down: Result<unsafe extern "C" fn() -> amdsmi_status_t, ::libloading::Error>,
    pub amdsmi_get_socket_handles: Result<
        unsafe extern "C" fn(
            socket_count: *mut u32,
            socket_handles: *mut amdsmi_socket_handle,
        ) -> amdsmi_status_t,
        ::libloading::Error,
    >,
    pub amdsmi_get_processor_handles: Result<
        unsafe extern "C" fn(
            socket_handle: amdsmi_socket_handle,
            processor_count: *mut u32,
            processor_handles: *mut amdsmi_processor_handle,
        ) -> amdsmi_status_t,
        ::libloading::Error,
    >,
    pub amdsmi_get_gpu_pci_throughput: Result<
        unsafe extern "C" fn(
            processor_handle: amdsmi_processor_handle,
            sent: *mut u64,
            received: *mut u64,
            max_pkt_sz: *mut u64,
        ) -> amdsmi_status_t,
        ::libloading::Error,
    >,
    pub amdsmi_get_energy_count: Result<
        unsafe extern "C" fn(
            processor_handle: amdsmi_processor_handle,
            energy_accumulator: *mut u64,
            counter_resolution: *mut f32,
            timestamp: *mut u64,
        ) -> amdsmi_status_t,
        ::libloading::Error,
    >,
    pub amdsmi_get_gpu_memory_usage: Result<
        unsafe extern "C" fn(
            processor_handle: amdsmi_processor_handle,
            mem_type: amdsmi_memory_type_t,
            used: *mut u64,
        ) -> amdsmi_status_t,
        ::libloading::Error,
    >,
    pub amdsmi_get_gpu_fan_speed: Result<
        unsafe extern "C" fn(
            processor_handle: amdsmi_processor_handle,
            sensor_ind: u32,
            speed: *mut i64,
        ) -> amdsmi_status_t,
        ::libloading::Error,
    >,
    pub amdsmi_get_temp_metric: Result<
        unsafe extern "C" fn(
            processor_handle: amdsmi_processor_handle,
            sensor_type: amdsmi_temperature_type_t,
            metric: amdsmi_temperature_metric_t,
            temperature: *mut i64,
        ) -> amdsmi_status_t,
        ::libloading::Error,
    >,
    pub amdsmi_get_gpu_volt_metric: Result<
        unsafe extern "C" fn(
            processor_handle: amdsmi_processor_handle,
            sensor_type: amdsmi_voltage_type_t,
            metric: amdsmi_voltage_metric_t,
            voltage: *mut i64,
        ) -> amdsmi_status_t,
        ::libloading::Error,
    >,
    pub amdsmi_get_lib_version: Result<
        unsafe extern "C" fn(version: *mut amdsmi_version_t) -> amdsmi_status_t,
        ::libloading::Error,
    >,
    pub amdsmi_status_code_to_string: Result<
        unsafe extern "C" fn(
            status: amdsmi_status_t,
            status_string: *mut *const ::std::os::raw::c_char,
        ) -> amdsmi_status_t,
        ::libloading::Error,
    >,
    pub amdsmi_get_gpu_device_uuid: Result<
        unsafe extern "C" fn(
            processor_handle: amdsmi_processor_handle,
            uuid_length: *mut ::std::os::raw::c_uint,
            uuid: *mut ::std::os::raw::c_char,
        ) -> amdsmi_status_t,
        ::libloading::Error,
    >,
    pub amdsmi_get_gpu_asic_info: Result<
        unsafe extern "C" fn(
            processor_handle: amdsmi_processor_handle,
            info: *mut amdsmi_asic_info_t,
        ) -> amdsmi_status_t,
        ::libloading::Error,
    >,
    pub amdsmi_get_gpu_activity: Result<
        unsafe extern "C" fn(
            processor_handle: amdsmi_processor_handle,
            info: *mut amdsmi_engine_usage_t,
        ) -> amdsmi_status_t,
        ::libloading::Error,
    >,
    pub amdsmi_get_power_info: Result<
        unsafe extern "C" fn(
            processor_handle: amdsmi_processor_handle,
            info: *mut amdsmi_power_info_t,
        ) -> amdsmi_status_t,
        ::libloading::Error,
    >,
    pub amdsmi_is_gpu_power_management_enabled: Result<
        unsafe extern "C" fn(
            processor_handle: amdsmi_processor_handle,
            enabled: *mut bool,
        ) -> amdsmi_status_t,
        ::libloading::Error,
    >,
    pub amdsmi_get_clock_info: Result<
        unsafe extern "C" fn(
            processor_handle: amdsmi_processor_handle,
            clk_type: amdsmi_clk_type_t,
            info: *mut amdsmi_clk_info_t,
        ) -> amdsmi_status_t,
        ::libloading::Error,
    >,
    pub amdsmi_get_gpu_process_list: Result<
        unsafe extern "C" fn(
            processor_handle: amdsmi_processor_handle,
            max_processes: *mut u32,
            list: *mut amdsmi_proc_info_t,
        ) -> amdsmi_status_t,
        ::libloading::Error,
    >,
}
impl libamd_smi {
    pub unsafe fn new<P>(path: P) -> Result<Self, ::libloading::Error>
    where
        P: AsRef<::std::ffi::OsStr>,
    {
        let library = ::libloading::Library::new(path)?;
        Self::from_library(library)
    }
    pub unsafe fn from_library<L>(library: L) -> Result<Self, ::libloading::Error>
    where
        L: Into<::libloading::Library>,
    {
        let __library = library.into();
        let amdsmi_init = __library.get(b"amdsmi_init\0").map(|sym| *sym);
        let amdsmi_shut_down = __library.get(b"amdsmi_shut_down\0").map(|sym| *sym);
        let amdsmi_get_socket_handles = __library
            .get(b"amdsmi_get_socket_handles\0")
            .map(|sym| *sym);
        let amdsmi_get_processor_handles = __library
            .get(b"amdsmi_get_processor_handles\0")
            .map(|sym| *sym);
        let amdsmi_get_gpu_pci_throughput = __library
            .get(b"amdsmi_get_gpu_pci_throughput\0")
            .map(|sym| *sym);
        let amdsmi_get_energy_count = __library.get(b"amdsmi_get_energy_count\0").map(|sym| *sym);
        let amdsmi_get_gpu_memory_usage = __library
            .get(b"amdsmi_get_gpu_memory_usage\0")
            .map(|sym| *sym);
        let amdsmi_get_gpu_fan_speed = __library.get(b"amdsmi_get_gpu_fan_speed\0").map(|sym| *sym);
        let amdsmi_get_temp_metric = __library.get(b"amdsmi_get_temp_metric\0").map(|sym| *sym);
        let amdsmi_get_gpu_volt_metric = __library
            .get(b"amdsmi_get_gpu_volt_metric\0")
            .map(|sym| *sym);
        let amdsmi_get_lib_version = __library.get(b"amdsmi_get_lib_version\0").map(|sym| *sym);
        let amdsmi_status_code_to_string = __library
            .get(b"amdsmi_status_code_to_string\0")
            .map(|sym| *sym);
        let amdsmi_get_gpu_device_uuid = __library
            .get(b"amdsmi_get_gpu_device_uuid\0")
            .map(|sym| *sym);
        let amdsmi_get_gpu_asic_info = __library.get(b"amdsmi_get_gpu_asic_info\0").map(|sym| *sym);
        let amdsmi_get_gpu_activity = __library.get(b"amdsmi_get_gpu_activity\0").map(|sym| *sym);
        let amdsmi_get_power_info = __library.get(b"amdsmi_get_power_info\0").map(|sym| *sym);
        let amdsmi_is_gpu_power_management_enabled = __library
            .get(b"amdsmi_is_gpu_power_management_enabled\0")
            .map(|sym| *sym);
        let amdsmi_get_clock_info = __library.get(b"amdsmi_get_clock_info\0").map(|sym| *sym);
        let amdsmi_get_gpu_process_list = __library
            .get(b"amdsmi_get_gpu_process_list\0")
            .map(|sym| *sym);
        Ok(libamd_smi {
            __library,
            amdsmi_init,
            amdsmi_shut_down,
            amdsmi_get_socket_handles,
            amdsmi_get_processor_handles,
            amdsmi_get_gpu_pci_throughput,
            amdsmi_get_energy_count,
            amdsmi_get_gpu_memory_usage,
            amdsmi_get_gpu_fan_speed,
            amdsmi_get_temp_metric,
            amdsmi_get_gpu_volt_metric,
            amdsmi_get_lib_version,
            amdsmi_status_code_to_string,
            amdsmi_get_gpu_device_uuid,
            amdsmi_get_gpu_asic_info,
            amdsmi_get_gpu_activity,
            amdsmi_get_power_info,
            amdsmi_is_gpu_power_management_enabled,
            amdsmi_get_clock_info,
            amdsmi_get_gpu_process_list,
        })
    }
    #[doc = "```text\n  @brief Initialize the AMD SMI library\n\n  @platform{gpu_bm_linux}  @platform{host} @platform{cpu_bm}  @platform{guest_1vf}\n  @platform{guest_mvf} @platform{guest_windows}\n\n  @details This function initializes the library and the internal data structures,\n  including those corresponding to sources of information that SMI provides.\n\n  The @p init_flags decides which type of processor\n  can be discovered by ::amdsmi_get_socket_handles(). AMDSMI_INIT_AMD_GPUS returns\n  sockets with AMD GPUS, and AMDSMI_INIT_AMD_GPUS | AMDSMI_INIT_AMD_CPUS returns\n  sockets with either AMD GPUS or CPUS.\n  Currently, only AMDSMI_INIT_AMD_GPUS is supported.\n\n  @param[in] init_flags Bit flags that tell SMI how to initialze. Values of\n  ::amdsmi_init_flags_t may be OR'd together and passed through @p init_flags\n  to modify how AMDSMI initializes.\n\n  @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail\n```"]
    pub unsafe fn amdsmi_init(&self, init_flags: u64) -> amdsmi_status_t {
        (self
            .amdsmi_init
            .as_ref()
            .expect("Expected function, got error."))(init_flags)
    }
    #[doc = "```text\n  @brief Shutdown the AMD SMI library\n\n  @platform{gpu_bm_linux}  @platform{host} @platform{cpu_bm}  @platform{guest_1vf}\n  @platform{guest_mvf} @platform{guest_windows}\n\n  @details This function shuts down the library and internal data structures and\n  performs any necessary clean ups.\n\n  @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail\n```"]
    pub unsafe fn amdsmi_shut_down(&self) -> amdsmi_status_t {
        (self
            .amdsmi_shut_down
            .as_ref()
            .expect("Expected function, got error."))()
    }
    #[doc = "```text\n  @brief Get the list of socket handles in the system.\n\n  @platform{gpu_bm_linux}  @platform{host} @platform{cpu_bm}  @platform{guest_1vf}\n  @platform{guest_mvf} @platform{guest_windows}\n\n  @details Depends on what flag is passed to ::amdsmi_init.  AMDSMI_INIT_AMD_GPUS\n  returns sockets with AMD GPUS, and AMDSMI_INIT_AMD_GPUS | AMDSMI_INIT_AMD_CPUS returns\n  sockets with either AMD GPUS or CPUS.\n  The socket handles can be used to query the processor handles in that socket, which\n  will be used in other APIs to get processor detail information or telemtries.\n\n  @param[in,out] socket_count As input, the value passed\n  through this parameter is the number of ::amdsmi_socket_handle that\n  may be safely written to the memory pointed to by @p socket_handles. This is the\n  limit on how many socket handles will be written to @p socket_handles. On return, @p\n  socket_count will contain the number of socket handles written to @p socket_handles,\n  or the number of socket handles that could have been written if enough memory had been\n  provided.\n  If @p socket_handles is NULL, as output, @p socket_count will contain\n  how many sockets are available to read in the system.\n\n  @param[in,out] socket_handles A pointer to a block of memory to which the\n  ::amdsmi_socket_handle values will be written. This value may be NULL.\n  In this case, this function can be used to query how many sockets are\n  available to read in the system.\n\n  @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail\n```"]
    pub unsafe fn amdsmi_get_socket_handles(
        &self,
        socket_count: *mut u32,
        socket_handles: *mut amdsmi_socket_handle,
    ) -> amdsmi_status_t {
        (self
            .amdsmi_get_socket_handles
            .as_ref()
            .expect("Expected function, got error."))(socket_count, socket_handles)
    }
    #[doc = "```text\n  @brief Get the list of the processor handles associated to a socket.\n\n  @platform{gpu_bm_linux}  @platform{host} @platform{guest_1vf}\n  @platform{guest_mvf} @platform{guest_windows}\n\n  @details This function retrieves the processor handles of a socket. The\n  @p socket_handle must be provided for the processor. A socket may have mulitple different\n  type processors: An APU on a socket have both CPUs and GPUs.\n  Currently, only AMD GPUs are supported.\n\n  The number of processor count is returned through @p processor_count\n  if @p processor_handles is NULL. Then the number of @p processor_count can be pass\n  as input to retrieval all processors on the socket to @p processor_handles.\n\n  @param[in] socket_handle The socket to query\n\n  @param[in,out] processor_count As input, the value passed\n  through this parameter is the number of ::amdsmi_processor_handle's that\n  may be safely written to the memory pointed to by @p processor_handles. This is the\n  limit on how many processor handles will be written to @p processor_handles. On return, @p\n  processor_count will contain the number of processor handles written to @p processor_handles,\n  or the number of processor handles that could have been written if enough memory had been\n  provided.\n  If @p processor_handles is NULL, as output, @p processor_count will contain\n  how many processors are available to read for the socket.\n\n  @param[in,out] processor_handles A pointer to a block of memory to which the\n  ::amdsmi_processor_handle values will be written. This value may be NULL.\n  In this case, this function can be used to query how many processors are\n  available to read.\n\n  @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail\n```"]
    pub unsafe fn amdsmi_get_processor_handles(
        &self,
        socket_handle: amdsmi_socket_handle,
        processor_count: *mut u32,
        processor_handles: *mut amdsmi_processor_handle,
    ) -> amdsmi_status_t {
        (self
            .amdsmi_get_processor_handles
            .as_ref()
            .expect("Expected function, got error."))(
            socket_handle,
            processor_count,
            processor_handles,
        )
    }
    #[doc = "```text\n  @brief Get PCIe traffic information. It is not supported on virtual machine guest\n\n  @platform{gpu_bm_linux}\n\n  @details Give a processor handle @p processor_handle 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] processor_handle a processor handle\n\n  @param[in,out] 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[in,out] 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[in,out] 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  @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail\n```"]
    pub unsafe fn amdsmi_get_gpu_pci_throughput(
        &self,
        processor_handle: amdsmi_processor_handle,
        sent: *mut u64,
        received: *mut u64,
        max_pkt_sz: *mut u64,
    ) -> amdsmi_status_t {
        (self
            .amdsmi_get_gpu_pci_throughput
            .as_ref()
            .expect("Expected function, got error."))(
            processor_handle, sent, received, max_pkt_sz
        )
    }
    #[doc = "```text\n  @brief Get the energy accumulator counter of the processor with provided\n  processor handle. It is not supported on virtual machine guest\n\n  @platform{gpu_bm_linux}\n\n  @details Given a processor handle @p processor_handle, a pointer to a uint64_t\n  @p energy_accumulator, and a pointer to a uint64_t @p timestamp, this function\n  will write amount of energy consumed to the uint64_t pointed to by\n  @p energy_accumulator, and the timestamp to the uint64_t pointed to by @p timestamp.\n  This function accumulates all energy consumed.\n\n  @param[in] processor_handle a processor handle\n\n  @param[in,out] energy_accumulator 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  ::AMDSMI_STATUS_INVAL if the function is supported with the provided,\n  and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n  provided arguments.\n\n  @param[in,out] counter_resolution resolution of the counter @p energy_accumulator in\n  micro Joules\n\n  @param[in,out] timestamp a pointer to uint64_t to which the timestamp\n  will be written. Resolution: 1 ns.\n\n  @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail\n```"]
    pub unsafe fn amdsmi_get_energy_count(
        &self,
        processor_handle: amdsmi_processor_handle,
        energy_accumulator: *mut u64,
        counter_resolution: *mut f32,
        timestamp: *mut u64,
    ) -> amdsmi_status_t {
        (self
            .amdsmi_get_energy_count
            .as_ref()
            .expect("Expected function, got error."))(
            processor_handle,
            energy_accumulator,
            counter_resolution,
            timestamp,
        )
    }
    #[doc = "```text\n  @brief Get the current memory usage\n\n  @platform{gpu_bm_linux}  @platform{guest_1vf}  @platform{guest_mvf}\n\n  @details This function will write the amount of @p mem_type memory that\n  that is currently being used to the location pointed to by @p used.\n\n  @param[in] processor_handle a processor handle\n\n  @param[in] mem_type The type of memory for which the amount being used will\n  be found\n\n  @param[in,out] 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  ::AMDSMI_STATUS_INVAL if the function is supported with the provided,\n  arguments and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n  provided arguments.\n\n  @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail\n```"]
    pub unsafe fn amdsmi_get_gpu_memory_usage(
        &self,
        processor_handle: amdsmi_processor_handle,
        mem_type: amdsmi_memory_type_t,
        used: *mut u64,
    ) -> amdsmi_status_t {
        (self
            .amdsmi_get_gpu_memory_usage
            .as_ref()
            .expect("Expected function, got error."))(processor_handle, mem_type, used)
    }
    #[doc = "```text\n  @brief Get the fan speed for the specified device as a value relative to\n  ::AMDSMI_MAX_FAN_SPEED. It is not supported on virtual machine guest\n\n  @platform{gpu_bm_linux}\n\n  @details Given a processor handle @p processor_handle 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, ::AMDSMI_MAX_FAN_SPEED) to the uint32_t\n  pointed to by @p speed\n\n  @param[in] processor_handle a processor handle\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,out] 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  ::AMDSMI_STATUS_INVAL if the function is supported with the provided,\n  arguments and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n  provided arguments.\n\n  @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail\n```"]
    pub unsafe fn amdsmi_get_gpu_fan_speed(
        &self,
        processor_handle: amdsmi_processor_handle,
        sensor_ind: u32,
        speed: *mut i64,
    ) -> amdsmi_status_t {
        (self
            .amdsmi_get_gpu_fan_speed
            .as_ref()
            .expect("Expected function, got error."))(processor_handle, sensor_ind, speed)
    }
    #[doc = "```text\n  @brief Get the temperature metric value for the specified metric, from the\n  specified temperature sensor on the specified device. It is not supported on\n  virtual machine guest\n\n  @platform{gpu_bm_linux} @platform{host}\n\n  @details Given a processor handle @p processor_handle, a sensor type @p sensor_type, a\n  ::amdsmi_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] processor_handle a processor handle\n\n  @param[in] sensor_type part of device from which temperature should be\n  obtained. This should come from the enum ::amdsmi_temperature_type_t\n\n  @param[in] metric enum indicated which temperature value should be\n  retrieved\n\n  @param[in,out] 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  ::AMDSMI_STATUS_INVAL if the function is supported with the provided,\n  arguments and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n  provided arguments.\n\n  @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail\n```"]
    pub unsafe fn amdsmi_get_temp_metric(
        &self,
        processor_handle: amdsmi_processor_handle,
        sensor_type: amdsmi_temperature_type_t,
        metric: amdsmi_temperature_metric_t,
        temperature: *mut i64,
    ) -> amdsmi_status_t {
        (self
            .amdsmi_get_temp_metric
            .as_ref()
            .expect("Expected function, got error."))(
            processor_handle,
            sensor_type,
            metric,
            temperature,
        )
    }
    #[doc = "```text\n  @brief Get the voltage metric value for the specified metric, from the\n  specified voltage sensor on the specified device. It is not supported on\n  virtual machine guest\n\n  @platform{gpu_bm_linux}\n\n  @details Given a processor handle @p processor_handle, a sensor type @p sensor_type, a\n  ::amdsmi_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] processor_handle a processor handle\n\n  @param[in] sensor_type part of device from which voltage should be\n  obtained. This should come from the enum ::amdsmi_voltage_type_t\n\n  @param[in] metric enum indicated which voltage value should be\n  retrieved\n\n  @param[in,out] 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  ::AMDSMI_STATUS_INVAL if the function is supported with the provided,\n  arguments and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the\n  provided arguments.\n\n  @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail\n```"]
    pub unsafe fn amdsmi_get_gpu_volt_metric(
        &self,
        processor_handle: amdsmi_processor_handle,
        sensor_type: amdsmi_voltage_type_t,
        metric: amdsmi_voltage_metric_t,
        voltage: *mut i64,
    ) -> amdsmi_status_t {
        (self
            .amdsmi_get_gpu_volt_metric
            .as_ref()
            .expect("Expected function, got error."))(
            processor_handle,
            sensor_type,
            metric,
            voltage,
        )
    }
    #[doc = "```text\n @brief Get the build version information for the currently running build of\n AMDSMI.\n\n @platform{gpu_bm_linux} @platform{cpu_bm}  @platform{guest_1vf}  @platform{guest_mvf}\n\n @details  Get the major, minor, patch and build string for AMDSMI build\n currently in use through @p version\n\n @param[in,out] version A pointer to an ::amdsmi_version_t structure that will\n be updated with the version information upon return.\n\n  @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail\n```"]
    pub unsafe fn amdsmi_get_lib_version(&self, version: *mut amdsmi_version_t) -> amdsmi_status_t {
        (self
            .amdsmi_get_lib_version
            .as_ref()
            .expect("Expected function, got error."))(version)
    }
    #[doc = "```text\n  @brief Get a description of a provided AMDSMI error status\n\n @platform{gpu_bm_linux}  @platform{host} @platform{cpu_bm}  @platform{guest_1vf}  @platform{guest_mvf}\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[in,out] 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  @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail\n```"]
    pub unsafe fn amdsmi_status_code_to_string(
        &self,
        status: amdsmi_status_t,
        status_string: *mut *const ::std::os::raw::c_char,
    ) -> amdsmi_status_t {
        (self
            .amdsmi_status_code_to_string
            .as_ref()
            .expect("Expected function, got error."))(status, status_string)
    }
    #[doc = "```text\n  @brief          Returns the UUID of the device\n\n  @platform{gpu_bm_linux} @platform{host} @platform{guest_1vf}  @platform{guest_mvf}\n\n  @param[in]      processor_handle Device which to query\n\n  @param[in,out]  uuid_length Length of the uuid string. As input, must be\n                  equal or greater than SMI_GPU_UUID_SIZE and be allocated by\n                  user. As output it is the length of the uuid string.\n\n  @param[out]     uuid Pointer to string to store the UUID. Must be\n                  allocated by user.\n\n  @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail\n```"]
    pub unsafe fn amdsmi_get_gpu_device_uuid(
        &self,
        processor_handle: amdsmi_processor_handle,
        uuid_length: *mut ::std::os::raw::c_uint,
        uuid: *mut ::std::os::raw::c_char,
    ) -> amdsmi_status_t {
        (self
            .amdsmi_get_gpu_device_uuid
            .as_ref()
            .expect("Expected function, got error."))(processor_handle, uuid_length, uuid)
    }
    #[doc = "```text\n  @brief          Returns the ASIC information for the device\n\n  @platform{gpu_bm_linux}  @platform{host} @platform{guest_1vf}  @platform{guest_mvf}\n  @platform{guest_windows}\n\n  @details        This function returns ASIC information such as the product name,\n                  the vendor ID, the subvendor ID, the device ID,\n                  the revision ID and the serial number.\n\n  @param[in]      processor_handle Device which to query\n\n  @param[out]     info Reference to static asic information structure.\n                  Must be allocated by user.\n\n  @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail\n```"]
    pub unsafe fn amdsmi_get_gpu_asic_info(
        &self,
        processor_handle: amdsmi_processor_handle,
        info: *mut amdsmi_asic_info_t,
    ) -> amdsmi_status_t {
        (self
            .amdsmi_get_gpu_asic_info
            .as_ref()
            .expect("Expected function, got error."))(processor_handle, info)
    }
    #[doc = "```text\n  @brief          Returns the current usage of the GPU engines (GFX, MM and MEM).\n                  Each usage is reported as a percentage from 0-100%. It is not\n                  supported on virtual machine guest\n\n  @platform{gpu_bm_linux} @platform{host} @platform{guest_windows}\n\n  @param[in]      processor_handle Device which to query\n\n  @param[out]     info Reference to the gpu engine usage structure. Must be allocated by user.\n\n  @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail\n```"]
    pub unsafe fn amdsmi_get_gpu_activity(
        &self,
        processor_handle: amdsmi_processor_handle,
        info: *mut amdsmi_engine_usage_t,
    ) -> amdsmi_status_t {
        (self
            .amdsmi_get_gpu_activity
            .as_ref()
            .expect("Expected function, got error."))(processor_handle, info)
    }
    #[doc = "```text\n  @brief          Returns the current power and voltage of the GPU.\n                  The voltage is in units of mV and the power in units of W.\n                  It is not supported on virtual machine guest\n\n  @platform{gpu_bm_linux}  @platform{host}\n\n  @param[in]      processor_handle Device which to query\n\n  @param[out]     info Reference to the gpu power structure. Must be allocated by user.\n\n  @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail\n```"]
    pub unsafe fn amdsmi_get_power_info(
        &self,
        processor_handle: amdsmi_processor_handle,
        info: *mut amdsmi_power_info_t,
    ) -> amdsmi_status_t {
        (self
            .amdsmi_get_power_info
            .as_ref()
            .expect("Expected function, got error."))(processor_handle, info)
    }
    #[doc = "```text\n  @brief Returns is power management enabled\n\n  @platform{gpu_bm_linux}  @platform{host}\n\n  @param[in] processor_handle PF of a processor for which to query\n\n  @param[out] enabled Reference to bool. Must be allocated by user.\n\n  @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail\n```"]
    pub unsafe fn amdsmi_is_gpu_power_management_enabled(
        &self,
        processor_handle: amdsmi_processor_handle,
        enabled: *mut bool,
    ) -> amdsmi_status_t {
        (self
            .amdsmi_is_gpu_power_management_enabled
            .as_ref()
            .expect("Expected function, got error."))(processor_handle, enabled)
    }
    #[doc = "```text\n  @brief          Returns the measurements of the clocks in the GPU\n                  for the GFX and multimedia engines and Memory. This call\n                  reports the averages over 1s in MHz. It is not supported\n                  on virtual machine guest\n\n  @platform{gpu_bm_linux}  @platform{host}\n\n  @param[in]      processor_handle Device which to query\n\n  @param[in]      clk_type Enum representing the clock type to query.\n\n  @param[out]     info Reference to the gpu clock structure.\n                  Must be allocated by user.\n\n  @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail\n```"]
    pub unsafe fn amdsmi_get_clock_info(
        &self,
        processor_handle: amdsmi_processor_handle,
        clk_type: amdsmi_clk_type_t,
        info: *mut amdsmi_clk_info_t,
    ) -> amdsmi_status_t {
        (self
            .amdsmi_get_clock_info
            .as_ref()
            .expect("Expected function, got error."))(processor_handle, clk_type, info)
    }
    #[doc = "```text\n  @brief          Returns the list of processes running on a given GPU including itself.\n\n  @platform{gpu_bm_linux}  @platform{guest_1vf}  @platform{guest_mvf} @platform{guest_windows}\n\n  @note           The user provides a buffer to store the list and the maximum\n                  number of processes that can be returned. If the user sets\n                  max_processes to 0, the current total number of processes will\n                  replace max_processes param. After that, the function needs to be\n                  called again, with updated max_processes, to successfully fill the\n                  process list, which was previously allocated with max_processes\n\n  @param[in]      processor_handle Device which to query\n\n  @param[in,out]  max_processes Reference to the size of the list buffer in\n                  number of elements. Returns the return number of elements\n                  in list or the number of running processes if equal to 0,\n                  and if given value in param max_processes is less than\n                  number of processes currently running,\n                  AMDSMI_STATUS_OUT_OF_RESOURCES will be returned.\n\n                  For cases where max_process is not zero (0), it specifies the list's size limit.\n                  That is, the maximum size this list will be able to hold. After the list is built\n                  internally, as a return status, we will have AMDSMI_STATUS_OUT_OF_RESOURCES when\n                  the original size limit is smaller than the actual list of processes running.\n                  Hence, the caller is aware the list size needs to be resized, or\n                  AMDSMI_STATUS_SUCCESS otherwise.\n                  Holding a copy of max_process before it is passed in will be helpful for monitoring\n                  the allocations done upon each call since the max_process will permanently be changed\n                  to reflect the actual number of processes running.\n\n  @param[out]     list Reference to a user-provided buffer where the process\n                  list will be returned. This buffer must contain at least\n                  max_processes entries of type amd_proc_info_list_t. Must be allocated\n                  by user.\n\n  @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success,\n                            | ::AMDSMI_STATUS_OUT_OF_RESOURCES, filled list buffer with data, but number of\n                                actual running processes is larger than the size provided.\n\n```"]
    pub unsafe fn amdsmi_get_gpu_process_list(
        &self,
        processor_handle: amdsmi_processor_handle,
        max_processes: *mut u32,
        list: *mut amdsmi_proc_info_t,
    ) -> amdsmi_status_t {
        (self
            .amdsmi_get_gpu_process_list
            .as_ref()
            .expect("Expected function, got error."))(processor_handle, max_processes, list)
    }
}
