blob: 4ab59c85d9a8b76bc4e56d9834cd10ab3a4143b8 [file] [log] [blame]
telsoa015307bc12018-03-09 13:51:08 +00001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
3// See LICENSE file in the project root for full license information.
4//
5
6#define LOG_TAG "ArmnnDriver"
7
8#include "ArmnnDriver.hpp"
9
10#include <hidl/LegacySupport.h>
11#include <log/log.h>
12
13#include <string>
14#include <vector>
15
16using namespace armnn_driver;
17using namespace std;
18
19int main(int argc, char** argv)
20{
surmeh0149b9e102018-05-17 14:11:25 +010021 android::sp<ArmnnDriver> driver;
22 try
23 {
24 driver = new ArmnnDriver(DriverOptions(argc, argv));
25 }
26 catch (const std::exception& e)
27 {
28 ALOGE("Could not create driver: %s", e.what());
29 return EXIT_FAILURE;
30 }
telsoa015307bc12018-03-09 13:51:08 +000031
32 android::hardware::configureRpcThreadpool(1, true);
surmeh0149b9e102018-05-17 14:11:25 +010033 android::status_t status = android::UNKNOWN_ERROR;
34 try
35 {
36 status = driver->registerAsService("armnn");
37 }
38 catch (const std::exception& e)
39 {
40 ALOGE("Could not register service: %s", e.what());
41 return EXIT_FAILURE;
42 }
43 if (status != android::OK)
telsoa015307bc12018-03-09 13:51:08 +000044 {
45 ALOGE("Could not register service");
surmeh0149b9e102018-05-17 14:11:25 +010046 return EXIT_FAILURE;
telsoa015307bc12018-03-09 13:51:08 +000047 }
surmeh0149b9e102018-05-17 14:11:25 +010048
telsoa015307bc12018-03-09 13:51:08 +000049 android::hardware::joinRpcThreadpool();
50 ALOGE("Service exited!");
surmeh0149b9e102018-05-17 14:11:25 +010051 return EXIT_FAILURE;
telsoa015307bc12018-03-09 13:51:08 +000052}