1 #ifndef LINEAR_WEIGHTS_HPP
2 #define LINEAR_WEIGHTS_HPP
19 KOKKOS_INLINE_FUNCTION
LinearWeights(
double var,
double inv_d,
int i_max ){
20 set(var, inv_d, i_max);
24 KOKKOS_INLINE_FUNCTION
void set(
double var,
double inv_d ){
25 double var_over_d = var*inv_d;
26 i = floor(var_over_d);
28 w[1] = var_over_d -
i;
34 KOKKOS_INLINE_FUNCTION
void set(
double var,
double inv_d,
int i_max){
35 double var_over_d = var*inv_d;
36 i = floor(var_over_d);
39 w[1] = min(1.0,var_over_d -
i);
58 set(var, inv_d, i_max);
63 for(
int i_simd = 0; i_simd<SIMD_SIZE; i_simd++){
64 double var_over_d = var[i_simd]*inv_d;
65 i[i_simd] = floor(var_over_d);
67 w[1][i_simd] = var_over_d -
i[i_simd];
68 w[0][i_simd] = 1.0 -
w[1][i_simd];
75 for(
int i_simd = 0; i_simd<SIMD_SIZE; i_simd++){
76 double var_over_d = var[i_simd]*inv_d;
77 i[i_simd] = floor(var_over_d);
79 i[i_simd] = min(
i[i_simd],i_max-1);
80 w[1][i_simd] = min(1.0,var_over_d -
i[i_simd]);
81 w[0][i_simd] = 1.0 -
w[1][i_simd];
Simd< int > i
Definition: linear_weights.hpp:47
Definition: linear_weights.hpp:46
Definition: linear_weights.hpp:8
KOKKOS_INLINE_FUNCTION SimdLinearWeights()
Definition: linear_weights.hpp:50
KOKKOS_INLINE_FUNCTION SimdLinearWeights(Simd< double > var, double inv_d, int i_max)
Definition: linear_weights.hpp:57
KOKKOS_INLINE_FUNCTION LinearWeights()
Definition: linear_weights.hpp:12
Simd< double > w[2]
Definition: linear_weights.hpp:48
KOKKOS_INLINE_FUNCTION void set(double var, double inv_d)
Definition: linear_weights.hpp:24
KOKKOS_INLINE_FUNCTION SimdLinearWeights(Simd< double > var, double inv_d)
Definition: linear_weights.hpp:53
KOKKOS_INLINE_FUNCTION void set(Simd< double > var, double inv_d)
Definition: linear_weights.hpp:62
double w[2]
Definition: linear_weights.hpp:10
KOKKOS_INLINE_FUNCTION LinearWeights(double var, double inv_d, int i_max)
Definition: linear_weights.hpp:19
int i
Definition: linear_weights.hpp:9
KOKKOS_INLINE_FUNCTION LinearWeights(double var, double inv_d)
Definition: linear_weights.hpp:15
KOKKOS_INLINE_FUNCTION void set(double var, double inv_d, int i_max)
Definition: linear_weights.hpp:34
KOKKOS_INLINE_FUNCTION void set(Simd< double > var, double inv_d, int i_max)
Definition: linear_weights.hpp:74