1 #ifndef _COMPADRE_EVALUATOR_HPP_
2 #define _COMPADRE_EVALUATOR_HPP_
11 template<
typename T,
typename T2,
typename T3=
void>
18 SubviewND(T data_in, T2 data_original_view,
bool scalar_as_vector_if_needed) {
24 auto get1DView(
const int column_num) -> decltype(Kokkos::subview(
_data_in, Kokkos::ALL, column_num)) {
27 &&
"Subview asked for column > second dimension of input data.");
29 if ((
size_t)column_num<
_data_in.extent(1))
30 return Kokkos::subview(
_data_in, Kokkos::ALL, column_num);
32 return Kokkos::subview(
_data_in, Kokkos::ALL, 0);
35 auto get2DView(
const int column_num,
const int block_size) -> decltype(Kokkos::subview(
_data_in, Kokkos::ALL,
36 Kokkos::make_pair(column_num*block_size, (column_num+1)*block_size))) {
39 &&
"Subview asked for column > second dimension of input data.");
41 if ((
size_t)((column_num+1)*block_size-1)<
_data_in.extent(1)) {
42 return Kokkos::subview(
_data_in, Kokkos::ALL, Kokkos::make_pair(column_num*block_size, (column_num+1)*block_size));
45 return Kokkos::subview(
_data_in, Kokkos::ALL, Kokkos::make_pair(0,block_size));
58 template<
typename T,
typename T2>
66 SubviewND(T data_in, T2 data_original_view,
bool scalar_as_vector_if_needed) {
77 compadre_assert_debug((column_num==0) &&
"Subview asked for column column_num!=0, but _data_in is rank 1.");
79 return Kokkos::subview(
_data_in, Kokkos::ALL);
82 auto get2DView(
const int column_num,
const int block_size) -> decltype(Kokkos::subview(
_data_in, Kokkos::ALL)) {
84 return Kokkos::subview(
_data_in, Kokkos::ALL);
102 auto sampling_input_data_device = Kokkos::create_mirror_view(
104 Kokkos::deep_copy(sampling_input_data_device, sampling_input_data_host_or_device);
108 sampling_input_data_host_or_device, scalar_as_vector_if_needed);
147 template <
typename view_type_data>
148 double applyAlphasToDataSingleComponentSingleTargetSite(view_type_data sampling_input_data,
const int column_of_input,
TargetOperation lro,
const int target_index,
const int evaluation_site_local_index,
const int output_component_axis_1,
const int output_component_axis_2,
const int input_component_axis_1,
const int input_component_axis_2,
bool scalar_as_vector_if_needed =
true)
const {
153 output_component_axis_2, input_component_axis_1, input_component_axis_2, evaluation_site_local_index);
161 auto sampling_data_device = sampling_subview_maker.get1DView(column_of_input);
166 Kokkos::parallel_reduce(
"applyAlphasToData::Device",
167 Kokkos::RangePolicy<device_execution_space>(0,nla.getNumberOfNeighborsHost(target_index)),
168 KOKKOS_LAMBDA(
const int i,
double& t_value) {
170 t_value += sampling_data_device(nla.getNeighborDevice(target_index, i))
171 *alphas(alpha_index + i);
204 template <
typename view_type_data_out,
typename view_type_data_in>
205 void applyAlphasToDataSingleComponentAllTargetSitesWithPreAndPostTransform(view_type_data_out output_data_single_column, view_type_data_in sampling_data_single_column,
TargetOperation lro,
const SamplingFunctional sro,
const int evaluation_site_local_index,
const int output_component_axis_1,
const int output_component_axis_2,
const int input_component_axis_1,
const int input_component_axis_2,
const int pre_transform_local_index = -1,
const int pre_transform_global_index = -1,
const int post_transform_local_index = -1,
const int post_transform_global_index = -1,
bool vary_on_target =
false,
bool vary_on_neighbor =
false)
const {
208 output_component_axis_2, input_component_axis_1, input_component_axis_2, evaluation_site_local_index);
209 const int alpha_input_output_component_index2 = alpha_input_output_component_index;
212 auto gmls = *(
_gmls);
217 const int num_targets = nla.getNumberOfTargets();
220 compadre_assert_debug((std::is_same<typename view_type_data_out::memory_space, typename view_type_data_in::memory_space>::value) &&
221 "output_data_single_column view and input_data_single_column view have difference memory spaces.");
223 bool weight_with_pre_T = (pre_transform_local_index>=0 && pre_transform_global_index>=0) ?
true :
false;
227 Kokkos::parallel_for(
team_policy(num_targets, Kokkos::AUTO),
230 const int target_index = teamMember.league_rank();
231 teamMember.team_barrier();
234 const double previous_value = output_data_single_column(target_index);
237 auto alpha_index = gmls.getAlphaIndexDevice(target_index, alpha_input_output_component_index);
238 double gmls_value = 0;
239 Kokkos::parallel_reduce(Kokkos::TeamThreadRange(teamMember, nla.getNumberOfNeighborsDevice(target_index)), [=](
const int i,
double& t_value) {
240 const double neighbor_varying_pre_T = (weight_with_pre_T && vary_on_neighbor) ?
241 prestencil_weights(0, target_index, i, pre_transform_local_index, pre_transform_global_index)
244 t_value += neighbor_varying_pre_T * sampling_data_single_column(nla.getNeighborDevice(target_index, i))
245 *alphas(alpha_index + i);
251 if (weight_with_pre_T) {
252 if (!vary_on_neighbor && vary_on_target) {
253 pre_T = prestencil_weights(0, target_index, 0, pre_transform_local_index,
254 pre_transform_global_index);
255 }
else if (!vary_on_target) {
256 pre_T = prestencil_weights(0, 0, 0, pre_transform_local_index,
257 pre_transform_global_index);
261 double staggered_value_from_targets = 0;
262 double pre_T_staggered = 1.0;
263 auto alpha_index2 = gmls.getAlphaIndexDevice(target_index, alpha_input_output_component_index2);
265 if (target_plus_neighbor_staggered_schema) {
266 Kokkos::parallel_reduce(Kokkos::TeamThreadRange(teamMember, nla.getNumberOfNeighborsDevice(target_index)), [=](
const int i,
double& t_value) {
267 const double neighbor_varying_pre_T_staggered = (weight_with_pre_T && vary_on_neighbor) ?
268 prestencil_weights(1, target_index, i, pre_transform_local_index, pre_transform_global_index)
271 t_value += neighbor_varying_pre_T_staggered * sampling_data_single_column(nla.getNeighborDevice(target_index, 0))
272 *alphas(alpha_index2 + i);
274 }, staggered_value_from_targets );
277 if (weight_with_pre_T) {
278 if (!vary_on_neighbor && vary_on_target) {
279 pre_T_staggered = prestencil_weights(1, target_index, 0, pre_transform_local_index,
280 pre_transform_global_index);
281 }
else if (!vary_on_target) {
282 pre_T_staggered = prestencil_weights(1, 0, 0, pre_transform_local_index,
283 pre_transform_global_index);
288 double added_value = pre_T*gmls_value + pre_T_staggered*staggered_value_from_targets;
289 Kokkos::single(Kokkos::PerTeam(teamMember), [=] () {
290 output_data_single_column(target_index) = previous_value + added_value;
307 template <
typename view_type_data_out,
typename view_type_data_in>
315 const int num_targets = nla.getNumberOfTargets();
320 compadre_assert_debug((std::is_same<typename view_type_data_out::memory_space, typename view_type_data_in::memory_space>::value) &&
321 "output_data_single_column view and input_data_single_column view have difference memory spaces.");
324 Kokkos::parallel_for(
team_policy(num_targets, Kokkos::AUTO),
327 const int target_index = teamMember.league_rank();
331 global_dimensions, global_dimensions);
332 teamMember.team_barrier();
335 const double previous_value = output_data_single_column(target_index);
337 double added_value = T(local_dim_index, global_dim_index)*sampling_data_single_column(target_index);
338 Kokkos::single(Kokkos::PerTeam(teamMember), [=] () {
339 output_data_single_column(target_index) = previous_value + added_value;
359 template <
typename output_data_type =
double**,
typename output_memory_space,
typename view_type_input_data,
typename output_array_layout =
typename view_type_input_data::array_layout>
360 Kokkos::View<output_data_type, output_array_layout, output_memory_space>
368 typedef Kokkos::View<output_data_type, output_array_layout, output_memory_space> output_view_type;
386 output_view_type target_output = createView<output_view_type>(
"output of target operation",
387 nla.getNumberOfTargets(), output_dimensions);
390 compadre_assert_debug(((output_dimensions==1 && output_view_type::rank==1) || output_view_type::rank!=1) &&
391 "Output view is requested as rank 1, but the target requires a rank larger than 1. Try double** as template argument.");
402 bool vary_on_target =
false, vary_on_neighbor =
false;
403 auto sro_style = sro.transform_type;
404 bool loop_global_dimensions = sro.input_rank>0 && sro_style!=
Identity;
407 &&
"SamplingFunctional requested for Evaluator does not match GMLS data sampling functional or is not of type 'Identity'.");
410 vary_on_target =
false;
411 vary_on_neighbor =
false;
413 vary_on_target =
true;
414 vary_on_neighbor =
false;
416 vary_on_target =
true;
417 vary_on_neighbor =
true;
423 for (
int axes1=0; axes1<output_dimension1_of_operator; ++axes1) {
424 const int output_component_axis_1 = axes1;
425 for (
int axes2=0; axes2<output_dimension2_of_operator; ++axes2) {
426 const int output_component_axis_2 = axes2;
428 for (
int j=0; j<input_dimension_of_operator; ++j) {
429 const int input_component_axis_1 = j;
430 const int input_component_axis_2 = 0;
432 if (loop_global_dimensions) {
433 for (
int k=0; k<global_dimensions; ++k) {
435 output_subview_maker.get1DView(axes1*output_dimension2_of_operator+axes2),
436 sampling_subview_maker.get1DView(k), lro, sro,
437 evaluation_site_local_index, output_component_axis_1, output_component_axis_2, input_component_axis_1,
438 input_component_axis_2, j, k, -1, -1,
439 vary_on_target, vary_on_neighbor);
443 output_subview_maker.get1DView(axes1*output_dimension2_of_operator+axes2),
444 sampling_subview_maker.get1DView(j), lro, sro,
445 evaluation_site_local_index, output_component_axis_1, output_component_axis_2, input_component_axis_1,
446 input_component_axis_2, 0, 0, -1, -1,
447 vary_on_target, vary_on_neighbor);
450 output_subview_maker.get1DView(axes1*output_dimension2_of_operator+axes2),
451 sampling_subview_maker.get1DView(j), lro, sro,
452 evaluation_site_local_index, output_component_axis_1, output_component_axis_2, input_component_axis_1,
453 input_component_axis_2);
460 if (transform_gmls_output_to_ambient) {
464 output_view_type ambient_target_output = createView<output_view_type>(
465 "output of transform to ambient space", nla.getNumberOfTargets(),
469 for (
int i=0; i<global_dimensions; ++i) {
470 for (
int j=0; j<output_dimensions; ++j) {
472 transformed_output_subview_maker.get1DView(i), output_subview_maker.get1DView(j), j, i);
476 Kokkos::deep_copy(ambient_target_output, transformed_output_subview_maker.copyToAndReturnOriginalView());
477 return ambient_target_output;
481 Kokkos::deep_copy(target_output, output_subview_maker.copyToAndReturnOriginalView());
482 return target_output;
509 template <
typename view_type_data_out,
typename view_type_data_in>
510 void applyFullPolynomialCoefficientsBasisToDataSingleComponent(view_type_data_out output_data_block_column, view_type_data_in sampling_data_single_column,
const SamplingFunctional sro,
const int output_component_axis_1,
const int output_component_axis_2,
const int input_component_axis_1,
const int input_component_axis_2,
const int pre_transform_local_index = -1,
const int pre_transform_global_index = -1,
const int post_transform_local_index = -1,
const int post_transform_global_index = -1,
bool vary_on_target =
false,
bool vary_on_neighbor =
false)
const {
516 auto coefficient_memory_layout_dims_device =
517 Kokkos::create_mirror_view_and_copy(
device_memory_space(), coefficient_memory_layout_dims);
526 const int num_targets = nla.getNumberOfTargets();
529 compadre_assert_debug((std::is_same<typename view_type_data_out::memory_space, typename view_type_data_in::memory_space>::value) &&
530 "output_data_block_column view and input_data_single_column view have difference memory spaces.");
532 bool weight_with_pre_T = (pre_transform_local_index>=0 && pre_transform_global_index>=0) ?
true :
false;
536 for (
int j=0; j<coefficient_matrix_dims(0); ++j) {
537 Kokkos::parallel_for(
team_policy(num_targets, Kokkos::AUTO),
540 const int target_index = teamMember.league_rank();
544 global_dimensions, global_dimensions);
549 *
TO_GLOBAL(coefficient_memory_layout_dims_device(1)),
550 coefficient_memory_layout_dims_device(0), coefficient_memory_layout_dims_device(1));
552 teamMember.team_barrier();
555 const double previous_value = output_data_block_column(target_index, j);
558 double gmls_value = 0;
559 Kokkos::parallel_reduce(Kokkos::TeamThreadRange(teamMember, nla.getNumberOfNeighborsDevice(target_index)), [=](
const int i,
double& t_value) {
560 const double neighbor_varying_pre_T = (weight_with_pre_T && vary_on_neighbor) ?
561 prestencil_weights(0, target_index, i, pre_transform_local_index, pre_transform_global_index)
564 t_value += neighbor_varying_pre_T * sampling_data_single_column(nla.getNeighborDevice(target_index, i))
565 *Coeffs(j, i+input_component_axis_1*nla.getNumberOfNeighborsDevice(target_index));
571 if (weight_with_pre_T) {
572 if (!vary_on_neighbor && vary_on_target) {
573 pre_T = prestencil_weights(0, target_index, 0, pre_transform_local_index,
574 pre_transform_global_index);
575 }
else if (!vary_on_target) {
576 pre_T = prestencil_weights(0, 0, 0, pre_transform_local_index,
577 pre_transform_global_index);
581 double staggered_value_from_targets = 0;
582 double pre_T_staggered = 1.0;
584 if (target_plus_neighbor_staggered_schema) {
585 Kokkos::parallel_reduce(Kokkos::TeamThreadRange(teamMember, nla.getNumberOfNeighborsDevice(target_index)), [=](
const int i,
double& t_value) {
586 const double neighbor_varying_pre_T_staggered = (weight_with_pre_T && vary_on_neighbor) ?
587 prestencil_weights(1, target_index, i, pre_transform_local_index, pre_transform_global_index)
590 t_value += neighbor_varying_pre_T_staggered * sampling_data_single_column(nla.getNeighborDevice(target_index, 0))
591 *Coeffs(j, i+input_component_axis_1*nla.getNumberOfNeighborsDevice(target_index));
593 }, staggered_value_from_targets );
596 if (weight_with_pre_T) {
597 if (!vary_on_neighbor && vary_on_target) {
598 pre_T_staggered = prestencil_weights(1, target_index, 0, pre_transform_local_index,
599 pre_transform_global_index);
600 }
else if (!vary_on_target) {
601 pre_T_staggered = prestencil_weights(1, 0, 0, pre_transform_local_index,
602 pre_transform_global_index);
607 double added_value = (pre_T*gmls_value + pre_T_staggered*staggered_value_from_targets);
608 Kokkos::single(Kokkos::PerTeam(teamMember), [=] () {
609 output_data_block_column(target_index, j) = previous_value + added_value;
628 template <
typename output_data_type =
double**,
typename output_memory_space,
typename view_type_input_data,
typename output_array_layout =
typename view_type_input_data::array_layout>
629 Kokkos::View<output_data_type, output_array_layout, output_memory_space>
636 typedef Kokkos::View<output_data_type, output_array_layout, output_memory_space> output_view_type;
647 int output_dimensions = output_dimension_of_reconstruction_space;
652 output_view_type coefficient_output(
"output coefficients", nla.getNumberOfTargets(),
656 compadre_assert_debug(((output_dimension_of_reconstruction_space==1 && output_view_type::rank==1) || output_view_type::rank!=1) &&
657 "Output view is requested as rank 1, but the target requires a rank larger than 1. Try double** as template argument.");
668 bool vary_on_target =
false, vary_on_neighbor =
false;
674 vary_on_target =
false;
675 vary_on_neighbor =
false;
677 vary_on_target =
true;
678 vary_on_neighbor =
false;
680 vary_on_target =
true;
681 vary_on_neighbor =
true;
686 for (
int i=0; i<output_dimension_of_reconstruction_space; ++i) {
687 const int output_component_axis_1 = i;
688 const int output_component_axis_2 = 0;
690 for (
int j=0; j<input_dimension_of_reconstruction_space; ++j) {
691 const int input_component_axis_1 = j;
692 const int input_component_axis_2 = 0;
694 if (loop_global_dimensions) {
695 for (
int k=0; k<global_dimensions; ++k) {
698 sampling_subview_maker.get1DView(k), sro,
699 output_component_axis_1, output_component_axis_2, input_component_axis_1,
700 input_component_axis_2, j, k, -1, -1,
701 vary_on_target, vary_on_neighbor);
706 sampling_subview_maker.get1DView(j), sro,
707 output_component_axis_1, output_component_axis_2, input_component_axis_1,
708 input_component_axis_2, 0, 0, -1, -1,
709 vary_on_target, vary_on_neighbor);
713 sampling_subview_maker.get1DView(j), sro,
714 output_component_axis_1, output_component_axis_2, input_component_axis_1,
715 input_component_axis_2);
721 Kokkos::deep_copy(coefficient_output, output_subview_maker.copyToAndReturnOriginalView());
722 return coefficient_output;
Kokkos::TeamPolicy< device_execution_space > team_policy
typename std::enable_if< B, T >::type enable_if_t
team_policy::member_type member_type
device_execution_space::memory_space device_memory_space
#define compadre_assert_debug(condition)
compadre_assert_debug is used for assertions that are checked in loops, as these significantly impact...
#define TO_GLOBAL(variable)
Kokkos::View< double **, layout_right, Kokkos::MemoryTraits< Kokkos::Unmanaged > > scratch_matrix_right_type
#define compadre_assert_release(condition)
compadre_assert_release is used for assertions that should always be checked, but generally are not e...
Lightweight Evaluator Helper This class is a lightweight wrapper for extracting and applying all rele...
void applyFullPolynomialCoefficientsBasisToDataSingleComponent(view_type_data_out output_data_block_column, view_type_data_in sampling_data_single_column, const SamplingFunctional sro, const int output_component_axis_1, const int output_component_axis_2, const int input_component_axis_1, const int input_component_axis_2, const int pre_transform_local_index=-1, const int pre_transform_global_index=-1, const int post_transform_local_index=-1, const int post_transform_global_index=-1, bool vary_on_target=false, bool vary_on_neighbor=false) const
Dot product of data with full polynomial coefficient basis where sampling data is in a 1D/2D Kokkos V...
Kokkos::View< output_data_type, output_array_layout, output_memory_space > applyAlphasToDataAllComponentsAllTargetSites(view_type_input_data sampling_data, TargetOperation lro, const SamplingFunctional sro_in=PointSample, bool scalar_as_vector_if_needed=true, const int evaluation_site_local_index=0) const
Transformation of data under GMLS.
void applyLocalChartToAmbientSpaceTransform(view_type_data_out output_data_single_column, view_type_data_in sampling_data_single_column, const int local_dim_index, const int global_dim_index) const
Postprocessing for manifolds.
double applyAlphasToDataSingleComponentSingleTargetSite(view_type_data sampling_input_data, const int column_of_input, TargetOperation lro, const int target_index, const int evaluation_site_local_index, const int output_component_axis_1, const int output_component_axis_2, const int input_component_axis_1, const int input_component_axis_2, bool scalar_as_vector_if_needed=true) const
Dot product of alphas with sampling data, FOR A SINGLE target_index, where sampling data is in a 1D/2...
void applyAlphasToDataSingleComponentAllTargetSitesWithPreAndPostTransform(view_type_data_out output_data_single_column, view_type_data_in sampling_data_single_column, TargetOperation lro, const SamplingFunctional sro, const int evaluation_site_local_index, const int output_component_axis_1, const int output_component_axis_2, const int input_component_axis_1, const int input_component_axis_2, const int pre_transform_local_index=-1, const int pre_transform_global_index=-1, const int post_transform_local_index=-1, const int post_transform_global_index=-1, bool vary_on_target=false, bool vary_on_neighbor=false) const
Dot product of alphas with sampling data where sampling data is in a 1D/2D Kokkos View and output vie...
Kokkos::View< output_data_type, output_array_layout, output_memory_space > applyFullPolynomialCoefficientsBasisToDataAllComponents(view_type_input_data sampling_data, bool scalar_as_vector_if_needed=true) const
Generation of polynomial reconstruction coefficients by applying to data in GMLS.
Generalized Moving Least Squares (GMLS)
int getAlphaColumnOffset(TargetOperation lro, const int output_component_axis_1, const int output_component_axis_2, const int input_component_axis_1, const int input_component_axis_2, const int additional_evaluation_local_index=0) const
Retrieves the offset for an operator based on input and output component, generic to row (but still m...
host_managed_local_index_type getPolynomialCoefficientsMemorySize() const
Returns 2D array size in memory on which coefficients are stored.
decltype(_RHS) getFullPolynomialCoefficientsBasis() const
Get a view (device) of all polynomial coefficients basis.
decltype(_T) getTangentDirections() const
Get a view (device) of all tangent direction bundles.
ReconstructionSpace getReconstructionSpace() const
Get the reconstruction space specified at instantiation.
int getPolynomialCoefficientsSize() const
Returns size of the basis used in instance's polynomial reconstruction.
decltype(_alphas) getAlphas() const
Get a view (device) of all alphas.
int getGlobalDimensions() const
Dimension of the GMLS problem's point data (spatial description of points in ambient space),...
global_index_type getAlphaIndexHost(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...
int calculateSamplingMultiplier(const ReconstructionSpace rs, const SamplingFunctional sro) const
Calculate sampling_multiplier.
int calculateBasisMultiplier(const ReconstructionSpace rs) const
Calculate basis_multiplier.
ProblemType getProblemType()
Get problem type.
decltype(_neighbor_lists) * getNeighborLists()
Get neighbor list accessor.
SamplingFunctional getDataSamplingFunctional() const
Get the data sampling functional specified at instantiation (often the same as the polynomial samplin...
SamplingFunctional getPolynomialSamplingFunctional() const
Get the polynomial sampling functional specified at instantiation.
host_managed_local_index_type getPolynomialCoefficientsDomainRangeSize() const
Returns (size of the basis used in instance's polynomial reconstruction) x (data input dimension)
int getOutputDimensionOfOperation(TargetOperation lro, bool ambient=false) const
Dimensions ^ output rank for target operation.
int getInputDimensionOfOperation(TargetOperation lro) const
Dimensions ^ input rank for target operation (always in local chart if on a manifold,...
decltype(_prestencil_weights) getPrestencilWeights() const
Get a view (device) of all rank 2 preprocessing tensors This is a rank 5 tensor that is able to provi...
@ MANIFOLD
Solve GMLS problem on a manifold (will use QR or SVD to solve the resultant GMLS problem dependent on...
auto CreateNDSliceOnDeviceView(T sampling_input_data_host_or_device, bool scalar_as_vector_if_needed) -> SubviewND< decltype(Kokkos::create_mirror_view(device_memory_space(), sampling_input_data_host_or_device)), T >
Copies data_in to the device, and then allows for access to 1D columns of data on device.
constexpr SamplingFunctional PointSample
Available sampling functionals.
TargetOperation
Available target functionals.
@ DifferentEachNeighbor
Each target applies a different transform for each neighbor.
@ DifferentEachTarget
Each target applies a different data transform, but the same to each neighbor.
@ SameForAll
Each neighbor for each target all apply the same transform.
@ Identity
No action performed on data before GMLS target operation.
constexpr SamplingFunctional ManifoldVectorPointSample
Point evaluations of the entire vector source function (but on a manifold, so it includes a transform...
constexpr SamplingFunctional VectorPointSample
Point evaluations of the entire vector source function.
constexpr int TargetOutputTensorRank[]
Rank of target functional output for each TargetOperation Rank of target functional input for each Ta...
int transform_type
Describes the SamplingFunction relationship to targets, neighbors.
bool use_target_site_weights
Whether or not the SamplingTensor acts on the target site as well as the neighbors.
int input_rank
Rank of sampling functional input for each SamplingFunctional.
auto get2DView(const int column_num, const int block_size) -> decltype(Kokkos::subview(_data_in, Kokkos::ALL))
bool _scalar_as_vector_if_needed
T2 copyToAndReturnOriginalView()
auto get1DView(const int column_num) -> decltype(Kokkos::subview(_data_in, Kokkos::ALL))
SubviewND(T data_in, T2 data_original_view, bool scalar_as_vector_if_needed)
Creates 1D subviews of data from a 2D view, generally constructed with CreateNDSliceOnDeviceView.
bool _scalar_as_vector_if_needed
SubviewND(T data_in, T2 data_original_view, bool scalar_as_vector_if_needed)
auto get2DView(const int column_num, const int block_size) -> decltype(Kokkos::subview(_data_in, Kokkos::ALL, Kokkos::make_pair(column_num *block_size,(column_num+1) *block_size)))
auto get1DView(const int column_num) -> decltype(Kokkos::subview(_data_in, Kokkos::ALL, column_num))
T2 copyToAndReturnOriginalView()