PACMAN
0.1.0
Portable Algorithms for Coupling, Mapping, and Adaptive iNterpolation
Toggle main menu visibility
Loading...
Searching...
No Matches
getters.hpp
Go to the documentation of this file.
1
//
2
// This file is subject to the terms and conditions defined in
3
// file 'LICENSE', which is part of this source code package.
4
//
5
6
#pragma once
7
8
#include <Kokkos_Core.hpp>
9
10
#include "
common/concepts.hpp
"
11
#include "
common/types.hpp
"
12
#include "
utils/utils.hpp
"
13
14
namespace
PACMAN
{
15
namespace
RbfPum
{
16
29
template
<KokkosViewRank<1> AsViewType, KokkosViewRank<1> OffsViewType>
30
KOKKOS_FORCEINLINE_FUNCTION
auto
31
GetRbfMatrix
(
const
index_t
&k,
const
AsViewType &As,
const
OffsViewType &offs,
32
const
int_t
&n,
const
int_t
&m) {
33
using
DataType =
typename
AsViewType::non_const_value_type;
34
using
MemorySpace =
typename
AsViewType::memory_space;
35
const
auto
slice = Kokkos::make_pair(offs(k), offs(k + 1));
36
auto
A_data = Kokkos::subview(As, slice);
37
return
Kokkos::View<DataType **, MemorySpace,
38
Kokkos::MemoryTraits<Kokkos::Unmanaged>>(A_data.data(), n,
39
m);
40
}
41
56
template
<KokkosViewRank<1> PsViewType, KokkosViewRank<1> OffsViewType,
57
KokkosArray AxisType>
58
KOKKOS_FORCEINLINE_FUNCTION
auto
59
GetPolyMatrix
(
const
index_t
&k,
const
PsViewType &Ps,
const
OffsViewType &offs,
60
const
int_t
&n,
const
AxisType &activeAxis) {
61
using
DataType =
typename
PsViewType::non_const_value_type;
62
using
MemorySpace =
typename
PsViewType::memory_space;
63
const
int_t
N = offs(k + 1) - offs(k);
64
int_t
M = activeAxis.size() + 1;
65
const
auto
slice = Kokkos::make_pair(offs(k) * M, offs(k + 1) * M);
66
auto
P_data = Kokkos::subview(Ps, slice);
67
M = 1;
68
for
(
int_t
d = 0; d < activeAxis.size(); ++d) {
69
if
(activeAxis[d]) {
70
++M;
71
}
72
}
73
74
return
Kokkos::View<DataType **, MemorySpace,
75
Kokkos::MemoryTraits<Kokkos::Unmanaged>>(P_data.data(), n,
76
M);
77
}
78
90
template
<KokkosViewRank<1> BsViewType, KokkosViewRank<1> OffsViewType>
91
KOKKOS_FORCEINLINE_FUNCTION
auto
92
GetRbfVector
(
const
index_t
&k,
const
BsViewType &Bs,
const
OffsViewType &offs,
93
const
int_t
&n) {
94
using
DataType =
typename
BsViewType::non_const_value_type;
95
using
MemorySpace =
typename
BsViewType::memory_space;
96
const
auto
slice = Kokkos::make_pair(offs(k), offs(k + 1));
97
auto
B_data = Kokkos::subview(Bs, slice);
98
return
Kokkos::View<DataType *, MemorySpace,
99
Kokkos::MemoryTraits<Kokkos::Unmanaged>>(B_data.data(),
100
n);
101
}
102
103
}
// namespace RbfPum
104
}
// namespace PACMAN
concepts.hpp
PACMAN::RbfPum
Definition
callbacks.hpp:17
PACMAN::RbfPum::GetPolyMatrix
KOKKOS_FORCEINLINE_FUNCTION auto GetPolyMatrix(const index_t &k, const PsViewType &Ps, const OffsViewType &offs, const int_t &n, const AxisType &activeAxis)
Returns a matrix of rank 2, shaped as (n, m), using the given data view, team rank,...
Definition
getters.hpp:59
PACMAN::RbfPum::GetRbfVector
KOKKOS_FORCEINLINE_FUNCTION auto GetRbfVector(const index_t &k, const BsViewType &Bs, const OffsViewType &offs, const int_t &n)
Returns a vector view of rank 1, of length n, using the given data view, team rank,...
Definition
getters.hpp:92
PACMAN::RbfPum::GetRbfMatrix
KOKKOS_FORCEINLINE_FUNCTION auto GetRbfMatrix(const index_t &k, const AsViewType &As, const OffsViewType &offs, const int_t &n, const int_t &m)
Returns a matrix of rank 2, shaped as (n, m), using the given data view, team rank,...
Definition
getters.hpp:31
PACMAN
Definition
concepts.hpp:14
PACMAN::index_t
uint32_t index_t
Definition
types.hpp:20
PACMAN::int_t
int32_t int_t
Definition
types.hpp:18
types.hpp
utils.hpp
src
rbf_pum
solver
utils
getters.hpp
Generated on
for PACMAN by
1.17.0