Added utility functions to automatically select the fastest Device or the Device with largest memory capacity from all available Devices.
For selecting the fastest Device, the TFLOPs/s performance of the Device is estimated. For Nvidia and AMD GPUs, the estimate is challenging due to the different number of cores per CU depending on the microarchitecture and even GPU model:
AMD GCN, CDNA: 64 cores/CU
AMD RDNA, RDNA2: 128 cores/CU (dual CUs are reported as CUs in OpenCL)
The vast majority of GPUs are captured with the correct estimate, but for some rare/old GPUs, the estimate could be wrong by a factor of 2.
For CPUs without SMT/HT as well as for very old CPUs with IPC<32 or very new CPUs with IPC=64 (AVX-512), the estimate is wrong.
Overall however, the estimated values are good enough to identify the fastest device in systems with one CPU and one or multiple GPUs.
Added utility functions to automatically select the fastest Device or the Device with largest memory capacity from all available Devices.
For selecting the fastest Device, the TFLOPs/s performance of the Device is estimated. For Nvidia and AMD GPUs, the estimate is challenging due to the different number of cores per CU depending on the microarchitecture and even GPU model:
The vast majority of GPUs are captured with the correct estimate, but for some rare/old GPUs, the estimate could be wrong by a factor of 2. For CPUs without SMT/HT as well as for very old CPUs with IPC<32 or very new CPUs with IPC=64 (AVX-512), the estimate is wrong.
Overall however, the estimated values are good enough to identify the fastest device in systems with one CPU and one or multiple GPUs.