cudaGetDevice(&device);
cout << "Current device id: " << device << endl;
cudaGetDeviceProperties(&CAFFE_TEST_CUDA_PROP, device);
+ cout << "Current device name: " << CAFFE_TEST_CUDA_PROP.name << endl;
#endif
// invoke the test.
return RUN_ALL_TESTS();
s << (i ? ", " : "") << gpus[i];
}
LOG(INFO) << "Using GPUs " << s.str();
-
+#ifndef CPU_ONLY
+ cudaDeviceProp device_prop;
+ for (int i = 0; i < gpus.size(); ++i) {
+ cudaGetDeviceProperties(&device_prop, gpus[i]);
+ LOG(INFO) << "GPU " << gpus[i] << ": " << device_prop.name;
+ }
+#endif
solver_param.set_device_id(gpus[0]);
Caffe::SetDevice(gpus[0]);
Caffe::set_mode(Caffe::GPU);
get_gpus(&gpus);
if (gpus.size() != 0) {
LOG(INFO) << "Use GPU with device ID " << gpus[0];
+#ifndef CPU_ONLY
+ cudaDeviceProp device_prop;
+ cudaGetDeviceProperties(&device_prop, gpus[0]);
+ LOG(INFO) << "GPU device name: " << device_prop.name;
+#endif
Caffe::SetDevice(gpus[0]);
Caffe::set_mode(Caffe::GPU);
} else {