blob: 30e5578b666db5707e70ba141971a24cf44ddc0f [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 {
30namespace generated_tests {
31
32using ::test_helper::MixedTypedExample;
33
34void PrepareModel(const sp<V1_2::IDevice>& device, const V1_2::Model& model,
35 sp<V1_2::IPreparedModel>* preparedModel);
36
37void EvaluatePreparedModel(sp<V1_2::IPreparedModel>& preparedModel,
38 std::function<bool(int)> is_ignored,
39 const std::vector<MixedTypedExample>& examples,
40 bool hasRelaxedFloat32Model, bool testDynamicOutputShape);
41
42void Execute(const sp<V1_2::IDevice>& device, std::function<V1_2::Model(void)> create_model,
43 std::function<bool(int)> is_ignored, const std::vector<MixedTypedExample>& examples,
44 bool testDynamicOutputShape = false);
45
46} // namespace generated_tests
47} // namespace neuralnetworks
48} // namespace hardware
49} // namespace android
50
51#endif // ANDROID_HARDWARE_NEURALNETWORKS_V1_2_GENERATED_TEST_HARNESS_H