blob: 0ecbe7e76a010357419c0f8cd7d20f8605f5db37 [file] [log] [blame]
Slava Shklyaev73ee79d2019-05-14 14:15:14 +01001/*
2 * Copyright (C) 2019 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_HARDWARE_NEURALNETWORKS_V1_2_GENERATED_TEST_HARNESS_H
18#define ANDROID_HARDWARE_NEURALNETWORKS_V1_2_GENERATED_TEST_HARNESS_H
19
20#include <android/hardware/neuralnetworks/1.2/IDevice.h>
21#include <android/hardware/neuralnetworks/1.2/IPreparedModel.h>
22#include <android/hardware/neuralnetworks/1.2/types.h>
23#include <functional>
24#include <vector>
25#include "TestHarness.h"
26
27namespace android {
28namespace hardware {
29namespace neuralnetworks {
Slava Shklyaeve8b24462019-07-17 15:50:57 +010030namespace V1_2 {
Slava Shklyaev73ee79d2019-05-14 14:15:14 +010031namespace generated_tests {
32
33using ::test_helper::MixedTypedExample;
34
35void PrepareModel(const sp<V1_2::IDevice>& device, const V1_2::Model& model,
36 sp<V1_2::IPreparedModel>* preparedModel);
37
38void EvaluatePreparedModel(sp<V1_2::IPreparedModel>& preparedModel,
39 std::function<bool(int)> is_ignored,
40 const std::vector<MixedTypedExample>& examples,
41 bool hasRelaxedFloat32Model, bool testDynamicOutputShape);
42
43void Execute(const sp<V1_2::IDevice>& device, std::function<V1_2::Model(void)> create_model,
44 std::function<bool(int)> is_ignored, const std::vector<MixedTypedExample>& examples,
45 bool testDynamicOutputShape = false);
46
47} // namespace generated_tests
Slava Shklyaeve8b24462019-07-17 15:50:57 +010048} // namespace V1_2
Slava Shklyaev73ee79d2019-05-14 14:15:14 +010049} // namespace neuralnetworks
50} // namespace hardware
51} // namespace android
52
53#endif // ANDROID_HARDWARE_NEURALNETWORKS_V1_2_GENERATED_TEST_HARNESS_H