blob: 545ceeb5d555875fe58be64fe8a7ff827fdb5f9c [file] [log] [blame]
Tianle Cheng92ce35c2023-07-25 16:41:00 +01001//
Colm Donelan7bcae3c2024-01-22 10:07:14 +00002// Copyright © 2023-2024 Arm Ltd and Contributors. All rights reserved.
Tianle Cheng92ce35c2023-07-25 16:41:00 +01003// SPDX-License-Identifier: MIT
4//
5
6#include "TileTestHelper.hpp"
7
Tianle Cheng92ce35c2023-07-25 16:41:00 +01008#include <doctest/doctest.h>
9
10namespace armnnDelegate
11{
Colm Donelan7bcae3c2024-01-22 10:07:14 +000012void TileFloat32Test()
Tianle Cheng92ce35c2023-07-25 16:41:00 +010013{
14 // Set input data
15 std::vector<float> inputValues =
16 {
17 0.f, 1.f, 2.f,
18 3.f, 4.f, 5.f
19 };
20
21 // Set output data
22 std::vector<float> expectedOutputValues =
23 {
24 0.f, 1.f, 2.f, 0.f, 1.f, 2.f,
25 3.f, 4.f, 5.f, 3.f, 4.f, 5.f,
26
27 0.f, 1.f, 2.f, 0.f, 1.f, 2.f,
28 3.f, 4.f, 5.f, 3.f, 4.f, 5.f
29 };
30
31 // The multiples
32 const std::vector<int32_t> multiplesValues = { 2, 2 };
33
34 // Set shapes
35 const std::vector<int32_t> inputShape = { 2, 3 };
36 const std::vector<int32_t> multiplesShape = { 2 };
37 const std::vector<int32_t> expectedOutputShape = { 4, 6 };
38
39 TileFP32TestImpl(tflite::BuiltinOperator_TILE,
Tianle Cheng92ce35c2023-07-25 16:41:00 +010040 inputValues,
41 inputShape,
42 multiplesValues,
43 multiplesShape,
44 expectedOutputValues,
45 expectedOutputShape);
46}
47
Colm Donelan7bcae3c2024-01-22 10:07:14 +000048TEST_SUITE("TileTestsTests")
Tianle Cheng92ce35c2023-07-25 16:41:00 +010049{
50
Colm Donelan7bcae3c2024-01-22 10:07:14 +000051 TEST_CASE ("Tile_Float32_Test")
Tianle Cheng92ce35c2023-07-25 16:41:00 +010052 {
Colm Donelan7bcae3c2024-01-22 10:07:14 +000053 TileFloat32Test();
Tianle Cheng92ce35c2023-07-25 16:41:00 +010054 }
55
Colm Donelan7bcae3c2024-01-22 10:07:14 +000056} // TEST_SUITE("Tile_Float32_Test")
Tianle Cheng92ce35c2023-07-25 16:41:00 +010057
58} // namespace armnnDelegate