rocm_smi_lib
rocm_smi_lib copied to clipboard
Example in README.md should use uint16_t dev_id
In the README.md's Hello ROCm SMI example, it should change "uint64_t dev_id;" to "uint16_t dev_id;", otherwise we would see an error like this:
~/rocm_smi_lib$ hipcc -L /opt/rocm/rocm_smi/lib -lrocm_smi64 -I /opt/rocm/rocm_smi/include hello.c -o helloclang-10: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
hello.c:16:11: error: no matching function for call to 'rsmi_dev_id_get'
ret = rsmi_dev_id_get(i, &dev_id);
^~~~~~~~~~~~~~~
/opt/rocm/rocm_smi/include/rocm_smi/rocm_smi.h:819:15: note: candidate function not viable: no known conversion from 'uint64_t *' (aka 'unsigned long *') to 'uint16_t *' (aka 'unsigned short *') for 2nd argument
rsmi_status_t rsmi_dev_id_get(uint32_t dv_ind, uint16_t *id);
^
1 error generated.
hello.c:16:11: error: no matching function for call to 'rsmi_dev_id_get'
ret = rsmi_dev_id_get(i, &dev_id);
^~~~~~~~~~~~~~~
/opt/rocm/rocm_smi/include/rocm_smi/rocm_smi.h:819:15: note: candidate function not viable: no known conversion from 'uint64_t *' (aka 'unsigned long *') to 'uint16_t *' (aka 'unsigned short *') for 2nd argument
rsmi_status_t rsmi_dev_id_get(uint32_t dv_ind, uint16_t *id);
^
1 error generated.