oneapi-src / level-zero

oneAPI Level Zero Specification Headers and Loader
https://spec.oneapi.com/versions/latest/elements/l0/source/index.html
MIT License
208 stars 90 forks source link

Fix Fan configuration structure #44

Closed aquaxp closed 3 years ago

aquaxp commented 3 years ago

From logic point of view and documentation comment 'speedTable' field should have 'zes_fan_speed_table_t' type instead 'zes_fan_temp_speed_t'. This field should contain a speed's table that was configured instead a single entry from speed's table.

aquaxp commented 3 years ago

Well, spec is wrong then (and it's anyway generated from the headers). In current form of spec speedTable field is represent "A table containing temperature/speed pairs", but that's obviously not true because used type - zes_fan_temp_speed_t is represent only single temperature/speed pair, it's not an array. To match spec speedTable should be at least a literally array - which means that it still need to change it's type from zes_fan_temp_speed_t to zes_fan_temp_speed_t[]. A proper a data structure that will contain not only array of temperature/speed, but also information how many of them are defined is zes_fan_speed_table_t.

zesFanGetConfig is intended to return fan configuration and in case if fan is configured for work with table - speedTable should contain array of temperature/speed pairs, not a single one.

marcbeuchat commented 3 years ago

This is a bug. Thanks for bringing it to our attention. We will fix this in the next release of the spec.

bmyates commented 3 years ago

@aquaxp The header files in this repo are generated from the spec. Once the next release of the spec is published I'll regenerate these headers to pick up this bug fix.

aquaxp commented 3 years ago

@bmyates Should I close this pull-request then and create an issue?

bmyates commented 3 years ago

Yes please, thanks!