13 explicit SplitVFixture(
const std::string& inputShape,
14 const std::string& splitValues,
15 const std::string& sizeSplitsShape,
16 const std::string& axisShape,
17 const std::string& numSplits,
18 const std::string& outputShape1,
19 const std::string& outputShape2,
20 const std::string& axisData,
21 const std::string& dataType)
26 "operator_codes": [ { "builtin_code": "SPLIT_V" } ], 30 "shape": )" + inputShape + R"(, 31 "type": )" + dataType + R"(, 33 "name": "inputTensor", 42 "shape": )" + sizeSplitsShape + R"(, 54 "shape": )" + axisShape + R"(, 66 "shape": )" + outputShape1 + R"( , 67 "type":)" + dataType + R"(, 69 "name": "outputTensor1", 78 "shape": )" + outputShape2 + R"( , 79 "type":)" + dataType + R"(, 81 "name": "outputTensor2", 90 "inputs": [ 0, 1, 2 ], 95 "inputs": [ 0, 1, 2 ], 97 "builtin_options_type": "SplitVOptions", 99 "num_splits": )" + numSplits + R"( 101 "custom_options_format": "FLEXBUFFERS" 105 "buffers" : [ {}, { "data": )" + splitValues + R"( }, { "data": )" + axisData + R"( }, {}, {}] 117 struct SimpleSplitVAxisOneFixture : SplitVFixture
119 SimpleSplitVAxisOneFixture()
120 : SplitVFixture(
"[ 4, 2, 2, 2 ]",
"[ 1, 0, 0, 0, 3, 0, 0, 0 ]",
"[ 2 ]",
"[ ]",
"2",
121 "[ 1, 2, 2, 2 ]",
"[ 3, 2, 2, 2 ]",
"[ 0, 0, 0, 0 ]",
"FLOAT32")
127 RunTest<4, armnn::DataType::Float32>(
129 { {
"inputTensor", { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f,
130 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f,
131 17.0f, 18.0f, 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f,
132 25.0f, 26.0f, 27.0f, 28.0f, 29.0f, 30.0f, 31.0f, 32.0f } } },
133 { {
"outputTensor1", { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f } },
134 {
"outputTensor2", { 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f,
135 17.0f, 18.0f, 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f,
136 25.0f, 26.0f, 27.0f, 28.0f, 29.0f, 30.0f, 31.0f, 32.0f } } } );
139 struct SimpleSplitVAxisTwoFixture : SplitVFixture
141 SimpleSplitVAxisTwoFixture()
142 : SplitVFixture(
"[ 2, 4, 2, 2 ]",
"[ 3, 0, 0, 0, 1, 0, 0, 0 ]",
"[ 2 ]",
"[ ]",
"2",
143 "[ 2, 3, 2, 2 ]",
"[ 2, 1, 2, 2 ]",
"[ 1, 0, 0, 0 ]",
"FLOAT32")
149 RunTest<4, armnn::DataType::Float32>(
151 { {
"inputTensor", { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f,
152 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f,
153 17.0f, 18.0f, 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f,
154 25.0f, 26.0f, 27.0f, 28.0f, 29.0f, 30.0f, 31.0f, 32.0f } } },
155 { {
"outputTensor1", { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f,
156 9.0f, 10.0f, 11.0f, 12.0f, 17.0f, 18.0f, 19.0f, 20.0f,
157 21.0f, 22.0f, 23.0f, 24.0f, 25.0f, 26.0f, 27.0f, 28.0f } },
158 {
"outputTensor2", { 13.0f, 14.0f, 15.0f, 16.0f, 29.0f, 30.0f, 31.0f, 32.0f } } } );
161 struct SimpleSplitVAxisThreeFixture : SplitVFixture
163 SimpleSplitVAxisThreeFixture()
164 : SplitVFixture(
"[ 2, 2, 4, 2 ]",
"[ 1, 0, 0, 0, 3, 0, 0, 0 ]",
"[ 2 ]",
"[ ]",
"2",
165 "[ 2, 2, 1, 2 ]",
"[ 2, 2, 3, 2 ]",
"[ 2, 0, 0, 0 ]",
"FLOAT32")
171 RunTest<4, armnn::DataType::Float32>(
173 { {
"inputTensor", { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f,
174 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f,
175 17.0f, 18.0f, 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f,
176 25.0f, 26.0f, 27.0f, 28.0f, 29.0f, 30.0f, 31.0f, 32.0f } } },
177 { {
"outputTensor1", { 1.0f, 2.0f, 9.0f, 10.0f, 17.0f, 18.0f, 25.0f, 26.0f } },
178 {
"outputTensor2", { 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 11.0f, 12.0f,
179 13.0f, 14.0f, 15.0f, 16.0f, 19.0f, 20.0f, 21.0f, 22.0f,
180 23.0f, 24.0f, 27.0f, 28.0f, 29.0f, 30.0f, 31.0f, 32.0f } } } );
183 struct SimpleSplitVAxisFourFixture : SplitVFixture
185 SimpleSplitVAxisFourFixture()
186 : SplitVFixture(
"[ 2, 2, 2, 4 ]",
"[ 3, 0, 0, 0, 1, 0, 0, 0 ]",
"[ 2 ]",
"[ ]",
"2",
187 "[ 2, 2, 2, 3 ]",
"[ 2, 2, 2, 1 ]",
"[ 3, 0, 0, 0 ]",
"FLOAT32")
193 RunTest<4, armnn::DataType::Float32>(
195 { {
"inputTensor", { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f,
196 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f,
197 17.0f, 18.0f, 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f,
198 25.0f, 26.0f, 27.0f, 28.0f, 29.0f, 30.0f, 31.0f, 32.0f } } },
199 { {
"outputTensor1", { 1.0f, 2.0f, 3.0f, 5.0f, 6.0f, 7.0f, 9.0f, 10.0f,
200 11.0f, 13.0f, 14.0f, 15.0f, 17.0f, 18.0f, 19.0f, 21.0f,
201 22.0f, 23.0f, 25.0f, 26.0f, 27.0f, 29.0f, 30.0f, 31.0f} },
202 {
"outputTensor2", { 4.0f, 8.0f, 12.0f, 16.0f, 20.0f, 24.0f, 28.0f, 32.0f } } } );
TEST_CASE_FIXTURE(ClContextControlFixture, "CopyBetweenNeonAndGpu")
void Setup(bool testDynamic=true)