ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
vc_aos_types.hpp
1// This file is part of the ACTS project.
2//
3// Copyright (C) 2016 CERN for the benefit of the ACTS project
4//
5// This Source Code Form is subject to the terms of the Mozilla Public
6// License, v. 2.0. If a copy of the MPL was not distributed with this
7// file, You can obtain one at https://mozilla.org/MPL/2.0/.
8
9#pragma once
10
11// Project include(s).
12#include "algebra/impl/vc_aos_approximately_equal.hpp"
13#include "algebra/impl/vc_aos_concepts.hpp"
14#include "algebra/impl/vc_aos_getter.hpp"
15#include "algebra/impl/vc_aos_transform3.hpp"
16#include "detray/algebra/common/matrix.hpp"
17#include "detray/algebra/common/vector.hpp"
18#include "detray/algebra/concepts.hpp"
19#include "detray/algebra/type_traits.hpp"
20
21// System include(s).
22#include <array>
23#include <cstddef>
24
25// Vc include(s).
26#ifdef _MSC_VER
27#pragma warning(push, 0)
28#endif // MSVC
29#include <Vc/Vc>
30#ifdef _MSC_VER
31#pragma warning(pop)
32#endif // MSVC
33
34namespace detray {
35
36namespace algebra::vc_aos {
37
39using index_type = std::size_t;
41template <concepts::value T>
42using value_type = T;
44template <concepts::value T>
45using scalar_type = T;
47template <concepts::value T, index_type N>
48using storage_type = Vc::SimdArray<T, N>;
50template <concepts::value T>
51using value_type = T;
53template <concepts::value T>
54using scalar_type = T;
56template <concepts::value T, std::size_t N>
57using vector_type = algebra::storage::vector<N, T, storage_type>;
59template <concepts::value T, index_type ROWS, index_type COLS>
60using matrix_type = algebra::storage::matrix<storage_type, T, ROWS, COLS>;
61
63template <concepts::value T>
64using vector2 = vector_type<T, 2>;
66template <concepts::value T>
67using point2 = vector2<T>;
69template <concepts::value T>
70using vector3 = vector_type<T, 3>;
72template <concepts::value T>
73using point3 = vector3<T>;
75template <concepts::value T>
76using vector6 = vector_type<T, 6>;
78template <concepts::value T>
79using vector8 = vector_type<T, 8>;
80
82template <concepts::value T>
83using transform3 = vc_aos::math::transform3<vc_aos::storage_type, T>;
84
86using element_getter = algebra::storage::element_getter;
88using block_getter = algebra::storage::block_getter;
89
90} // namespace algebra::vc_aos
91
92DETRAY_ALGEBRA_DEFINE_TYPE_TRAITS(algebra::vc_aos)
93
94namespace traits {
95
97template <typename T, auto N>
98struct index<algebra::vc_aos::storage_type<T, N>> {
100 using type = algebra::vc_aos::index_type;
101};
102
104template <typename T, auto N>
105struct index<Vc_1::Vector<T, Vc_1::simd_abi::fixed_size<N>>> {
107 using type = algebra::vc_aos::index_type;
108};
109
111template <typename T, auto N>
112struct value<algebra::vc_aos::storage_type<T, N>> {
114 using type = T;
115};
116
118template <typename T, auto N>
119struct value<Vc_1::Vector<T, Vc_1::simd_abi::fixed_size<N>>> {
121 using type = T;
122};
123
124// Vector and storage types are different
126template <typename T, auto N>
127struct dimensions<algebra::vc_aos::storage_type<T, N>> {
129 using index_type = algebra::vc_aos::index_type;
130
132 static constexpr index_type _dim{1};
134 static constexpr index_type _rows{N};
136 static constexpr index_type _columns{1};
137};
138
139// Vector and storage types are different
141template <typename T, auto N>
142struct dimensions<Vc_1::Vector<T, Vc_1::simd_abi::fixed_size<N>>> {
144 using index_type = algebra::vc_aos::index_type;
145
147 static constexpr index_type _dim{1};
149 static constexpr index_type _rows{N};
151 static constexpr index_type _columns{1};
152};
153
154} // namespace traits
155
156} // namespace detray
constexpr double T
Magnetic field, native unit (eV*s)/(e*m²).
Definition Units.hpp:168
Detray include(s).
Definition array_operators.hpp:18
static constexpr index_type _columns
Number of vector columns.
Definition vc_aos_types.hpp:151
algebra::vc_aos::index_type index_type
Index type used for the vector dimensions.
Definition vc_aos_types.hpp:144
static constexpr index_type _dim
Number of logical dimensions represented by the vector.
Definition vc_aos_types.hpp:147
static constexpr index_type _rows
Number of vector components.
Definition vc_aos_types.hpp:149
algebra::vc_aos::index_type index_type
Index type used for the storage dimensions.
Definition vc_aos_types.hpp:129
static constexpr index_type _columns
Number of storage columns.
Definition vc_aos_types.hpp:136
static constexpr index_type _rows
Number of stored vector components.
Definition vc_aos_types.hpp:134
static constexpr index_type _dim
Number of logical dimensions represented by the storage.
Definition vc_aos_types.hpp:132
Matrix dimensions.
Definition type_traits.hpp:82
algebra::vc_aos::index_type type
Index type used by the Vc AoS backend.
Definition vc_aos_types.hpp:107
algebra::vc_aos::index_type type
Index type used by the Vc AoS backend.
Definition vc_aos_types.hpp:100
Matrix traits.
Definition type_traits.hpp:26
T type
Scalar element type carried by the Vc vector.
Definition vc_aos_types.hpp:121
T type
Scalar element type carried by the Vc array.
Definition vc_aos_types.hpp:114
Value type that is used with the matrix (e.g.
Definition type_traits.hpp:35