projects
/
platform
/
upstream
/
caffeonacl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4df0de2
)
default test net device to 0 and log device chosen
author
Evan Shelhamer
<shelhamer@imaginarynumber.net>
Sat, 26 Apr 2014 23:08:22 +0000
(16:08 -0700)
committer
Evan Shelhamer
<shelhamer@imaginarynumber.net>
Sat, 26 Apr 2014 23:08:22 +0000
(16:08 -0700)
tools/test_net.cpp
patch
|
blob
|
history
diff --git
a/tools/test_net.cpp
b/tools/test_net.cpp
index
44a3d6c
..
4b7fe8e
100644
(file)
--- a/
tools/test_net.cpp
+++ b/
tools/test_net.cpp
@@
-26,12
+26,13
@@
int main(int argc, char** argv) {
Caffe::set_phase(Caffe::TEST);
if (argc >= 5 && strcmp(argv[4], "GPU") == 0) {
- LOG(ERROR) << "Using GPU";
Caffe::set_mode(Caffe::GPU);
+ int device_id = 0;
if (argc == 6) {
- int device_id = atoi(argv[5]);
- Caffe::SetDevice(device_id);
+ device_id = atoi(argv[5]);
}
+ Caffe::SetDevice(device_id);
+ LOG(ERROR) << "Using GPU #" << device_id;
} else {
LOG(ERROR) << "Using CPU";
Caffe::set_mode(Caffe::CPU);