brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 44642ff Raw
42 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8 9// UNSUPPORTED: c++03, c++11, c++1410 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 20namespace ex = std::experimental::parallelism_v2;21 22template <class T, std::size_t>23struct 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 38int main(int, char**) {39  test_all_simd_abi<CheckIsSimd>();40  return 0;41}42