diff --git a/docs/how-to/hip_runtime_api/initialization.rst b/docs/how-to/hip_runtime_api/initialization.rst index 5bdebb1587..55f26652dd 100644 --- a/docs/how-to/hip_runtime_api/initialization.rst +++ b/docs/how-to/hip_runtime_api/initialization.rst @@ -37,13 +37,18 @@ Querying and setting GPUs If multiple GPUs are available, it's worth to query and select the desired GPU(s) based on properties. -Querying GPU devices +Querying GPUs -------------------------------------------------------------------------------- The properties of a gpu can be queried using :cpp:func:`hipGetDeviceProperties`, which returns a struct of :cpp:struct:`hipDeviceProp_t`. This struct can be used to identify a device or give an overview of hardware characteristics, that -might make one gpu better suited for the task at hand than others. +might make one gpu better suited for the task at hand than others. + +The :cpp:func:`hipGetDeviceCount` function returns the number of available GPUs, +which can be used to loop over the available GPUs. + +Example code of querying GPUs: .. code-block:: cpp