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

Method GetGPUIDs

src/core/device/platform.cc:47–56  ·  view source on GitHub ↗

Return the total num of free GPUs

Source from the content-addressed store, hash-verified

45
46/// Return the total num of free GPUs
47const vector<int> Platform::GetGPUIDs() {
48 vector<int> gpus;
49 int count = Platform::GetNumGPUs();
50 for (int i = 0; i < count; i++) {
51 if (Platform::CheckDevice(i)) {
52 gpus.push_back(i);
53 }
54 }
55 return gpus;
56}
57
58const std::pair<size_t, size_t> Platform::GetGPUMemSize(const int device) {
59 std::pair<size_t, size_t> ret{0, 0};

Callers 1

get_gpu_idsFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected