alpaka
Abstraction Library for Parallel Kernel Acceleration
Loading...
Searching...
No Matches
include
alpaka
simd
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
21
namespace
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>
38
constexpr
bool
isSimd_v
=
trait::IsSimd<T>::value
;
39
40
template
<
typename
T>
41
constexpr
bool
isSimdMask_v
=
trait::IsSimdMask<T>::value
;
42
43
namespace
concepts
44
{
45
template
<
typename
T>
46
concept
Simd
=
isSimd_v<T>
;
47
48
template
<
typename
T>
49
concept
SimdMask
=
isSimdMask_v<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
alpaka::concepts::SimdMask
Definition
concepts.hpp:49
alpaka::concepts::SimdOrConvertibleType
Definition
concepts.hpp:58
alpaka::concepts::SimdOrScalar
Definition
concepts.hpp:52
alpaka::concepts::Simd
Definition
concepts.hpp:46
alpaka::concepts::TypeOrSimd
Definition
concepts.hpp:55
alpaka::concepts
Definition
api.hpp:32
alpaka::trait
Definition
api.hpp:21
alpaka
main alpaka namespace.
Definition
alpaka.hpp:76
alpaka::isSimd_v
constexpr bool isSimd_v
Definition
concepts.hpp:38
alpaka::isSimdMask_v
constexpr bool isSimdMask_v
Definition
concepts.hpp:41
alpaka::trait::IsSimdMask
Definition
concepts.hpp:32
alpaka::trait::IsSimd
Definition
concepts.hpp:27
Generated on
for alpaka by
1.16.1