diff options
author | Jun Shi <junshi@yahoo-inc.com> | 2016-01-22 09:50:31 -0800 |
---|---|---|
committer | Jun Shi <junshi@yahoo-inc.com> | 2016-03-04 22:50:29 -0800 |
commit | b9ea0267851ccc7f782327408fe7953ba0f13c53 (patch) | |
tree | b39d5d3b7b4b27619ae676507af04a16d7d334c9 /include/caffe | |
parent | 6a0b98768d4745714e31949b87382ff562be6724 (diff) | |
download | caffeonacl-b9ea0267851ccc7f782327408fe7953ba0f13c53.tar.gz caffeonacl-b9ea0267851ccc7f782327408fe7953ba0f13c53.tar.bz2 caffeonacl-b9ea0267851ccc7f782327408fe7953ba0f13c53.zip |
add check and find GPU device utilities
Diffstat (limited to 'include/caffe')
-rw-r--r-- | include/caffe/common.hpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/caffe/common.hpp b/include/caffe/common.hpp index 6b902a42..3c6a076e 100644 --- a/include/caffe/common.hpp +++ b/include/caffe/common.hpp @@ -153,6 +153,11 @@ class Caffe { static void SetDevice(const int device_id); // Prints the current GPU status. static void DeviceQuery(); + // Check if specified device is available + static bool CheckDevice(const int device_id); + // Search from start_id to the highest possible device ordinal, + // return the ordinal of the first available device. + static int FindDevice(const int start_id = 0); // Parallel training info inline static int solver_count() { return Get().solver_count_; } inline static void set_solver_count(int val) { Get().solver_count_ = val; } |