blob: 803b76ae1397cdeda7f355343ec540762b8861ca [file] [log] [blame]
Grant Watson64285a12022-11-16 15:32:39 +00001
2// Copyright (c) 2022, ARM Limited.
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// THIS FILE IS GENERATED. DO NOT EDIT!
17// See scripts/operator_api/generate_api.py
18
19#ifndef OPERATORS_H_
20#define OPERATORS_H_
21
22#include <stddef.h>
23#include <stdint.h>
24
25#ifdef __cplusplus
26extern "C" {
27#endif /* __cplusplus */
28
29 // Note status needs to be aligned with graph_status
30 enum tosa_status_t
31 {
32 tosa_status_valid = 0,
33 tosa_status_unpredictable = 1,
34 tosa_status_error = 2
35 };
36
37 enum tosa_mode_t
38 {
39 tosa_mode_unknown = 0,
40 tosa_mode_nearest = 1,
41 tosa_mode_bilinear = 2,
42 tosa_mode_min = 3,
43 tosa_mode_max = 4
44 };
45
46 enum tosa_datatype_t
47 {
48 {% for dataType in dataTypes: -%}
49 {{dataType}} = {{loop.index-1}},
50 {% endfor -%}
51 };
52
53 struct tosa_tensor_t
54 {
55 int32_t* shape;
56 int32_t num_dims;
57 tosa_datatype_t data_type;
58 uint8_t* data;
59 size_t size;
60 };
61
62 {% for operator in operators: %}
63 tosa_status_t tosa_run_{{ operator.name }} (
64 {%- for arg in operator.arguments: -%}
65 {% if arg.type != "tosa_tensor_t" -%}const {% endif -%}{{arg.type}} client_{{arg.name}}{{arg.shape}}
66 {% if loop.index < operator.arguments|length %},{% endif %}
67 {%- endfor -%});
68 {% endfor %}
69
70#ifdef __cplusplus
71}
72#endif /* __cplusplus */
73
74#endif // OPERATORS_H_