File indexing completed on 2024-04-06 12:15:46
0001
0002 #include <cstdlib>
0003
0004
0005 #include <hip/hip_runtime.h>
0006
0007
0008 #include "HeterogeneousCore/Common/interface/PlatformStatus.h"
0009
0010
0011 #include "isRocmDeviceSupported.h"
0012
0013
0014
0015 int main() {
0016 int devices = 0;
0017 auto status = hipGetDeviceCount(&devices);
0018 if (status != hipSuccess) {
0019
0020 return PlatformStatus::RuntimeNotAvailable;
0021 }
0022
0023
0024 for (int i = 0; i < devices; ++i) {
0025 if (isRocmDeviceSupported(i))
0026 return PlatformStatus::Success;
0027 }
0028
0029
0030 return PlatformStatus::DevicesNotAvailable;
0031 }