1 #ifndef _COMPADRE_GMLS_APPLY_TARGET_EVALUATIONS_HPP_ 2 #define _COMPADRE_GMLS_APPLY_TARGET_EVALUATIONS_HPP_ 12 #if defined(COMPADRE_USE_CUDA) 59 Kokkos::parallel_for(Kokkos::TeamThreadRange(teamMember,
63 const int m_neighbor_offset = i+m*this->
getNNeighbors(target_index);
64 Kokkos::parallel_reduce(Kokkos::ThreadVectorRange(teamMember,
_basis_multiplier*target_NP),
65 [=] (
int& l,
double& t_alpha_ij) {
66 t_alpha_ij += P_target_row(offset_index_jmke, l)*Q(l, m_neighbor_offset);
69 &&
"NaN in P_target_row matrix.");
71 &&
"NaN in Q coefficient matrix.");
75 Kokkos::parallel_reduce(Kokkos::ThreadVectorRange(teamMember,
_basis_multiplier*target_NP),
76 [=] (
int& l,
double& t_alpha_ij) {
77 t_alpha_ij += P_target_row(offset_index_jmke, l)*Q(l,i);
80 &&
"NaN in P_target_row matrix.");
82 &&
"NaN in Q coefficient matrix.");
86 Kokkos::single(Kokkos::PerThread(teamMember), [=] () {
88 _alphas(alphas_index+i) = alpha_ij;
114 Kokkos::parallel_reduce(Kokkos::TeamThreadRange(teamMember,
118 talpha_ij += P_target_row(offset_index_jmke, l)*Q(l, i+m*this->
getNNeighbors(target_index));
121 &&
"NaN in P_target_row matrix.");
123 &&
"NaN in Q coefficient matrix.");
127 talpha_ij += P_target_row(offset_index_jmke, l)*Q(l, i);
130 &&
"NaN in P_target_row matrix.");
132 &&
"NaN in Q coefficient matrix.");
138 Kokkos::single(Kokkos::PerTeam(teamMember), [&] () {
139 this_alphas(offset_index_jmke,i) = alpha_ij;
149 teamMember.team_barrier();
Kokkos::View< int * > _lro_input_tile_size
dimensions ^ rank of tensor of output for each sampling functional (device)
Kokkos::View< double *, layout_right > _alphas
generated alpha coefficients (device)
KOKKOS_INLINE_FUNCTION int getNumberOfNeighborsDevice(int target_index) const
Get number of neighbors for a given target (device)
std::size_t global_index_type
Kokkos::View< TargetOperation * > _operations
vector containing target functionals to be applied for reconstruction problem (device) ...
int _max_evaluation_sites_per_target
maximum number of evaluation sites for each target (includes target site)
team_policy::member_type member_type
#define compadre_kernel_assert_extreme_debug(condition)
int _total_alpha_values
used for sizing P_target_row and the _alphas view
int _sampling_multiplier
actual dimension of the sampling functional e.g.
NeighborLists< Kokkos::View< int * > > _neighbor_lists
Accessor to get neighbor list data, offset data, and number of neighbors per target.
Kokkos::View< int * > _lro_output_tile_size
dimensions ^ rank of tensor of output for each target functional (device)
KOKKOS_INLINE_FUNCTION int getNNeighbors(const int target_index) const
Returns number of neighbors for a particular target.
KOKKOS_INLINE_FUNCTION int getNEvaluationSitesPerTarget(const int target_index) const
(OPTIONAL) Returns number of additional evaluation sites for a particular target
#define TO_GLOBAL(variable)
int _initial_index_for_batch
initial index for current batch
KOKKOS_INLINE_FUNCTION int getTargetOffsetIndexDevice(const int lro_num, const int input_component, const int output_component, const int additional_evaluation_local_index=0) const
Handles offset from operation input/output + extra evaluation sites.
Kokkos::View< double **, layout_right, Kokkos::MemoryTraits< Kokkos::Unmanaged > > scratch_matrix_right_type
Kokkos::View< double *, Kokkos::MemoryTraits< Kokkos::Unmanaged > > scratch_vector_type
int _added_alpha_size
additional alpha coefficients due to constraints
int _basis_multiplier
dimension of the reconstructed function e.g.
KOKKOS_INLINE_FUNCTION global_index_type getAlphaIndexDevice(const int target_index, const int alpha_column_offset) const
Gives index into alphas given two axes, which when incremented by the neighbor number transforms acce...
KOKKOS_INLINE_FUNCTION void applyTargetsToCoefficients(const member_type &teamMember, scratch_vector_type t1, scratch_vector_type t2, scratch_matrix_right_type Q, scratch_vector_type w, scratch_matrix_right_type P_target_row, const int target_NP) const
Helper function for applying the evaluations from a target functional to the polynomial coefficients...