| 12 | #endif |
| 13 | |
| 14 | int main(int argc, char** argv) { |
| 15 | ::testing::InitGoogleTest(&argc, argv); |
| 16 | caffe::GlobalInit(&argc, &argv); |
| 17 | #ifndef CPU_ONLY |
| 18 | // Before starting testing, let's first print out a few cuda defice info. |
| 19 | int device; |
| 20 | cudaGetDeviceCount(&device); |
| 21 | cout << "Cuda number of devices: " << device << endl; |
| 22 | if (argc > 1) { |
| 23 | // Use the given device |
| 24 | device = atoi(argv[1]); |
| 25 | cudaSetDevice(device); |
| 26 | cout << "Setting to use device " << device << endl; |
| 27 | } else if (CUDA_TEST_DEVICE >= 0) { |
| 28 | // Use the device assigned in build configuration; but with a lower priority |
| 29 | device = CUDA_TEST_DEVICE; |
| 30 | } |
| 31 | cudaGetDevice(&device); |
| 32 | cout << "Current device id: " << device << endl; |
| 33 | cudaGetDeviceProperties(&CAFFE_TEST_CUDA_PROP, device); |
| 34 | cout << "Current device name: " << CAFFE_TEST_CUDA_PROP.name << endl; |
| 35 | #endif |
| 36 | // invoke the test. |
| 37 | return RUN_ALL_TESTS(); |
| 38 | } |
nothing calls this directly
no test coverage detected