David Monahan | 1670b0c | 2020-11-18 14:40:27 +0000 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2020 Arm Ltd and Contributors. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #include "RedefineTestHelper.hpp" |
| 7 | |
| 8 | #include <armnn_delegate.hpp> |
| 9 | |
| 10 | #include <flatbuffers/flatbuffers.h> |
| 11 | #include <tensorflow/lite/schema/schema_generated.h> |
| 12 | |
| 13 | #include <doctest/doctest.h> |
| 14 | |
Narumol Prangnawarat | 4cf0fe3 | 2020-12-18 16:13:06 +0000 | [diff] [blame] | 15 | #include <half/half.hpp> |
| 16 | |
| 17 | using Half = half_float::half; |
| 18 | |
David Monahan | 1670b0c | 2020-11-18 14:40:27 +0000 | [diff] [blame] | 19 | namespace armnnDelegate |
| 20 | { |
| 21 | |
| 22 | void ReshapeSimpleTest(std::vector<armnn::BackendId>& backends, bool useOption = true) |
| 23 | { |
| 24 | // Set input data |
| 25 | std::vector<int32_t> inputShape { 1, 3, 4, 1 }; |
| 26 | std::vector<int32_t> outputShape { 1, 3, 2, 2 }; |
| 27 | std::vector<int32_t> targetShape { 1, 3, 2, 2 }; |
| 28 | |
| 29 | std::vector<float> inputValues = { -5.0f, 8.0f, -10.0f, 7.0f, |
| 30 | 8.0f, 12.0f, -15.0f, 2.0f, |
| 31 | 3.0f, -4.0f, -1.0f, -11.0f }; |
| 32 | |
| 33 | std::vector<float> expectedOutputValues = { -5.0f, 8.0f, -10.0f, 7.0f, |
| 34 | 8.0f, 12.0f, -15.0f, 2.0f, |
| 35 | 3.0f, -4.0f, -1.0f, -11.0f }; |
| 36 | |
| 37 | RedefineTest<float>(tflite::BuiltinOperator_RESHAPE, |
| 38 | ::tflite::TensorType_FLOAT32, |
| 39 | backends, |
| 40 | inputShape, |
| 41 | outputShape, |
| 42 | inputValues, |
| 43 | expectedOutputValues, |
| 44 | targetShape, |
| 45 | useOption); |
| 46 | } |
| 47 | |
Narumol Prangnawarat | 4cf0fe3 | 2020-12-18 16:13:06 +0000 | [diff] [blame] | 48 | using namespace half_float::literal; |
| 49 | |
| 50 | void ReshapeSimpleFloat16Test(std::vector<armnn::BackendId>& backends, bool useOption = true) |
| 51 | { |
| 52 | // Set input data |
| 53 | std::vector<int32_t> inputShape { 1, 3, 4, 1 }; |
| 54 | std::vector<int32_t> outputShape { 1, 3, 2, 2 }; |
| 55 | std::vector<int32_t> targetShape { 1, 3, 2, 2 }; |
| 56 | |
| 57 | std::vector<Half> inputValues = { 5._h, -8._h, -10._h, 7._h, |
| 58 | 8._h, 12._h, -15._h, 2._h, |
| 59 | 3._h, -4._h, -1._h, -11._h }; |
| 60 | |
| 61 | std::vector<Half> expectedOutputValues = { 5._h, -8._h, -10._h, 7._h, |
| 62 | 8._h, 12._h, -15._h, 2._h, |
| 63 | 3._h, -4._h, -1._h, -11._h }; |
| 64 | |
| 65 | RedefineTest<Half>(tflite::BuiltinOperator_RESHAPE, |
| 66 | ::tflite::TensorType_FLOAT16, |
| 67 | backends, |
| 68 | inputShape, |
| 69 | outputShape, |
| 70 | inputValues, |
| 71 | expectedOutputValues, |
| 72 | targetShape, |
| 73 | useOption); |
| 74 | } |
| 75 | |
David Monahan | 1670b0c | 2020-11-18 14:40:27 +0000 | [diff] [blame] | 76 | void ReshapeReduceDimTest(std::vector<armnn::BackendId>& backends, bool useOption = true) |
| 77 | { |
| 78 | // Set input data |
| 79 | std::vector<int32_t> inputShape { 1, 3, 4, 1 }; |
| 80 | std::vector<int32_t> outputShape { 1, 4, 3 }; |
| 81 | std::vector<int32_t> targetShape { 1, 4, 3 }; |
| 82 | |
| 83 | std::vector<float> inputValues = { -5.0f, 8.0f, -10.0f, 7.0f, |
| 84 | 8.0f, 12.0f, -15.0f, 2.0f, |
| 85 | 3.0f, -4.0f, -1.0f, -11.0f }; |
| 86 | |
| 87 | std::vector<float> expectedOutputValues = { -5.0f, 8.0f, -10.0f, 7.0f, |
| 88 | 8.0f, 12.0f, -15.0f, 2.0f, |
| 89 | 3.0f, -4.0f, -1.0f, -11.0f }; |
| 90 | |
| 91 | RedefineTest<float>(tflite::BuiltinOperator_RESHAPE, |
| 92 | ::tflite::TensorType_FLOAT32, |
| 93 | backends, |
| 94 | inputShape, |
| 95 | outputShape, |
| 96 | inputValues, |
| 97 | expectedOutputValues, |
| 98 | targetShape, |
| 99 | useOption); |
| 100 | } |
| 101 | |
| 102 | void ReshapeFlattenTest(std::vector<armnn::BackendId>& backends, bool useOption = true) |
| 103 | { |
| 104 | // Set input data |
| 105 | std::vector<int32_t> inputShape { 1, 3, 4, 1 }; |
| 106 | std::vector<int32_t> outputShape { 6, 2 }; |
| 107 | std::vector<int32_t> targetShape { -1, 2 }; |
| 108 | |
| 109 | std::vector<float> inputValues = { -5.0f, 8.0f, -10.0f, 7.0f, |
| 110 | 8.0f, 12.0f, -15.0f, 2.0f, |
| 111 | 3.0f, -4.0f, -1.0f, -11.0f }; |
| 112 | |
| 113 | std::vector<float> expectedOutputValues = { -5.0f, 8.0f, -10.0f, 7.0f, |
| 114 | 8.0f, 12.0f, -15.0f, 2.0f, |
| 115 | 3.0f, -4.0f, -1.0f, -11.0f }; |
| 116 | |
| 117 | RedefineTest<float>(tflite::BuiltinOperator_RESHAPE, |
| 118 | ::tflite::TensorType_FLOAT32, |
| 119 | backends, |
| 120 | inputShape, |
| 121 | outputShape, |
| 122 | inputValues, |
| 123 | expectedOutputValues, |
| 124 | targetShape, |
| 125 | useOption); |
| 126 | } |
| 127 | |
| 128 | void ReshapeFlattenAllTest(std::vector<armnn::BackendId>& backends, bool useOption = true) |
| 129 | { |
| 130 | // Set input data |
| 131 | std::vector<int32_t> inputShape { 1, 3, 4, 1 }; |
| 132 | std::vector<int32_t> outputShape { 12 }; |
| 133 | std::vector<int32_t> targetShape { -1 }; |
| 134 | |
| 135 | std::vector<float> inputValues = { -5.0f, 8.0f, -10.0f, 7.0f, |
| 136 | 8.0f, 12.0f, -15.0f, 2.0f, |
| 137 | 3.0f, -4.0f, -1.0f, -11.0f }; |
| 138 | |
| 139 | std::vector<float> expectedOutputValues = { -5.0f, 8.0f, -10.0f, 7.0f, |
| 140 | 8.0f, 12.0f, -15.0f, 2.0f, |
| 141 | 3.0f, -4.0f, -1.0f, -11.0f }; |
| 142 | |
| 143 | RedefineTest<float>(tflite::BuiltinOperator_RESHAPE, |
| 144 | ::tflite::TensorType_FLOAT32, |
| 145 | backends, |
| 146 | inputShape, |
| 147 | outputShape, |
| 148 | inputValues, |
| 149 | expectedOutputValues, |
| 150 | targetShape, |
| 151 | useOption); |
| 152 | } |
| 153 | |
| 154 | void ReshapeInt8Test(std::vector<armnn::BackendId>& backends, bool useOption = true) |
| 155 | { |
| 156 | // Set input data |
| 157 | std::vector<int32_t> inputShape { 1, 3, 4, 1 }; |
| 158 | std::vector<int32_t> outputShape { 6, 2 }; |
| 159 | std::vector<int32_t> targetShape { -1, 2 }; |
| 160 | |
| 161 | std::vector<int8_t> inputValues = { -5, 8, -10, 7, |
| 162 | 8, 12, -15, 2, |
| 163 | 3, -4, -1, -11 }; |
| 164 | |
| 165 | std::vector<int8_t> expectedOutputValues = { -5, 8, -10, 7, |
| 166 | 8, 12, -15, 2, |
| 167 | 3, -4, -1, -11 }; |
| 168 | |
| 169 | RedefineTest<int8_t>(tflite::BuiltinOperator_RESHAPE, |
| 170 | ::tflite::TensorType_INT8, |
| 171 | backends, |
| 172 | inputShape, |
| 173 | outputShape, |
| 174 | inputValues, |
| 175 | expectedOutputValues, |
| 176 | targetShape, |
| 177 | useOption, |
| 178 | 2.5f, |
| 179 | 1); |
| 180 | } |
| 181 | |
| 182 | void ReshapeUint8Test(std::vector<armnn::BackendId>& backends, bool useOption = true) |
| 183 | { |
| 184 | // Set input data |
| 185 | std::vector<int32_t> inputShape { 1, 3, 4, 1 }; |
| 186 | std::vector<int32_t> outputShape { 6, 2 }; |
| 187 | std::vector<int32_t> targetShape { -1, 2 }; |
| 188 | |
| 189 | std::vector<uint8_t> inputValues = { 5, 8, 10, 7, |
| 190 | 8, 12, 15, 2, |
| 191 | 3, 4, 1, 11 }; |
| 192 | |
| 193 | std::vector<uint8_t> expectedOutputValues = { 5, 8, 10, 7, |
| 194 | 8, 12, 15, 2, |
| 195 | 3, 4, 1, 11 }; |
| 196 | |
| 197 | RedefineTest<uint8_t>(tflite::BuiltinOperator_RESHAPE, |
| 198 | ::tflite::TensorType_UINT8, |
| 199 | backends, |
| 200 | inputShape, |
| 201 | outputShape, |
| 202 | inputValues, |
| 203 | expectedOutputValues, |
| 204 | targetShape, |
| 205 | useOption, |
| 206 | 2.5f, |
| 207 | 1); |
| 208 | } |
| 209 | |
| 210 | void ReshapeInt16Test(std::vector<armnn::BackendId>& backends, bool useOption = true) |
| 211 | { |
| 212 | // Set input data |
| 213 | std::vector<int32_t> inputShape { 1, 3, 4, 1 }; |
| 214 | std::vector<int32_t> outputShape { 6, 2 }; |
| 215 | std::vector<int32_t> targetShape { -1, 2 }; |
| 216 | |
| 217 | std::vector<int16_t> inputValues = { -5, 8, -10, 7, |
| 218 | 8, 12, -15, 2, |
| 219 | 3, -4, -1, -11 }; |
| 220 | |
| 221 | std::vector<int16_t> expectedOutputValues = { -5, 8, -10, 7, |
| 222 | 8, 12, -15, 2, |
| 223 | 3, -4, -1, -11 }; |
| 224 | |
| 225 | RedefineTest<int16_t>(tflite::BuiltinOperator_RESHAPE, |
| 226 | ::tflite::TensorType_INT16, |
| 227 | backends, |
| 228 | inputShape, |
| 229 | outputShape, |
| 230 | inputValues, |
| 231 | expectedOutputValues, |
| 232 | targetShape, |
| 233 | useOption, |
| 234 | 2.5f, |
| 235 | 0); |
| 236 | } |
| 237 | |
| 238 | TEST_SUITE("Reshape_GpuAccTests") |
| 239 | { |
| 240 | |
| 241 | TEST_CASE ("Reshape_Simple_GpuAcc_Test") |
| 242 | { |
| 243 | std::vector<armnn::BackendId> backends = { armnn::Compute::GpuAcc }; |
| 244 | ReshapeSimpleTest(backends); |
| 245 | } |
| 246 | |
| 247 | TEST_CASE ("Reshape_ReduceDimension_GpuAcc_Test") |
| 248 | { |
| 249 | std::vector<armnn::BackendId> backends = { armnn::Compute::GpuAcc }; |
| 250 | ReshapeReduceDimTest(backends); |
| 251 | } |
| 252 | |
| 253 | TEST_CASE ("Reshape_Flatten_GpuAcc_Test") |
| 254 | { |
| 255 | std::vector<armnn::BackendId> backends = { armnn::Compute::GpuAcc }; |
| 256 | ReshapeFlattenTest(backends); |
| 257 | } |
| 258 | |
| 259 | TEST_CASE ("Reshape_FlattenAll_GpuAcc_Test") |
| 260 | { |
| 261 | std::vector<armnn::BackendId> backends = { armnn::Compute::GpuAcc }; |
| 262 | ReshapeFlattenAllTest(backends); |
| 263 | } |
| 264 | |
| 265 | TEST_CASE ("Reshape_Int8_GpuAcc_Test") |
| 266 | { |
| 267 | std::vector<armnn::BackendId> backends = { armnn::Compute::GpuAcc }; |
| 268 | ReshapeInt8Test(backends); |
| 269 | } |
| 270 | |
| 271 | TEST_CASE ("Reshape_Uint8_GpuAcc_Test") |
| 272 | { |
| 273 | std::vector<armnn::BackendId> backends = { armnn::Compute::GpuAcc }; |
| 274 | ReshapeUint8Test(backends); |
| 275 | } |
| 276 | |
Narumol Prangnawarat | 4cf0fe3 | 2020-12-18 16:13:06 +0000 | [diff] [blame] | 277 | TEST_CASE ("Reshape_Float16_GpuAcc_Test") |
| 278 | { |
| 279 | std::vector<armnn::BackendId> backends = { armnn::Compute::GpuAcc }; |
| 280 | ReshapeSimpleFloat16Test(backends); |
| 281 | } |
| 282 | |
David Monahan | 1670b0c | 2020-11-18 14:40:27 +0000 | [diff] [blame] | 283 | TEST_CASE ("Reshape_Simple_ShapeTensor_GpuAcc_Test") |
| 284 | { |
| 285 | std::vector<armnn::BackendId> backends = { armnn::Compute::GpuAcc }; |
| 286 | ReshapeSimpleTest(backends, false); |
| 287 | } |
| 288 | |
| 289 | TEST_CASE ("Reshape_ReduceDimension_ShapeTensor_GpuAcc_Test") |
| 290 | { |
| 291 | std::vector<armnn::BackendId> backends = { armnn::Compute::GpuAcc }; |
| 292 | ReshapeReduceDimTest(backends, false); |
| 293 | } |
| 294 | |
| 295 | TEST_CASE ("Reshape_Flatten_ShapeTensor_GpuAcc_Test") |
| 296 | { |
| 297 | std::vector<armnn::BackendId> backends = { armnn::Compute::GpuAcc }; |
| 298 | ReshapeFlattenTest(backends, false); |
| 299 | } |
| 300 | |
| 301 | TEST_CASE ("Reshape_FlattenAll_ShapeTensor_GpuAcc_Test") |
| 302 | { |
| 303 | std::vector<armnn::BackendId> backends = { armnn::Compute::GpuAcc }; |
| 304 | ReshapeFlattenAllTest(backends, false); |
| 305 | } |
| 306 | |
| 307 | TEST_CASE ("Reshape_Int8_ShapeTensor_GpuAcc_Test") |
| 308 | { |
| 309 | std::vector<armnn::BackendId> backends = { armnn::Compute::GpuAcc }; |
| 310 | ReshapeInt8Test(backends, false); |
| 311 | } |
| 312 | |
| 313 | TEST_CASE ("Reshape_Uint8_ShapeTensor_GpuAcc_Test") |
| 314 | { |
| 315 | std::vector<armnn::BackendId> backends = { armnn::Compute::GpuAcc }; |
| 316 | ReshapeUint8Test(backends, false); |
| 317 | } |
| 318 | |
Narumol Prangnawarat | 4cf0fe3 | 2020-12-18 16:13:06 +0000 | [diff] [blame] | 319 | TEST_CASE ("Reshape_Float16_ShapeTensor_GpuAcc_Test") |
| 320 | { |
| 321 | std::vector<armnn::BackendId> backends = { armnn::Compute::GpuAcc }; |
| 322 | ReshapeSimpleFloat16Test(backends, false); |
| 323 | } |
| 324 | |
David Monahan | 1670b0c | 2020-11-18 14:40:27 +0000 | [diff] [blame] | 325 | } // TEST_SUITE("Reshape_GpuAccTests") |
| 326 | |
| 327 | TEST_SUITE("Reshape_CpuAccTests") |
| 328 | { |
| 329 | |
| 330 | TEST_CASE ("Reshape_Simple_CpuAcc_Test") |
| 331 | { |
| 332 | std::vector<armnn::BackendId> backends = { armnn::Compute::CpuAcc }; |
| 333 | ReshapeSimpleTest(backends); |
| 334 | } |
| 335 | |
| 336 | TEST_CASE ("Reshape_ReduceDimension_CpuAcc_Test") |
| 337 | { |
| 338 | std::vector<armnn::BackendId> backends = { armnn::Compute::CpuAcc }; |
| 339 | ReshapeReduceDimTest(backends); |
| 340 | } |
| 341 | |
| 342 | TEST_CASE ("Reshape_Flatten_CpuAcc_Test") |
| 343 | { |
| 344 | std::vector<armnn::BackendId> backends = { armnn::Compute::CpuAcc }; |
| 345 | ReshapeFlattenTest(backends); |
| 346 | } |
| 347 | |
| 348 | TEST_CASE ("Reshape_FlattenAll_CpuAcc_Test") |
| 349 | { |
| 350 | std::vector<armnn::BackendId> backends = { armnn::Compute::CpuAcc }; |
| 351 | ReshapeFlattenAllTest(backends); |
| 352 | } |
| 353 | |
| 354 | TEST_CASE ("Reshape_Int8_CpuAcc_Test") |
| 355 | { |
| 356 | std::vector<armnn::BackendId> backends = { armnn::Compute::CpuAcc }; |
| 357 | ReshapeInt8Test(backends); |
| 358 | } |
| 359 | |
| 360 | TEST_CASE ("Reshape_Uint8_CpuAcc_Test") |
| 361 | { |
| 362 | std::vector<armnn::BackendId> backends = { armnn::Compute::CpuAcc }; |
| 363 | ReshapeUint8Test(backends); |
| 364 | } |
| 365 | |
Narumol Prangnawarat | 4cf0fe3 | 2020-12-18 16:13:06 +0000 | [diff] [blame] | 366 | TEST_CASE ("Reshape_Float16_CpuAcc_Test") |
| 367 | { |
| 368 | std::vector<armnn::BackendId> backends = { armnn::Compute::CpuAcc }; |
| 369 | ReshapeSimpleFloat16Test(backends); |
| 370 | } |
| 371 | |
David Monahan | 1670b0c | 2020-11-18 14:40:27 +0000 | [diff] [blame] | 372 | TEST_CASE ("Reshape_Simple_ShapeTensor_CpuAcc_Test") |
| 373 | { |
| 374 | std::vector<armnn::BackendId> backends = { armnn::Compute::CpuAcc }; |
| 375 | ReshapeSimpleTest(backends, false); |
| 376 | } |
| 377 | |
| 378 | TEST_CASE ("Reshape_ReduceDimension_ShapeTensor_CpuAcc_Test") |
| 379 | { |
| 380 | std::vector<armnn::BackendId> backends = { armnn::Compute::CpuAcc }; |
| 381 | ReshapeReduceDimTest(backends, false); |
| 382 | } |
| 383 | |
| 384 | TEST_CASE ("Reshape_Flatten_ShapeTensor_CpuAcc_Test") |
| 385 | { |
| 386 | std::vector<armnn::BackendId> backends = { armnn::Compute::CpuAcc }; |
| 387 | ReshapeFlattenTest(backends, false); |
| 388 | } |
| 389 | |
| 390 | TEST_CASE ("Reshape_FlattenAll_ShapeTensor_CpuAcc_Test") |
| 391 | { |
| 392 | std::vector<armnn::BackendId> backends = { armnn::Compute::CpuAcc }; |
| 393 | ReshapeFlattenAllTest(backends, false); |
| 394 | } |
| 395 | |
| 396 | TEST_CASE ("Reshape_Int8_ShapeTensor_CpuAcc_Test") |
| 397 | { |
| 398 | std::vector<armnn::BackendId> backends = { armnn::Compute::CpuAcc }; |
| 399 | ReshapeInt8Test(backends, false); |
| 400 | } |
| 401 | |
| 402 | TEST_CASE ("Reshape_Uint8_ShapeTensor_CpuAcc_Test") |
| 403 | { |
| 404 | std::vector<armnn::BackendId> backends = { armnn::Compute::CpuAcc }; |
| 405 | ReshapeUint8Test(backends, false); |
| 406 | } |
| 407 | |
Narumol Prangnawarat | 4cf0fe3 | 2020-12-18 16:13:06 +0000 | [diff] [blame] | 408 | TEST_CASE ("Reshape_Float16_ShapeTensor_CpuAcc_Test") |
| 409 | { |
| 410 | std::vector<armnn::BackendId> backends = { armnn::Compute::CpuAcc }; |
| 411 | ReshapeSimpleFloat16Test(backends, false); |
| 412 | } |
| 413 | |
David Monahan | 1670b0c | 2020-11-18 14:40:27 +0000 | [diff] [blame] | 414 | } // TEST_SUITE("Reshape_CpuAccTests") |
| 415 | |
| 416 | TEST_SUITE("Reshape_CpuRefTests") |
| 417 | { |
| 418 | |
| 419 | TEST_CASE ("Reshape_Simple_CpuRef_Test") |
| 420 | { |
| 421 | std::vector<armnn::BackendId> backends = { armnn::Compute::CpuRef }; |
| 422 | ReshapeSimpleTest(backends); |
| 423 | } |
| 424 | |
| 425 | TEST_CASE ("Reshape_ReduceDimension_CpuRef_Test") |
| 426 | { |
| 427 | std::vector<armnn::BackendId> backends = { armnn::Compute::CpuRef }; |
| 428 | ReshapeReduceDimTest(backends); |
| 429 | } |
| 430 | |
| 431 | TEST_CASE ("Reshape_Flatten_CpuRef_Test") |
| 432 | { |
| 433 | std::vector<armnn::BackendId> backends = { armnn::Compute::CpuRef }; |
| 434 | ReshapeFlattenTest(backends); |
| 435 | } |
| 436 | |
| 437 | TEST_CASE ("Reshape_FlattenAll_CpuRef_Test") |
| 438 | { |
| 439 | std::vector<armnn::BackendId> backends = { armnn::Compute::CpuRef }; |
| 440 | ReshapeFlattenAllTest(backends); |
| 441 | } |
| 442 | |
| 443 | TEST_CASE ("Reshape_Int8_CpuRef_Test") |
| 444 | { |
| 445 | std::vector<armnn::BackendId> backends = { armnn::Compute::CpuRef }; |
| 446 | ReshapeInt8Test(backends); |
| 447 | } |
| 448 | |
| 449 | TEST_CASE ("Reshape_Uint8_CpuRef_Test") |
| 450 | { |
| 451 | std::vector<armnn::BackendId> backends = { armnn::Compute::CpuRef }; |
| 452 | ReshapeUint8Test(backends); |
| 453 | } |
| 454 | |
| 455 | TEST_CASE ("Reshape_Int16_CpuRef_Test") |
| 456 | { |
| 457 | std::vector<armnn::BackendId> backends = { armnn::Compute::CpuRef }; |
| 458 | ReshapeInt16Test(backends); |
| 459 | } |
| 460 | |
Narumol Prangnawarat | 4cf0fe3 | 2020-12-18 16:13:06 +0000 | [diff] [blame] | 461 | TEST_CASE ("Reshape_Float16_CpuRef_Test") |
| 462 | { |
| 463 | std::vector<armnn::BackendId> backends = { armnn::Compute::CpuRef }; |
| 464 | ReshapeSimpleFloat16Test(backends); |
| 465 | } |
| 466 | |
David Monahan | 1670b0c | 2020-11-18 14:40:27 +0000 | [diff] [blame] | 467 | TEST_CASE ("Reshape_Simple_ShapeTensor_CpuRef_Test") |
| 468 | { |
| 469 | std::vector<armnn::BackendId> backends = { armnn::Compute::CpuRef }; |
| 470 | ReshapeSimpleTest(backends, false); |
| 471 | } |
| 472 | |
| 473 | TEST_CASE ("Reshape_ReduceDimension_ShapeTensor_CpuRef_Test") |
| 474 | { |
| 475 | std::vector<armnn::BackendId> backends = { armnn::Compute::CpuRef }; |
| 476 | ReshapeReduceDimTest(backends, false); |
| 477 | } |
| 478 | |
| 479 | TEST_CASE ("Reshape_Flatten_ShapeTensor_CpuRef_Test") |
| 480 | { |
| 481 | std::vector<armnn::BackendId> backends = { armnn::Compute::CpuRef }; |
| 482 | ReshapeFlattenTest(backends, false); |
| 483 | } |
| 484 | |
| 485 | TEST_CASE ("Reshape_FlattenAll_ShapeTensor_CpuRef_Test") |
| 486 | { |
| 487 | std::vector<armnn::BackendId> backends = { armnn::Compute::CpuRef }; |
| 488 | ReshapeFlattenAllTest(backends, false); |
| 489 | } |
| 490 | |
| 491 | TEST_CASE ("Reshape_Int8_ShapeTensor_CpuRef_Test") |
| 492 | { |
| 493 | std::vector<armnn::BackendId> backends = { armnn::Compute::CpuRef }; |
| 494 | ReshapeInt8Test(backends, false); |
| 495 | } |
| 496 | |
| 497 | TEST_CASE ("Reshape_Uint8_ShapeTensor_CpuRef_Test") |
| 498 | { |
| 499 | std::vector<armnn::BackendId> backends = { armnn::Compute::CpuRef }; |
| 500 | ReshapeUint8Test(backends, false); |
| 501 | } |
| 502 | |
| 503 | TEST_CASE ("Reshape_Int16_ShapeTensor_CpuRef_Test") |
| 504 | { |
| 505 | std::vector<armnn::BackendId> backends = { armnn::Compute::CpuRef }; |
| 506 | ReshapeInt16Test(backends, false); |
| 507 | } |
| 508 | |
Narumol Prangnawarat | 4cf0fe3 | 2020-12-18 16:13:06 +0000 | [diff] [blame] | 509 | TEST_CASE ("Reshape_Float16_ShapeTensor_CpuRef_Test") |
| 510 | { |
| 511 | std::vector<armnn::BackendId> backends = { armnn::Compute::CpuRef }; |
| 512 | ReshapeSimpleFloat16Test(backends, false); |
| 513 | } |
| 514 | |
David Monahan | 1670b0c | 2020-11-18 14:40:27 +0000 | [diff] [blame] | 515 | } // TEST_SUITE("Reshape_CpuRefTests") |
| 516 | |
| 517 | } // namespace armnnDelegate |