ATLAS Offline Software
Loading...
Searching...
No Matches
vec_parametrized_sincos.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 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"
16{
17
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;
32 P = r2 * P + param_2;
33 CxxUtils::vec<double, 4> P2 = {P[1], P[0], P[3], P[2]};
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 ATH_RESTRICT
47 {
48 const double r2 = r * r;
50 P = r2 * P + param_2;
51 sin_a = r * P[1] + P[0];
52 cos_a = r * P[3] + P[2];
53 }
54};
55
56#endif
std::pair< std::vector< unsigned int >, bool > res
static Double_t P(Double_t *tt, Double_t *par)
int r
Definition globals.cxx:22
typename vecDetail::vec_typedef< T, N >::type vec
Define a nice alias for the vectorized type.
Definition vec.h:207
Macro wrapping the nonstandard restrict keyword.
#define ATH_RESTRICT
Definition restrict.h:31
vectorized version of parametrized sincos see ATLASSIM-4753 for details
void eval(const double r, double &ATH_RESTRICT sin_a, double &ATH_RESTRICT cos_a) const ATH_RESTRICT
CxxUtils::vec< double, 4 > param_1
CxxUtils::vec< double, 4 > param_0
CxxUtils::vec< double, 4 > param_2
Vectorization helpers.