blob: c1f8ef697d7a84aa5610d212938f12dca4e730ef [file] [log] [blame]
Eric Kunzee5e26762020-10-13 16:11:07 -07001
Jerry Gea793f462023-04-11 00:05:02 +00002// Copyright (c) 2020-2023, ARM Limited.
Eric Kunzee5e26762020-10-13 16:11:07 -07003//
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#ifndef FUNC_CONFIG_H_
17#define FUNC_CONFIG_H_
18
Matthew Sloyanba5fad32022-09-26 13:31:43 +010019#include <iostream>
20#include <stdio.h>
21
Jerry Gea793f462023-04-11 00:05:02 +000022struct tosa_level_t {
23 int32_t MAX_RANK = 0;
24 int32_t MAX_KERNEL = 0;
25 int32_t MAX_STRIDE = 0;
26 int32_t MAX_SCALE = 0;
27
28 bool operator!=(const tosa_level_t &rhs) {
29 return !(MAX_RANK == rhs.MAX_RANK && MAX_KERNEL == rhs.MAX_KERNEL &&
30 MAX_STRIDE == rhs.MAX_STRIDE && MAX_SCALE == rhs.MAX_SCALE);
31 }
32};
33
Eric Kunzee5e26762020-10-13 16:11:07 -070034struct func_config_t
35{
Eric Kunze286f8342022-06-22 11:30:23 -070036 std::string operator_fbs = "tosa.fbs";
37 std::string test_desc = "desc.json";
38 std::string flatbuffer_dir = "";
39 std::string output_dir = "";
40 std::string tosa_file = "";
41 std::string ifm_name = "";
42 std::string ifm_file = "";
43 std::string ofm_name = "";
44 std::string ofm_file = "";
45 uint32_t eval = 1;
46 uint32_t validate_only = 0;
47 uint32_t output_tensors = 1;
48 uint32_t tosa_profile = 1;
49 uint32_t dump_intermediates = 0;
50 std::string fp_format = "0.5";
James Ward24dbc422022-10-19 12:20:31 +010051 bool float_is_big_endian = false; // Set in arith_util.h by float_is_big_endian()
Jerry Gea793f462023-04-11 00:05:02 +000052
53 tosa_level_t tosa_level;
54 static constexpr tosa_level_t EIGHTK = { 6, 8192, 8192, 64 };
55 static constexpr tosa_level_t NONE = { 0, 0, 0, 0 };
Eric Kunzee5e26762020-10-13 16:11:07 -070056};
57
Eric Kunzee5e26762020-10-13 16:11:07 -070058#endif