Eric Kunze | e5e2676 | 2020-10-13 16:11:07 -0700 | [diff] [blame] | 1 | |
Jerry Ge | a793f46 | 2023-04-11 00:05:02 +0000 | [diff] [blame^] | 2 | // Copyright (c) 2020-2023, ARM Limited. |
Eric Kunze | e5e2676 | 2020-10-13 16:11:07 -0700 | [diff] [blame] | 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 | #ifndef FUNC_CONFIG_H_ |
| 17 | #define FUNC_CONFIG_H_ |
| 18 | |
Matthew Sloyan | ba5fad3 | 2022-09-26 13:31:43 +0100 | [diff] [blame] | 19 | #include <iostream> |
| 20 | #include <stdio.h> |
| 21 | |
Jerry Ge | a793f46 | 2023-04-11 00:05:02 +0000 | [diff] [blame^] | 22 | struct 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 Kunze | e5e2676 | 2020-10-13 16:11:07 -0700 | [diff] [blame] | 34 | struct func_config_t |
| 35 | { |
Eric Kunze | 286f834 | 2022-06-22 11:30:23 -0700 | [diff] [blame] | 36 | 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 Ward | 24dbc42 | 2022-10-19 12:20:31 +0100 | [diff] [blame] | 51 | bool float_is_big_endian = false; // Set in arith_util.h by float_is_big_endian() |
Jerry Ge | a793f46 | 2023-04-11 00:05:02 +0000 | [diff] [blame^] | 52 | |
| 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 Kunze | e5e2676 | 2020-10-13 16:11:07 -0700 | [diff] [blame] | 56 | }; |
| 57 | |
Eric Kunze | e5e2676 | 2020-10-13 16:11:07 -0700 | [diff] [blame] | 58 | #endif |