Gian Marco Iodice | 6c113ed | 2023-01-19 17:14:26 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2023 Arm Limited. |
| 3 | * |
| 4 | * SPDX-License-Identifier: MIT |
| 5 | * |
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | * of this software and associated documentation files (the "Software"), to |
| 8 | * deal in the Software without restriction, including without limitation the |
| 9 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 10 | * sell copies of the Software, and to permit persons to whom the Software is |
| 11 | * furnished to do so, subject to the following conditions: |
| 12 | * |
| 13 | * The above copyright notice and this permission notice shall be included in all |
| 14 | * copies or substantial portions of the Software. |
| 15 | * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 22 | * SOFTWARE. |
| 23 | */ |
| 24 | |
| 25 | #include "tests/CLTileTest.hpp" |
| 26 | #include "tests/TensorBitMaskTest.hpp" |
| 27 | #include "tests/UtilsTest.hpp" |
| 28 | |
| 29 | #include <memory> |
| 30 | #include <vector> |
| 31 | |
| 32 | using namespace ckw; |
| 33 | |
| 34 | /** Main test program |
| 35 | */ |
| 36 | int32_t main() |
| 37 | { |
| 38 | std::vector<ITest*> tests; |
| 39 | |
| 40 | // Add your test here |
| 41 | const auto test0 = std::make_unique<UtilsTest>(); |
| 42 | const auto test1 = std::make_unique<TensorBitMaskTrueTest>(); |
| 43 | const auto test2 = std::make_unique<TensorBitMaskFalseTest>(); |
Jakub Sujak | df5d987 | 2023-05-22 17:38:56 +0100 | [diff] [blame^] | 44 | tests.push_back(test0.get()); |
| 45 | tests.push_back(test1.get()); |
| 46 | tests.push_back(test2.get()); |
| 47 | |
| 48 | #ifdef COMPUTE_KERNEL_WRITER_OPENCL_ENABLED |
Gian Marco Iodice | 6c113ed | 2023-01-19 17:14:26 +0000 | [diff] [blame] | 49 | const auto test3 = std::make_unique<CLTileInternalVariableNamesTest>(); |
| 50 | const auto test4 = std::make_unique<CLTileInternalNumVariablesTest>(); |
| 51 | const auto test5 = std::make_unique<CLTileAccessScalarVariableTest>(); |
| 52 | const auto test6 = std::make_unique<CLTileAccessScalarVariableBroadcastXTest>(); |
| 53 | const auto test7 = std::make_unique<CLTileAccessScalarVariableBroadcastYTest>(); |
Gian Marco Iodice | 6c113ed | 2023-01-19 17:14:26 +0000 | [diff] [blame] | 54 | tests.push_back(test3.get()); |
| 55 | tests.push_back(test4.get()); |
| 56 | tests.push_back(test5.get()); |
| 57 | tests.push_back(test6.get()); |
| 58 | tests.push_back(test7.get()); |
Jakub Sujak | df5d987 | 2023-05-22 17:38:56 +0100 | [diff] [blame^] | 59 | #endif /* COMPUTE_KERNEL_WRITER_OPENCL_ENABLED */ |
Gian Marco Iodice | 6c113ed | 2023-01-19 17:14:26 +0000 | [diff] [blame] | 60 | |
| 61 | bool all_test_passed = true; |
| 62 | |
| 63 | for(auto &x : tests) |
| 64 | { |
| 65 | std::cout << x->name() << std::endl; |
| 66 | all_test_passed &= x->run(); |
| 67 | } |
| 68 | |
| 69 | if(all_test_passed == true) |
| 70 | { |
| 71 | std::cout << "All tests passed" << std::endl; |
| 72 | } |
| 73 | else |
| 74 | { |
| 75 | std::cout << "One or more tests failed" << std::endl; |
| 76 | } |
| 77 | |
| 78 | return 0; |
| 79 | } |