# AMD SMI Bindings Generator

## Regenerating the Bindings

1. Get all the versions of AMD SMI that you want to support. Download each header in a directory, let's say `/tmp/all-amdsmi-versions-to-support`.

2. Run `ch-hist` to analyse the history of the AMD SMI library.

```sh
ch-hist -i /tmp/all-amdsmi-versions-to-support -o /tmp/ch-hist-report --whitelist ./input/whitelist.txt
```

A report will be produced.
Only the symbols declared in the [whitelist](./input/whitelist.txt) are included in the report.

3. Run the bindings generator on the report generated by `ch-hist`.

```sh
cargo run -p bindings-generator -- history -i '/tmp/ch-hist-report/report-summary.json'
```

The generator will update the content of `amd-smi-wrapper-sys/src/versions`.

## More information

```sh
cargo run -p bindings-generator -- --help
```
