blob: 36e1d7b3e483ea04280a9d61ee45a53605780a90 [file] [log] [blame]
Georgios Pinitas41df4282023-05-30 12:20:31 +01001// Copyright (c) 2023, ARM Limited.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//===----------------------------------------------------------------------===//
15//
16// Verification functionality as per TOSA Specification
17// Output Verification : Section 1.8.2
18//
19//===----------------------------------------------------------------------===//
Jeremy Johnsonb20b0c92023-10-04 14:17:55 +010020#ifndef VERIFY_H
21#define VERIFY_H
Georgios Pinitas41df4282023-05-30 12:20:31 +010022
Georgios Pinitas7021ef02023-08-22 08:25:57 +010023#include "types.h"
Georgios Pinitas41df4282023-05-30 12:20:31 +010024
25#ifdef __cplusplus
Jerry Ge9c9c8da2023-07-19 23:08:16 +000026extern "C"
27{
Georgios Pinitas41df4282023-05-30 12:20:31 +010028#endif /* __cplusplus */
29
Georgios Pinitas7021ef02023-08-22 08:25:57 +010030 /// \brief Perform compliance validation between a reference and a target output
Jerry Ge9c9c8da2023-07-19 23:08:16 +000031 ///
Georgios Pinitas7021ef02023-08-22 08:25:57 +010032 /// A compliance configuration is expected as it provides information about
33 /// the type of validation to be performed alongside with all the relevant
34 /// meta-data. Configuration is provided in JSON format.
Jerry Ge9c9c8da2023-07-19 23:08:16 +000035 ///
Georgios Pinitas7021ef02023-08-22 08:25:57 +010036 /// \param ref Reference tensor to compare against
37 /// \param ref_bnd (Optional) Reference tensor when run on absolute inputs
38 /// \param imp Implementation resulting tensor
39 /// \param config_json Compliance configuration that indicates how and what compliance need to be performed
Jerry Ge9c9c8da2023-07-19 23:08:16 +000040 ///
Georgios Pinitas7021ef02023-08-22 08:25:57 +010041 /// \return True in case of successful validation else false
42 bool tvf_verify_data(const tosa_tensor_t* ref,
43 const tosa_tensor_t* ref_bnd,
44 const tosa_tensor_t* imp,
45 const char* config_json);
Georgios Pinitas41df4282023-05-30 12:20:31 +010046
47#ifdef __cplusplus
48}
Jeremy Johnsonb20b0c92023-10-04 14:17:55 +010049#endif /* __cplusplus */
50
51#endif // VERIFY_H