| 75 | } |
| 76 | |
| 77 | TfLiteDelegatePtrMap GetDelegates(Settings* s) { |
| 78 | TfLiteDelegatePtrMap delegates; |
| 79 | if (s->gl_backend) { |
| 80 | auto delegate = CreateGPUDelegate(s); |
| 81 | if (!delegate) { |
| 82 | LOG(INFO) << "GPU acceleration is unsupported on this platform."; |
| 83 | } else { |
| 84 | delegates.emplace("GPU", std::move(delegate)); |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | if (s->accel) { |
| 89 | auto delegate = evaluation::CreateNNAPIDelegate(); |
| 90 | if (!delegate) { |
| 91 | LOG(INFO) << "NNAPI acceleration is unsupported on this platform."; |
| 92 | } else { |
| 93 | delegates.emplace("NNAPI", evaluation::CreateNNAPIDelegate()); |
| 94 | } |
| 95 | } |
| 96 | return delegates; |
| 97 | } |
| 98 | |
| 99 | // Takes a file name, and loads a list of labels from it, one per line, and |
| 100 | // returns a vector of the strings. It pads with empty strings so the length |
no test coverage detected