Fan#

oneAPI Level Zero Specification - Version 1.18.31

Fan Functions#

zesFanGetProperties#

Added in version 1.0

ZE_APIEXPORT ze_result_t ZE_APICALL zesFanGetProperties(zes_fan_handle_t hFan, zes_fan_properties_t *pProperties)#

Get fan properties.

  • The application may call this function from simultaneous threads.

  • The implementation of this function should be lock-free.

Parameters:
  • hFan – [in] Handle for the component.

  • pProperties – [in,out] Will contain the properties of the fan.

Returns:

zesFanGetConfig#

Added in version 1.0

ZE_APIEXPORT ze_result_t ZE_APICALL zesFanGetConfig(zes_fan_handle_t hFan, zes_fan_config_t *pConfig)#

Get fan configurations and the current fan speed mode (default, fixed, temp-speed table)

  • The application may call this function from simultaneous threads.

  • The implementation of this function should be lock-free.

Parameters:
  • hFan – [in] Handle for the component.

  • pConfig – [in,out] Will contain the current configuration of the fan.

Returns:

zesFanSetDefaultMode#

Added in version 1.0

ZE_APIEXPORT ze_result_t ZE_APICALL zesFanSetDefaultMode(zes_fan_handle_t hFan)#

Configure the fan to run with hardware factory settings (set mode to ZES_FAN_SPEED_MODE_DEFAULT)

  • The application may call this function from simultaneous threads.

  • The implementation of this function should be lock-free.

Parameters:

hFan – [in] Handle for the component.

Returns:

zesFanSetFixedSpeedMode#

Added in version 1.0

ZE_APIEXPORT ze_result_t ZE_APICALL zesFanSetFixedSpeedMode(zes_fan_handle_t hFan, const zes_fan_speed_t *speed)#

Configure the fan to rotate at a fixed speed (set mode to ZES_FAN_SPEED_MODE_FIXED)

  • The application may call this function from simultaneous threads.

  • The implementation of this function should be lock-free.

Parameters:
  • hFan – [in] Handle for the component.

  • speed – [in] The fixed fan speed setting

Returns:

zesFanSetSpeedTableMode#

Added in version 1.0

ZE_APIEXPORT ze_result_t ZE_APICALL zesFanSetSpeedTableMode(zes_fan_handle_t hFan, const zes_fan_speed_table_t *speedTable)#

Configure the fan to adjust speed based on a temperature/speed table (set mode to ZES_FAN_SPEED_MODE_TABLE)

  • The application may call this function from simultaneous threads.

  • The implementation of this function should be lock-free.

Parameters:
  • hFan – [in] Handle for the component.

  • speedTable – [in] A table containing temperature/speed pairs.

Returns:

zesFanGetState#

Added in version 1.0

ZE_APIEXPORT ze_result_t ZE_APICALL zesFanGetState(zes_fan_handle_t hFan, zes_fan_speed_units_t units, int32_t *pSpeed)#

Get current state of a fan - current mode and speed.

  • The application may call this function from simultaneous threads.

  • The implementation of this function should be lock-free.

Parameters:
  • hFan – [in] Handle for the component.

  • units – [in] The units in which the fan speed should be returned.

  • pSpeed – [in,out] Will contain the current speed of the fan in the units requested. A value of -1 indicates that the fan speed cannot be measured.

Returns:

Fan Enums#

zes_fan_speed_mode_t#

Added in version 1.0

enum zes_fan_speed_mode_t#

Fan resource speed mode.

Values:

enumerator ZES_FAN_SPEED_MODE_DEFAULT#

The fan speed is operating using the hardware default settings.

enumerator ZES_FAN_SPEED_MODE_FIXED#

The fan speed is currently set to a fixed value.

enumerator ZES_FAN_SPEED_MODE_TABLE#

The fan speed is currently controlled dynamically by hardware based on a temp/speed table

enumerator ZES_FAN_SPEED_MODE_FORCE_UINT32#

Value marking end of ZES_FAN_SPEED_MODE_* ENUMs.

zes_fan_speed_units_t#

Added in version 1.0

enum zes_fan_speed_units_t#

Fan speed units.

Values:

enumerator ZES_FAN_SPEED_UNITS_RPM#

The fan speed is in units of revolutions per minute (rpm)

enumerator ZES_FAN_SPEED_UNITS_PERCENT#

The fan speed is a percentage of the maximum speed of the fan.

enumerator ZES_FAN_SPEED_UNITS_FORCE_UINT32#

Value marking end of ZES_FAN_SPEED_UNITS_* ENUMs.

Fan Structures#

zes_fan_speed_t#

Added in version 1.0

struct zes_fan_speed_t#

Fan speed.

Public Members

int32_t speed#

[in,out] The speed of the fan. On output, a value of -1 indicates that there is no fixed fan speed setting.

zes_fan_speed_units_t units#

[in,out] The units that the fan speed is expressed in. On output, if fan speed is -1 then units should be ignored.

zes_fan_temp_speed_t#

Added in version 1.0

struct zes_fan_temp_speed_t#

Fan temperature/speed pair.

Public Members

uint32_t temperature#

[in,out] Temperature in degrees Celsius.

zes_fan_speed_t speed#

[in,out] The speed of the fan

zes_fan_speed_table_t#

Added in version 1.0

struct zes_fan_speed_table_t#

Fan speed table.

Public Members

int32_t numPoints#

[in,out] The number of valid points in the fan speed table. 0 means that there is no fan speed table configured. -1 means that a fan speed table is not supported by the hardware.

zes_fan_temp_speed_t table[ZES_FAN_TEMP_SPEED_PAIR_COUNT]#

[in,out] Array of temperature/fan speed pairs. The table is ordered based on temperature from lowest to highest.

zes_fan_properties_t#

Added in version 1.0

struct zes_fan_properties_t#

Fan properties.

Public Members

zes_structure_type_t stype#

[in] type of this structure

void *pNext#

[in,out][optional] must be null or a pointer to an extension-specific structure (i.e. contains stype and pNext).

ze_bool_t onSubdevice#

[out] True if the resource is located on a sub-device; false means that the resource is on the device of the calling Sysman handle

uint32_t subdeviceId#

[out] If onSubdevice is true, this gives the ID of the sub-device

ze_bool_t canControl#

[out] Indicates if software can control the fan speed assuming the user has permissions

uint32_t supportedModes#

[out] Bitfield of supported fan configuration modes (1<<zes_fan_speed_mode_t)

uint32_t supportedUnits#

[out] Bitfield of supported fan speed units (1<<zes_fan_speed_units_t)

int32_t maxRPM#

[out] The maximum RPM of the fan. A value of -1 means that this property is unknown.

int32_t maxPoints#

[out] The maximum number of points in the fan temp/speed table. A value of -1 means that this fan doesn’t support providing a temp/speed table.

zes_fan_config_t#

Added in version 1.0

struct zes_fan_config_t#

Fan configuration.

Public Members

zes_structure_type_t stype#

[in] type of this structure

const void *pNext#

[in][optional] must be null or a pointer to an extension-specific structure (i.e. contains stype and pNext).

zes_fan_speed_mode_t mode#

[in,out] The fan speed mode (fixed, temp-speed table)

zes_fan_speed_t speedFixed#

[in,out] The current fixed fan speed setting

zes_fan_speed_table_t speedTable#

[out] A table containing temperature/speed pairs