MCPcopy Create free account
hub / github.com/apache/singa / GetNumGPUs

Method GetNumGPUs

src/core/device/platform.cc:32–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30std::vector<std::shared_ptr<Device>> Platform::UsedDevice;
31std::mutex Platform::mtx_;
32int Platform::GetNumGPUs() {
33 int count;
34 CUDA_CHECK(cudaGetDeviceCount(&count));
35 return count;
36}
37
38bool Platform::CheckDevice(const int device_id) {
39 bool r = ((cudaSuccess == cudaSetDevice(device_id)) &&

Callers 1

get_num_gpusFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected