| 72 | } |
| 73 | |
| 74 | static BrewFunction GetBrewFunction(const caffe::string& name) { |
| 75 | if (g_brew_map.count(name)) { |
| 76 | return g_brew_map[name]; |
| 77 | } else { |
| 78 | LOG(ERROR) << "Available caffe actions:"; |
| 79 | for (BrewMap::iterator it = g_brew_map.begin(); |
| 80 | it != g_brew_map.end(); ++it) { |
| 81 | LOG(ERROR) << "\t" << it->first; |
| 82 | } |
| 83 | LOG(FATAL) << "Unknown action: " << name; |
| 84 | return NULL; // not reachable, just to suppress old compiler warnings. |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | // Parse GPU ids or use all available devices |
| 89 | static void get_gpus(vector<int>* gpus) { |