ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
DetectorDescription
GeoModel
GeoSpecialShapes
GeoSpecialShapes
vec_parametrized_sincos.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
10
#ifndef VEC_PARAMETRIZED_SINCOS_H
11
#define VEC_PARAMETRIZED_SINCOS_H
12
13
#include "
CxxUtils/restrict.h
"
14
#include "
CxxUtils/vec.h
"
15
struct
vsincos_par
16
{
17
18
CxxUtils::vec<double, 4>
param_0
= {};
19
CxxUtils::vec<double, 4>
param_1
= {};
20
CxxUtils::vec<double, 4>
param_2
= {};
21
22
#if HAVE_FUNCTION_MULTIVERSIONING
23
#if defined(__x86_64__)
24
[[gnu::target(
"avx2"
)]]
25
void
26
eval
(
const
double
r
,
27
double
&
ATH_RESTRICT
sin_a,
28
double
&
ATH_RESTRICT
cos_a)
const
ATH_RESTRICT
29
{
30
const
double
r2 =
r
*
r
;
31
CxxUtils::vec<double, 4>
P
= r2 *
param_0
+
param_1
;
32
P
= r2 *
P
+
param_2
;
33
CxxUtils::vec<double, 4>
P2 = {
P
[1],
P
[0],
P
[3],
P
[2]};
34
CxxUtils::vec<double, 4>
res
=
r
* P2 +
P
;
35
sin_a =
res
[0];
36
cos_a =
res
[2];
37
}
38
39
[[gnu::target(
"default"
)]]
40
#endif
// x86
41
#endif
// FMV
42
43
void
44
eval
(
const
double
r
,
45
double
&
ATH_RESTRICT
sin_a,
46
double
&
ATH_RESTRICT
cos_a)
const
47
#ifndef __CLING__
48
ATH_RESTRICT
49
#endif
50
{
51
const
double
r2 =
r
*
r
;
52
CxxUtils::vec<double, 4>
P
= r2 *
param_0
+
param_1
;
53
P
= r2 *
P
+
param_2
;
54
sin_a =
r
*
P
[1] +
P
[0];
55
cos_a =
r
*
P
[3] +
P
[2];
56
}
57
};
58
59
#endif
res
std::pair< std::vector< unsigned int >, bool > res
Definition
JetGroupProductTest.cxx:11
P
static Double_t P(Double_t *tt, Double_t *par)
Definition
LArPhysWaveHECTool.cxx:280
r
int r
Definition
globals.cxx:22
CxxUtils::vec
typename vecDetail::vec_typedef< T, N >::type vec
Define a nice alias for the vectorized type.
Definition
vec.h:207
restrict.h
Macro wrapping the nonstandard restrict keyword.
ATH_RESTRICT
#define ATH_RESTRICT
Definition
restrict.h:31
vsincos_par
vectorized version of parametrized sincos see ATLASSIM-4753 for details
Definition
vec_parametrized_sincos.h:16
vsincos_par::eval
void eval(const double r, double &ATH_RESTRICT sin_a, double &ATH_RESTRICT cos_a) const ATH_RESTRICT
Definition
vec_parametrized_sincos.h:44
vsincos_par::param_1
CxxUtils::vec< double, 4 > param_1
Definition
vec_parametrized_sincos.h:19
vsincos_par::param_0
CxxUtils::vec< double, 4 > param_0
Definition
vec_parametrized_sincos.h:18
vsincos_par::param_2
CxxUtils::vec< double, 4 > param_2
Definition
vec_parametrized_sincos.h:20
vec.h
Vectorization helpers.
Generated on
for ATLAS Offline Software by
1.17.0