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

Method CheckDevice

src/core/device/platform.cc:38–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38bool Platform::CheckDevice(const int device_id) {
39 bool r = ((cudaSuccess == cudaSetDevice(device_id)) &&
40 (cudaSuccess == cudaFree(0)));
41 // reset any error that may have occurred.
42 cudaGetLastError();
43 return r;
44}
45
46/// Return the total num of free GPUs
47const vector<int> Platform::GetGPUIDs() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected