1 /* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 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 #ifndef CONST_H 16 #define CONST_H 17 18 #include <string> 19 #include <vector> 20 21 namespace OHOS { 22 namespace NeuralNetworkRuntime { 23 namespace Test { 24 25 const uint32_t ADD_DATA_LENGTH = 4 * sizeof(float); 26 const uint32_t AVG_INPUT_LENGTH = 9 * sizeof(float); 27 const std::vector<int32_t> TENSOR_SHAPE = {2, 2, 2, 2}; 28 const std::vector<int32_t> PARAM_INDEX = {2}; 29 const std::vector<int32_t> INPUT_INDEX = {0, 1}; 30 const std::vector<int32_t> OUTPUT_INDEX = {3}; 31 const int32_t ELEMENT_COUNT = 4; 32 33 const std::string CACHE_DIR = "./cache"; 34 const std::string CACHE_PATH = CACHE_DIR + "/0.nncache"; 35 const std::string CACHE_INFO_PATH = CACHE_DIR + "/cache_info.nncache"; 36 const uint32_t NO_DEVICE_COUNT = 0; 37 const int STRESS_COUNT = 10000; 38 const int PRINT_FREQ = 500; 39 40 const size_t MODEL_SIZE = 100; 41 const size_t ZERO = 0; 42 const uint32_t CACHEVERSION = 1; 43 const std::string SUPPORTMODELPATH = "modelPath"; 44 const unsigned short TEST_BUFFER[14] = { 45 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad 46 }; 47 } // namespace Test 48 } // namespace NeuralNetworkRuntime 49 } // namespace OHOS 50 51 #endif // CONST_H