/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
HeterogeneousCore/ROCmUtilities/src/requireDevices.cc
30 строк
677 B
Andrea Bocci
Implement requireDevices() for ROCm devices
30 янв 2023, 19:31
Не верифицирован
30 янв 2023, 19:31
7b3f444
Код
Авторство
О чём код?
#include <cstdlib> #include <iostream> #include <hip/hip_runtime.h> #include "HeterogeneousCore/ROCmUtilities/interface/requireDevices.h" namespace cms::rocmtest { bool testDevices() { int devices = 0; auto status = hipGetDeviceCount(&devices); if (status != hipSuccess) { std::cerr << "Failed to initialise the ROCm runtime, the test will be skipped.\n"; return false; } if (devices == 0) { std::cerr << "No ROCm devices available, the test will be skipped.\n"; return false; } return true; } void requireDevices() { if (not testDevices()) { exit(EXIT_SUCCESS); } } } // namespace cms::rocmtest