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