| 1 | //===----------------------------------------------------------------------===// |
| 2 | // |
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
| 9 | // UNSUPPORTED: c++03, c++11, c++14 |
| 10 | |
| 11 | // <experimental/simd> |
| 12 | // |
| 13 | // [simd.traits] |
| 14 | // template <class T> struct ex::is_simd; |
| 15 | // template <class T> inline constexpr bool ex::is_simd_v = |
| 16 | // ex::is_simd<T>::value; |
| 17 | |
| 18 | #include "../test_utils.h" |
| 19 | |
| 20 | namespace ex = std::experimental::parallelism_v2; |
| 21 | |
| 22 | template <class T, std::size_t> |
| 23 | struct CheckIsSimd { |
| 24 | template <class SimdAbi> |
| 25 | void operator()() { |
| 26 | static_assert(ex::is_simd<ex::simd<T, SimdAbi>>::value); |
| 27 | |
| 28 | static_assert(!ex::is_simd<T>::value); |
| 29 | static_assert(!ex::is_simd<ex::simd_mask<T, SimdAbi>>::value); |
| 30 | |
| 31 | static_assert(ex::is_simd_v<ex::simd<T, SimdAbi>>); |
| 32 | |
| 33 | static_assert(!ex::is_simd_v<T>); |
| 34 | static_assert(!ex::is_simd_v<ex::simd_mask<T, SimdAbi>>); |
| 35 | } |
| 36 | }; |
| 37 | |
| 38 | int main(int, char**) { |
| 39 | test_all_simd_abi<CheckIsSimd>(); |
| 40 | return 0; |
| 41 | } |
| 42 | |