alpaka
Abstraction Library for Parallel Kernel Acceleration
Loading...
Searching...
No Matches
concepts.hpp
Go to the documentation of this file.
1/* Copyright 2025 René Widera
2 * SPDX-License-Identifier: MPL-2.0
3 */
4
5/** @file This file provides a basic implementation of a SIMD vector.
6 *
7 * The implementation is based on the class Vec:
8 * - the storage policy should become the native SIMD implementation e.g. std::simd
9 * - load/ store and simd specifics should be implemented in the storage policy
10 * - the name of storage policy should be changed
11 *
12 * The current operator operations rely on compilers auto vectorization.
13 */
14
15#pragma once
16
17#include <concepts>
18#include <cstdint>
19#include <type_traits>
20
21namespace alpaka
22{
23 namespace trait
24 {
25 template<typename T>
26 struct IsSimd : std::false_type
27 {
28 };
29
30 template<typename T>
31 struct IsSimdMask : std::false_type
32 {
33 };
34
35 } // namespace trait
36
37 template<typename T>
39
40 template<typename T>
42
43 namespace concepts
44 {
45 template<typename T>
46 concept Simd = isSimd_v<T>;
47
48 template<typename T>
50
51 template<typename T>
52 concept SimdOrScalar = (isSimd_v<T> || std::integral<T> || std::floating_point<T>);
53
54 template<typename T, typename T_RequiredComponent>
55 concept TypeOrSimd = (isSimd_v<T> || std::is_same_v<T, T_RequiredComponent>);
56
57 template<typename T, typename T_RequiredComponent>
58 concept SimdOrConvertibleType = (isSimd_v<T> || std::is_convertible_v<T, T_RequiredComponent>);
59 } // namespace concepts
60} // namespace alpaka
main alpaka namespace.
Definition alpaka.hpp:76
constexpr bool isSimd_v
Definition concepts.hpp:38
constexpr bool isSimdMask_v
Definition concepts.hpp:41