ONE - On-device Neural Engine
Loading...
Searching...
No Matches
FloatDivKernel.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024 Samsung Electronics Co., Ltd. All Rights Reserved
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
17#ifndef ONERT_MICRO_TEST_MODELS_DIV_KERNEL_FLOAT_H
18#define ONERT_MICRO_TEST_MODELS_DIV_KERNEL_FLOAT_H
19
20#include "TestDataDivBase.h"
21
22namespace onert_micro
23{
24namespace test_model
25{
26namespace div_float_with_broadcasting
27{
28
29/*
30 * div Kernel:
31 *
32 * Input_1(1, 4, 4, 3) Input_2(1, 4, 4, 1)
33 * \ /
34 * Div(with broadcast)
35 * |
36 * Output(1, 4, 4, 3)
37 */
38const unsigned char test_kernel_model_circle[] = {
39 0x18, 0x00, 0x00, 0x00, 0x43, 0x49, 0x52, 0x30, 0x00, 0x00, 0x0e, 0x00, 0x14, 0x00, 0x00, 0x00,
40 0x0c, 0x00, 0x08, 0x00, 0x10, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
41 0x30, 0x00, 0x00, 0x00, 0x6c, 0x01, 0x00, 0x00, 0x88, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
42 0x1c, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
43 0x88, 0xff, 0xff, 0xff, 0x8c, 0xff, 0xff, 0xff, 0x90, 0xff, 0xff, 0xff, 0x94, 0xff, 0xff, 0xff,
44 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x18, 0x00, 0x14, 0x00,
45 0x10, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
46 0x1c, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00,
47 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
48 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x14, 0x00, 0x00, 0x00, 0x10, 0x00, 0x0c, 0x00,
49 0x07, 0x00, 0x08, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1d, 0x10, 0x00, 0x00, 0x00,
50 0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00,
51 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
52 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
53 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00,
54 0x34, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xa4, 0xff, 0xff, 0xff, 0x0c, 0x00, 0x00, 0x00,
55 0x03, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x6f, 0x66, 0x6d, 0x00,
56 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
57 0x03, 0x00, 0x00, 0x00, 0xd0, 0xff, 0xff, 0xff, 0x0c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
58 0x10, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x69, 0x66, 0x6d, 0x32, 0x00, 0x00, 0x00, 0x00,
59 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
60 0x01, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x08, 0x00, 0x04, 0x00,
61 0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
62 0x04, 0x00, 0x00, 0x00, 0x69, 0x66, 0x6d, 0x31, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
63 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
64 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0b, 0x00, 0x00, 0x00,
65 0x00, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a,
66 0x11, 0x00, 0x00, 0x00, 0x4f, 0x4e, 0x45, 0x2d, 0x74, 0x66, 0x6c, 0x69, 0x74, 0x65, 0x32, 0x63,
67 0x69, 0x72, 0x63, 0x6c, 0x65, 0x00, 0x00, 0x00};
68
69const std::vector<float> input1_data = {
70 0.53560877, -1.8867658, -8.832248, 5.859678, -5.1357374, -7.014421, 2.8209867, -4.6921616,
71 8.162995, -2.6120718, -0.8869447, -2.3489552, -6.208182, -2.2264383, 6.55287, -5.3615203,
72 -2.7882025, 1.1029396, -9.950372, 0.1670622, 3.533298, 2.606648, 7.126593, -3.6454842,
73 2.637641, -6.7670174, 5.8970585, 8.792766, -6.63798, -1.1457828, 9.122211, -3.2186837,
74 -8.038172, 3.3369763, 0.89376354, -7.979661, -4.241393, -3.4046402, 6.1339216, 7.767886,
75 5.7856345, 8.147999, 9.79144, 8.312661, -4.9722652, 3.0038614, -5.3218126, -6.5680394};
76const std::vector<float> input2_data = {
77 -8.79469, -0.2644837, -1.6307421, 2.0497515, -1.5460981, 1.3044068, 7.1843495, 1.1402534,
78 0.2102437, 4.253287, 7.076496, 1.3749583, 6.6056423, 4.4962177, 3.9589605, -1.8852876};
79const std::vector<float> reference_output_data = {
80 -0.06090138, 0.21453466, 1.0042704, -22.155157, 19.417974, 26.521185, -1.7298791,
81 2.8773167, -5.005694, -1.2743359, -0.4327084, -1.1459707, 4.0153866, 1.4400369,
82 -4.2383275, -4.110313, -2.1375253, 0.8455488, -1.3850067, 0.023253629, 0.49180487,
83 2.286025, 6.250008, -3.1970825, 12.545636, -32.18654, 28.048681, 2.0672872,
84 -1.5606706, -0.26938763, 1.2890859, -0.45484143, -1.1358972, 2.4269655, 0.6500296,
85 -5.803566, -0.6420864, -0.51541394, 0.9285882, 1.727649, 1.2867781, 1.8121896,
86 2.4732351, 2.099708, -1.2559522, -1.5933173, 2.822812, 3.4838395};
87
88} // namespace div_float_with_broadcasting
89
90namespace div_float_no_broadcasting
91{
92/*
93 * div Kernel:
94 *
95 * Input_1(1, 4, 4, 3) Input_2(1, 4, 4, 3)
96 * \ /
97 * Div(no broadcast)
98 * |
99 * Output(1, 4, 4, 3)
100 */
101const unsigned char test_kernel_model_circle[] = {
102 0x18, 0x00, 0x00, 0x00, 0x43, 0x49, 0x52, 0x30, 0x00, 0x00, 0x0e, 0x00, 0x14, 0x00, 0x00, 0x00,
103 0x0c, 0x00, 0x08, 0x00, 0x10, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
104 0x30, 0x00, 0x00, 0x00, 0x6c, 0x01, 0x00, 0x00, 0x88, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
105 0x1c, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
106 0x88, 0xff, 0xff, 0xff, 0x8c, 0xff, 0xff, 0xff, 0x90, 0xff, 0xff, 0xff, 0x94, 0xff, 0xff, 0xff,
107 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x18, 0x00, 0x14, 0x00,
108 0x10, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
109 0x1c, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00,
110 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
111 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x14, 0x00, 0x00, 0x00, 0x10, 0x00, 0x0c, 0x00,
112 0x07, 0x00, 0x08, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1d, 0x10, 0x00, 0x00, 0x00,
113 0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00,
114 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
115 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
116 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00,
117 0x34, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xa4, 0xff, 0xff, 0xff, 0x0c, 0x00, 0x00, 0x00,
118 0x03, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x6f, 0x66, 0x6d, 0x00,
119 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
120 0x03, 0x00, 0x00, 0x00, 0xd0, 0xff, 0xff, 0xff, 0x0c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
121 0x10, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x69, 0x66, 0x6d, 0x32, 0x00, 0x00, 0x00, 0x00,
122 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
123 0x03, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x08, 0x00, 0x04, 0x00,
124 0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
125 0x04, 0x00, 0x00, 0x00, 0x69, 0x66, 0x6d, 0x31, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
126 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
127 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0b, 0x00, 0x00, 0x00,
128 0x00, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a,
129 0x11, 0x00, 0x00, 0x00, 0x4f, 0x4e, 0x45, 0x2d, 0x74, 0x66, 0x6c, 0x69, 0x74, 0x65, 0x32, 0x63,
130 0x69, 0x72, 0x63, 0x6c, 0x65, 0x00, 0x00, 0x00};
131
132std::vector<float> input1_data = {
133 -0.45486993, 7.7920837, 2.458276, -9.338201, 2.132607, 7.5134172, -7.3420544, -6.390925,
134 1.456884, -1.8421048, 2.4459255, -3.930421, 5.439674, -0.3640652, -4.5039334, -8.457781,
135 3.8367634, -6.271797, -3.6314914, 7.7209616, 0.7935352, -6.561332, 0.77153474, 8.639922,
136 0.15612718, 5.9307566, 0.71869296, 5.4473047, -7.4552007, -2.4453044, -5.7700257, 7.9675865,
137 4.7339244, 1.3709338, 6.940702, 2.7984607, 9.185996, 8.848705, -4.7602606, -3.887096,
138 4.807505, 2.9972825, 5.416388, 5.6682634, -5.875255, -0.29188222, 7.522483, -6.873605};
139std::vector<float> input2_data = {
140 1.5015899, 9.9904785, -5.368375, -3.0589666, 1.4541256, 3.0067844, -1.0564902, 3.4706006,
141 4.3666296, 9.586457, -4.497033, -9.208905, -6.8920064, 6.2652717, -0.60215276, 7.8108196,
142 -7.7110577, -4.182856, 6.8893385, 9.817479, -9.451469, -2.0223913, 5.1733356, 5.4378557,
143 4.1402535, -4.4087567, 0.16630036, -8.007953, 4.7895074, -3.2770896, 4.013145, 2.2894316,
144 5.74741, -9.481342, 3.194859, 9.471764, -7.8339133, -8.103412, -3.8862576, 9.901491,
145 5.358148, -2.7227716, -5.84558, 9.881574, 3.5261114, 3.4573863, 8.221204, -3.6716719};
146std::vector<float> reference_output_data = {
147 -0.30292553, 0.779951, -0.4579181, 3.0527303, 1.4665906, 2.4988215, 6.949477,
148 -1.8414464, 0.3336404, -0.19215699, -0.54389757, 0.42680657, -0.7892729, -0.058108445,
149 7.4797187, -1.0828289, -0.49756643, 1.4994054, -0.52711755, 0.7864505, -0.083958924,
150 3.2443435, 0.14913681, 1.5888473, 0.03770957, -1.345222, 4.321656, -0.6802369,
151 -1.5565695, 0.7461817, -1.4377816, 3.4801593, 0.8236622, -0.14459279, 2.1724596,
152 0.29545298, -1.1725935, -1.0919728, 1.2248958, -0.3925768, 0.8972326, -1.1008204,
153 -0.92657834, 0.5736195, -1.6662138, -0.0844228, 0.9150099, 1.872064};
154
155} // namespace div_float_no_broadcasting
156
180
181} // namespace test_model
182} // namespace onert_micro
183
184#endif // ONERT_MICRO_TEST_MODELS_MUL_KERNEL_FLOAT_H
const unsigned char * _test_kernel_model_circle