1 /*
2  * Copyright (C) 2017 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef ANDROID_PACKAGES_MODULES_NEURALNETWORKS_COMMON_HAL_INTERFACES_H
18 #define ANDROID_PACKAGES_MODULES_NEURALNETWORKS_COMMON_HAL_INTERFACES_H
19 
20 #include <android/hardware/neuralnetworks/1.0/IDevice.h>
21 #include <android/hardware/neuralnetworks/1.0/IExecutionCallback.h>
22 #include <android/hardware/neuralnetworks/1.0/IPreparedModel.h>
23 #include <android/hardware/neuralnetworks/1.0/IPreparedModelCallback.h>
24 #include <android/hardware/neuralnetworks/1.0/types.h>
25 #include <android/hardware/neuralnetworks/1.1/IDevice.h>
26 #include <android/hardware/neuralnetworks/1.1/types.h>
27 #include <android/hardware/neuralnetworks/1.2/IDevice.h>
28 #include <android/hardware/neuralnetworks/1.2/IExecutionCallback.h>
29 #include <android/hardware/neuralnetworks/1.2/IPreparedModel.h>
30 #include <android/hardware/neuralnetworks/1.2/IPreparedModelCallback.h>
31 #include <android/hardware/neuralnetworks/1.2/types.h>
32 #include <android/hardware/neuralnetworks/1.3/IDevice.h>
33 #include <android/hardware/neuralnetworks/1.3/IExecutionCallback.h>
34 #include <android/hardware/neuralnetworks/1.3/IFencedExecutionCallback.h>
35 #include <android/hardware/neuralnetworks/1.3/IPreparedModel.h>
36 #include <android/hardware/neuralnetworks/1.3/IPreparedModelCallback.h>
37 #include <android/hardware/neuralnetworks/1.3/types.h>
38 #include <android/hidl/memory/1.0/IMemory.h>
39 #include <hidlmemory/mapping.h>
40 
41 #include <functional>
42 
43 namespace android::nn {
44 
45 namespace V1_0 = ::android::hardware::neuralnetworks::V1_0;
46 namespace V1_1 = ::android::hardware::neuralnetworks::V1_1;
47 namespace V1_2 = ::android::hardware::neuralnetworks::V1_2;
48 namespace V1_3 = ::android::hardware::neuralnetworks::V1_3;
49 
50 using HalCacheToken =
51         hardware::hidl_array<uint8_t,
52                              static_cast<uint32_t>(V1_2::Constant::BYTE_SIZE_OF_CACHE_TOKEN)>;
53 using HalDeviceFactory = std::function<sp<V1_0::IDevice>(bool blocking)>;
54 
55 inline constexpr V1_3::Priority kDefaultPriority13 = V1_3::Priority::MEDIUM;
56 
57 }  // namespace android::nn
58 
59 #endif  // ANDROID_PACKAGES_MODULES_NEURALNETWORKS_COMMON_HAL_INTERFACES_H
60