| 1 | // |
| 2 | // SPDX-FileCopyrightText: Copyright 2024 Arm Limited and/or its affiliates <open-source-office@arm.com> |
| 3 | // |
| 4 | // SPDX-License-Identifier: Apache-2.0 |
| 5 | // |
| 6 | |
| 7 | #include "test/common/float16.hpp" |
| 8 | |
| 9 | #include <iostream> |
| 10 | #include <type_traits> |
| 11 | |
| 12 | namespace kai::test { |
| 13 | |
| 14 | static_assert(sizeof(Float16) == 2); |
| 15 | |
| 16 | static_assert(std::is_trivially_destructible_v<Float16>); |
| 17 | static_assert(std::is_nothrow_destructible_v<Float16>); |
| 18 | |
| 19 | static_assert(std::is_trivially_copy_constructible_v<Float16>); |
| 20 | static_assert(std::is_trivially_copy_assignable_v<Float16>); |
| 21 | static_assert(std::is_trivially_move_constructible_v<Float16>); |
| 22 | static_assert(std::is_trivially_move_assignable_v<Float16>); |
| 23 | |
| 24 | static_assert(std::is_nothrow_copy_constructible_v<Float16>); |
| 25 | static_assert(std::is_nothrow_copy_assignable_v<Float16>); |
| 26 | static_assert(std::is_nothrow_move_constructible_v<Float16>); |
| 27 | static_assert(std::is_nothrow_move_assignable_v<Float16>); |
| 28 | |
| 29 | std::ostream& operator<<(std::ostream& os, Float16 value) { |
| 30 | return os << static_cast<float>(value); |
| 31 | } |
| 32 | |
| 33 | } // namespace kai::test |