Skip to content

Commit 292f495

Browse files
committed
fewer DEVICE_FORCEINLINE
1 parent 570ea73 commit 292f495

4 files changed

Lines changed: 48 additions & 48 deletions

File tree

DiFfRG/include/DiFfRG/common/complex_math.hh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ namespace DiFfRG
121121
return res;
122122
}
123123
template <size_t N, typename T>
124-
KOKKOS_FORCEINLINE_FUNCTION auto operator*(const complex<double> x, const autodiff::Real<N, T> y)
124+
KOKKOS_FORCEINLINE_FUNCTION auto operator*(const complex<double> &x, const autodiff::Real<N, T> &y)
125125
{
126126
cxReal<N, T> res;
127127
autodiff::detail::For<0, N + 1>([&](auto i) constexpr { res[i] = x * y[i]; });
@@ -137,7 +137,7 @@ namespace DiFfRG
137137
return res;
138138
}
139139
template <size_t N, typename T>
140-
KOKKOS_FORCEINLINE_FUNCTION auto operator+(const complex<double> x, const autodiff::Real<N, T> y)
140+
KOKKOS_FORCEINLINE_FUNCTION auto operator+(const complex<double> &x, const autodiff::Real<N, T> &y)
141141
{
142142
cxReal<N, T> res;
143143
res[0] = x + y[0];
@@ -154,7 +154,7 @@ namespace DiFfRG
154154
return res;
155155
}
156156
template <size_t N, typename T>
157-
KOKKOS_FORCEINLINE_FUNCTION auto operator-(const complex<double> x, const autodiff::Real<N, T> y)
157+
KOKKOS_FORCEINLINE_FUNCTION auto operator-(const complex<double> &x, const autodiff::Real<N, T> &y)
158158
{
159159
cxReal<N, T> res;
160160
res[0] = x - y[0];
@@ -170,7 +170,7 @@ namespace DiFfRG
170170
return res;
171171
}
172172
template <size_t N, typename T>
173-
KOKKOS_FORCEINLINE_FUNCTION auto operator/(const complex<double> x, const autodiff::Real<N, T> y)
173+
KOKKOS_FORCEINLINE_FUNCTION auto operator/(const complex<double> &x, const autodiff::Real<N, T> &y)
174174
{
175175
cxReal<N, T> ux(x);
176176
cxReal<N, T> uy(y);

DiFfRG/include/DiFfRG/discretization/coordinates/combined_coordinates.hh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ namespace DiFfRG
5959
* @param y physical coordinate
6060
* @return double grid coordinate
6161
*/
62-
std::tuple<Idx, NT> KOKKOS_FORCEINLINE_FUNCTION backward(const NT m, const NT p) const
62+
std::tuple<Idx, NT> KOKKOS_FUNCTION backward(const NT m, const NT p) const
6363
{
6464
Idx m_idx = matsubara_values.backward(m);
6565
NT p_idx = 0;
@@ -76,7 +76,7 @@ namespace DiFfRG
7676
return {m_idx, p_idx};
7777
}
7878

79-
device::array<size_t, 2> KOKKOS_FORCEINLINE_FUNCTION from_linear_index(auto i) const
79+
device::array<size_t, 2> KOKKOS_INLINE_FUNCTION from_linear_index(auto i) const
8080
{
8181
device::array<size_t, 2> idx;
8282
// calculate the index for each coordinate system
@@ -154,7 +154,7 @@ namespace DiFfRG
154154
* @param y physical coordinate
155155
* @return double grid coordinate
156156
*/
157-
std::tuple<Idx, NT> KOKKOS_FORCEINLINE_FUNCTION backward(const NT m, const NT p) const
157+
std::tuple<Idx, NT> KOKKOS_FUNCTION backward(const NT m, const NT p) const
158158
{
159159
Idx m_idx = matsubara_values.backward(m);
160160
NT p_idx = 0;
@@ -171,7 +171,7 @@ namespace DiFfRG
171171
return {m_idx, p_idx};
172172
}
173173

174-
device::array<size_t, 2> KOKKOS_FORCEINLINE_FUNCTION from_linear_index(auto i) const
174+
device::array<size_t, 2> KOKKOS_INLINE_FUNCTION from_linear_index(auto i) const
175175
{
176176
device::array<size_t, 2> idx;
177177
// calculate the index for each coordinate system

DiFfRG/include/DiFfRG/discretization/coordinates/coordinates.hh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ namespace DiFfRG
101101
return sizes;
102102
}
103103

104-
device::array<size_t, sizeof...(Coordinates)> KOKKOS_FORCEINLINE_FUNCTION from_linear_index(size_t s) const
104+
device::array<size_t, sizeof...(Coordinates)> KOKKOS_INLINE_FUNCTION from_linear_index(size_t s) const
105105
{
106106
device::array<size_t, sizeof...(Coordinates)> idx;
107107
// calculate the index for each coordinate system
@@ -166,7 +166,7 @@ namespace DiFfRG
166166

167167
size_t KOKKOS_FORCEINLINE_FUNCTION size() const { return m_size; }
168168

169-
device::array<size_t, dim> KOKKOS_FORCEINLINE_FUNCTION from_linear_index(size_t s) const
169+
device::array<size_t, dim> KOKKOS_INLINE_FUNCTION from_linear_index(size_t s) const
170170
{
171171
device::array<size_t, dim> result{};
172172
// we do it for m_sizes
@@ -185,7 +185,7 @@ namespace DiFfRG
185185
return forward({{i...}});
186186
}
187187

188-
template <typename IT> KOKKOS_FORCEINLINE_FUNCTION device::array<ctype, dim> forward(device::array<IT, dim> i) const
188+
template <typename IT> KOKKOS_INLINE_FUNCTION device::array<ctype, dim> forward(device::array<IT, dim> i) const
189189
{
190190
for (size_t j = 0; j < dim; ++j) {
191191
i[j] += offsets[j];
@@ -198,7 +198,7 @@ namespace DiFfRG
198198
static_assert(sizeof...(I) == dim);
199199
return backward({{i...}});
200200
}
201-
KOKKOS_FORCEINLINE_FUNCTION device::array<ctype, dim> backward(device::array<size_t, dim> i) const
201+
KOKKOS_INLINE_FUNCTION device::array<ctype, dim> backward(device::array<size_t, dim> i) const
202202
{
203203
auto result = Base::backward(i);
204204
for (size_t j = 0; j < dim; ++j) {

0 commit comments

Comments
 (0)