/home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/physics/integration/finiteT/quadrature_integrator_fT.hh Source File#

DiFfRG: /home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/physics/integration/finiteT/quadrature_integrator_fT.hh Source File
DiFfRG
quadrature_integrator_fT.hh
Go to the documentation of this file.
1#pragma once
2
3// DiFfRG
13
14namespace DiFfRG
15{
16 template <int dim, typename NT, typename KERNEL, typename ExecutionSpace>
17 requires(dim > 0)
19 {
20 public:
24 using ctype = typename get_type::ctype<NT>;
28 using execution_space = ExecutionSpace;
29
34 static constexpr int sdim = dim - 1;
35
36 QuadratureIntegrator_fT(QuadratureProvider &quadrature_provider, const std::array<size_t, sdim> _grid_size,
37 std::array<ctype, sdim> grid_min, std::array<ctype, sdim> grid_max,
38 const std::array<QuadratureType, sdim> quadrature_type, const ctype T = 1,
39 const ctype typical_E = 1)
40 : quadrature_provider(quadrature_provider), T(T), typical_E(typical_E)
41 {
42 for (int d = 0; d < sdim; ++d)
43 grid_size[d] = _grid_size[d];
44 matsubara_nodes =
45 quadrature_provider.template matsubara_nodes<ctype, typename ExecutionSpace::memory_space>(T, typical_E);
46 matsubara_weights =
47 quadrature_provider.template matsubara_weights<ctype, typename ExecutionSpace::memory_space>(T, typical_E);
48 matsubara_sum_T = quadrature_provider.template matsubara_T<ctype>(T, typical_E);
49 for (int i = 0; i < sdim; ++i) {
50 nodes[i] = quadrature_provider.template nodes<ctype, typename ExecutionSpace::memory_space>(grid_size[i],
51 quadrature_type[i]);
52 weights[i] = quadrature_provider.template weights<ctype, typename ExecutionSpace::memory_space>(
53 grid_size[i], quadrature_type[i]);
54 }
55 set_grid_extents(grid_min, grid_max);
56 grid_size[dim - 1] = matsubara_nodes.size();
57 }
58
59 void set_grid_extents(const std::array<ctype, sdim> grid_min, const std::array<ctype, sdim> grid_max)
60 {
61 for (int d = 0; d < sdim; ++d) {
62 grid_extents[0][d] = grid_min[d];
63 grid_extents[1][d] = grid_max[d];
64 }
65 for (int i = 0; i < sdim; ++i) {
66 grid_start[i] = grid_extents[0][i];
67 grid_scale[i] = (grid_extents[1][i] - grid_extents[0][i]);
68 }
69 }
70
71 void set_T(const ctype T)
72 {
73 this->T = T;
74 matsubara_nodes =
75 quadrature_provider.template matsubara_nodes<ctype, typename ExecutionSpace::memory_space>(T, typical_E);
76 matsubara_weights =
77 quadrature_provider.template matsubara_weights<ctype, typename ExecutionSpace::memory_space>(T, typical_E);
78 matsubara_sum_T = quadrature_provider.template matsubara_T<ctype>(T, typical_E);
79 grid_size[dim - 1] = matsubara_nodes.size();
80 }
81
82 void set_typical_E(const ctype typical_E)
83 {
84 if (is_close(this->typical_E, typical_E, 1e-4 * T + std::numeric_limits<ctype>::epsilon() * 10)) return;
85
86 this->typical_E = typical_E;
87 matsubara_nodes =
88 quadrature_provider.template matsubara_nodes<ctype, typename ExecutionSpace::memory_space>(T, typical_E);
89 matsubara_weights =
90 quadrature_provider.template matsubara_weights<ctype, typename ExecutionSpace::memory_space>(T, typical_E);
91 matsubara_sum_T = quadrature_provider.template matsubara_T<ctype>(T, typical_E);
92 grid_size[dim - 1] = matsubara_nodes.size();
93 }
94
95 template <typename... T> void get(NT &dest, const T &...t) const
96 {
97 // create an execution space
98 ExecutionSpace space;
99
100 if (!m_result_views_initialized) {
101 m_result_view = Kokkos::View<NT, typename ExecutionSpace::memory_space>("result");
102 m_result_host = Kokkos::create_mirror_view(m_result_view);
103 m_result_views_initialized = true;
104 }
105 get(space, m_result_view, t...);
106 Kokkos::deep_copy(space, m_result_host, m_result_view);
107 space.fence();
108 dest = m_result_host();
109 }
110
111 template <typename OT, typename... T>
112 requires(!std::is_same_v<OT, NT>)
113 void get(OT &dest, const T &...t) const
114 {
115 ExecutionSpace space;
116 get(space, dest, t...);
117 }
118
119 template <typename OT, typename... Args>
120 requires(!std::is_same_v<OT, NT>)
121 void get(ExecutionSpace &space, OT &dest, const Args &...t) const
122 {
123 const auto args = device::make_tuple(t...);
124
125 const auto &n = nodes;
126 const auto &w = weights;
127 const auto &m_n = matsubara_nodes;
128 const auto &m_w = matsubara_weights;
129 const auto &start = grid_start;
130 const auto &scale = grid_scale;
131
132 const auto &m_T = matsubara_sum_T;
133
134 auto functor = KOKKOS_LAMBDA(const device::array<size_t, dim> &idx, NT &update)
135 {
137 ctype weight = 1;
138 bool is_first = true;
139 for (int i = 0; i < sdim; ++i) {
140 x[i] = Kokkos::fma(scale[i], n[i][idx[i]], start[i]);
141 weight *= w[i][idx[i]] * scale[i];
142 is_first &= idx[i] == 0;
143 }
144 is_first &= idx[dim - 1] == 0;
145 const ctype xt = m_n[idx[dim - 1]];
146 const ctype wt = m_w[idx[dim - 1]];
147 device::apply(
148 [&](const auto &...iargs) {
149 device::apply(
150 [&](const auto &...posargs) {
151 update +=
152 weight *
153 (
154 // positive and negative Matsubara frequencies
155 wt * (KERNEL::kernel(posargs..., xt, iargs...) + KERNEL::kernel(posargs..., -xt, iargs...))
156 // The zero mode (once per matsubara sum)
157 + (idx[dim - 1] != 0 ? NT{} : m_T * KERNEL::kernel(posargs..., (ctype)0, iargs...)));
158 },
159 x);
160 },
161 args);
162 device::apply([&](const auto &...iargs) { update += is_first ? KERNEL::constant(iargs...) : NT(0); }, args);
163 };
164
165 Kokkos::parallel_reduce("QuadratureIntegral_fT_" + std::to_string(dim) + "D", // name of the kernel
166 make_kokkos_nd_range<dim, ExecutionSpace>(space, {0}, grid_size),
168 }
169
170 template <typename view_type, typename Coordinates, typename... Args>
171 void map(ExecutionSpace &space, const view_type integral_view, const Coordinates &coordinates, const Args &...args)
172 {
174 extents[0] = integral_view.size();
175 for (int i = 0; i < dim; ++i)
176 extents[1 + i] = grid_size[i];
177
178 // Reuse cached view if large enough, otherwise reallocate (grow-only)
179 {
180 bool needs_realloc = false;
181 for (size_t i = 0; i < 1 + dim; ++i)
182 needs_realloc |= (extents[i] > m_cache_extents[i]);
183 if (needs_realloc) {
184 for (size_t i = 0; i < 1 + dim; ++i)
185 m_cache_extents[i] = std::max(m_cache_extents[i], extents[i]);
186 m_cache = make_kokkos_nd_view<1 + dim, NT, ExecutionSpace>("cache", m_cache_extents);
187 }
188 }
189 // Create a Restrict-tagged alias of the cache for no-alias optimization
190 const auto cache = KokkosNDViewRestrict<1 + dim, NT, ExecutionSpace>(m_cache);
191
192 const auto m_args = device::make_tuple(args...);
193
194 const auto &n = nodes;
195 const auto &w = weights;
196 const auto &m_n = matsubara_nodes;
197 const auto &m_w = matsubara_weights;
198 const auto &start = grid_start;
199 const auto &scale = grid_scale;
200
201 const auto &m_T = matsubara_sum_T;
202
203 auto functor = KOKKOS_LAMBDA(const device::array<size_t, 1 + dim> &idx)
204 {
205 // make subview
206 auto subview = device::apply([&](const auto &...i) { return Kokkos::subview(cache, i...); }, idx);
207
208 // get the position for the current index
209 const auto idx_v = coordinates.from_linear_index(idx[0]);
210 const auto pos = coordinates.forward(idx_v);
211 // make a tuple of all arguments
212 const auto full_args = device::tuple_cat(pos, m_args);
213
215 ctype weight = 1;
216 for (int i = 0; i < sdim; ++i) {
217 x[i] = Kokkos::fma(scale[i], n[i][idx[1 + i]], start[i]);
218 weight *= w[i][idx[1 + i]] * scale[i];
219 }
220 const ctype xt = m_n[idx[1 + dim - 1]];
221 const ctype wt = m_w[idx[1 + dim - 1]];
222 device::apply(
223 [&](const auto &...iargs) {
224 device::apply(
225 [&](const auto &...posargs) {
226 subview() =
227 weight *
228 (
229 // positive and negative Matsubara frequencies
230 wt * (KERNEL::kernel(posargs..., xt, iargs...) + KERNEL::kernel(posargs..., -xt, iargs...))
231 // The zero mode (once per matsubara sum)
232 + (idx[1 + dim - 1] != 0 ? NT{} : m_T * KERNEL::kernel(posargs..., (ctype)0, iargs...)));
233 },
234 x);
235 },
236 full_args);
237 };
238
239 Kokkos::parallel_for(make_kokkos_nd_range<1 + dim, ExecutionSpace>(space, {0}, extents),
241
242 using TeamType = Kokkos::TeamPolicy<ExecutionSpace>::member_type;
243 // reduction with vector lanes for warp-level parallelism
244 Kokkos::parallel_for(
245 Kokkos::TeamPolicy(space, integral_view.size(), Kokkos::AUTO, 32), KOKKOS_CLASS_LAMBDA(const TeamType &team) {
246 // get the current (continuous) index
247 const uint k = team.league_rank();
248
249 if (k > integral_view.size()) return;
250
251 // no-ops to capture
252 (void)cache;
253 (void)grid_size;
254
255 // Flatten grid_size into total element count for thread+vector splitting
256 size_t total_elements = 1;
257 for (int d = 0; d < dim; ++d)
258 total_elements *= grid_size[d];
259
260 NT res{};
261 Kokkos::parallel_reduce(
262 Kokkos::TeamThreadRange(team, (total_elements + 31) / 32),
263 [&](const size_t outer, NT &team_update) {
264 NT vec_sum{};
265 Kokkos::parallel_reduce(
266 Kokkos::ThreadVectorRange(team, 32),
267 [&](const size_t inner, NT &vec_update) {
268 const size_t flat = outer * 32 + inner;
269 if (flat < total_elements) {
270 // Convert flat index back to multi-dimensional
272 size_t remainder = flat;
273 for (int d = dim - 1; d >= 0; --d) {
274 ridx[d] = remainder % grid_size[d];
275 remainder /= grid_size[d];
276 }
277 device::apply([&](const auto &...iargs) { vec_update += cache(k, iargs...); }, ridx);
278 }
279 },
280 vec_sum);
281 team_update += vec_sum;
282 },
283 res);
284
285 // add the constant value (skip coordinate computation if kernel has no constant)
286 Kokkos::single(Kokkos::PerTeam(team), [&]() {
287 const auto idx = coordinates.from_linear_index(k);
288 const auto pos = coordinates.forward(idx);
289 const auto full_args = device::tuple_cat(pos, m_args);
290 integral_view(k) =
291 res + device::apply([&](const auto &...iargs) { return KERNEL::constant(iargs...); }, full_args);
292 });
293 });
294 }
295
296 template <typename Coordinates, typename... Args>
297 auto map(NT *dest, const Coordinates &coordinates, const Args &...args)
298 {
299 // Take care of MPI distribution
300 const auto &node_distribution = AbstractIntegrator::node_distribution;
301 if (node_distribution.mpi_comm != MPI_COMM_NULL && node_distribution.total_size > 0) {
302 auto mpi_comm = node_distribution.mpi_comm;
303 const auto &nodes = node_distribution.nodes;
304 const auto &sizes = node_distribution.sizes;
305
306 // Check if the rank is contained in nodes
307 const size_t m_rank = DiFfRG::MPI::rank(mpi_comm);
308 // If not, return an empty execution space
309 if (std::find(nodes.begin(), nodes.end(), m_rank) == nodes.end()) return ExecutionSpace();
310
311 // Get the size of the current rank
312 const size_t rank_size = sizes[m_rank];
313 // Offset is the sum of all previous ranks
314 const size_t offset = std::accumulate(sizes.begin(), sizes.begin() + m_rank, 0);
315
316 // Create a SubCoordinates object
317 const auto sub_coordinates = SubCoordinates(coordinates, offset, rank_size);
318 // Offset the destination pointer
319 NT *dest_offset = dest + offset;
320
321 return map_dist(dest_offset, sub_coordinates, args...);
322 }
323
324 return map_dist(dest, coordinates, args...);
325 }
326
327 template <typename Coordinates, typename... Args>
328 auto map_dist(NT *dest, const Coordinates &coordinates, const Args &...args)
329 {
330 // create unmanaged host view for dest
331 auto dest_view = Kokkos::View<NT *, CPU_memory, Kokkos::MemoryUnmanaged>(dest, coordinates.size());
332
333 // Reuse cached device view if large enough, otherwise reallocate (grow-only)
334 if (m_dest_device_size < coordinates.size()) {
335 m_dest_device = Kokkos::View<NT *, ExecutionSpace>(Kokkos::view_alloc(space, "MapIntegrators_device_view"),
336 coordinates.size());
337 m_dest_device_size = coordinates.size();
338 }
339 auto dest_device_view =
340 Kokkos::View<NT *, ExecutionSpace>(m_dest_device, Kokkos::make_pair(size_t(0), coordinates.size()));
341
342 // run the map function
343 map(space, dest_device_view, coordinates, args...);
344
345 // copy the result from device to the unmanaged host view
346 Kokkos::deep_copy(space, dest_view, dest_device_view);
347
348 return space;
349 }
350
351 protected:
352 ExecutionSpace space;
357
359
362
363 ctype T, typical_E;
365
366 Kokkos::View<const ctype *, typename ExecutionSpace::memory_space> matsubara_nodes;
367 Kokkos::View<const ctype *, typename ExecutionSpace::memory_space> matsubara_weights;
368
369 // Persistent view caches to avoid per-call GPU memory allocation
371 mutable device::array<size_t, 1 + dim> m_cache_extents{};
372 mutable Kokkos::View<NT *, ExecutionSpace> m_dest_device;
373 mutable size_t m_dest_device_size = 0;
374 mutable Kokkos::View<NT, typename ExecutionSpace::memory_space> m_result_view;
375 mutable typename Kokkos::View<NT, typename ExecutionSpace::memory_space>::host_mirror_type m_result_host;
376 mutable bool m_result_views_initialized = false;
377 };
378
379 template <int dim, typename NT, typename KERNEL>
380 class QuadratureIntegrator_fT<dim, NT, KERNEL, TBB_exec>
381 : public QuadratureIntegrator_fT<dim, NT, KERNEL, Threads_exec>
382 {
384
385 public:
390 using ctype = typename get_type::ctype<NT>;
392
393 static constexpr int sdim = dim - 1; // spatial dimension
394
395 QuadratureIntegrator_fT(QuadratureProvider &quadrature_provider, const std::array<size_t, sdim> _grid_size,
396 std::array<ctype, sdim> grid_min, std::array<ctype, sdim> grid_max,
397 const std::array<QuadratureType, sdim> quadrature_type, const ctype T = 1,
398 const ctype typical_E = 1)
399 : Base(quadrature_provider, _grid_size, grid_min, grid_max, quadrature_type, T, typical_E)
400 {
401 }
402
403 template <typename... Args>
404 requires is_valid_kernel<NT, KERNEL, ctype, dim, Args...>
405 void get(NT &dest, const Args &...t) const
406 {
407 const auto args = device::tie(t...);
408
409 const auto &n = nodes;
410 const auto &w = weights;
411 const auto &m_n = matsubara_nodes;
412 const auto &m_w = matsubara_weights;
413 const auto &start = grid_start;
414 const auto &scale = grid_scale;
415
416 const auto &m_T = matsubara_sum_T;
417
418 auto functor = [&](const device::array<size_t, dim> &idx) {
420 ctype weight = 1;
421 for (int i = 0; i < sdim; ++i) {
422 x[i] = Kokkos::fma(scale[i], n[i][idx[i]], start[i]);
423 weight *= w[i][idx[i]] * scale[i];
424 }
425 const ctype xt = m_n[idx[dim - 1]];
426 const ctype wt = m_w[idx[dim - 1]];
427 NT update{};
428 device::apply(
429 [&](const auto &...iargs) {
430 device::apply(
431 [&](const auto &...posargs) {
432 update +=
433 weight *
434 (
435 // positive and negative Matsubara frequencies
436 wt * (KERNEL::kernel(posargs..., xt, iargs...) + KERNEL::kernel(posargs..., -xt, iargs...))
437 // The zero mode (once per matsubara sum)
438 + (idx[dim - 1] != 0 ? NT{} : m_T * KERNEL::kernel(posargs..., (ctype)0, iargs...)));
439 },
440 x);
441 },
442 args);
443 return update;
444 };
445
446 dest = KERNEL::constant(t...) + TBBReduction<dim, NT, decltype(functor)>(grid_size, functor);
447 }
448
449 template <typename Coordinates, typename... Args>
450 void map(execution_space &, NT *dest, const Coordinates &coordinates, const Args &...args)
451 {
452 const auto m_args = device::tie(args...);
453
454 tbb::parallel_for(tbb::blocked_range<uint>(0, coordinates.size()), [&](const tbb::blocked_range<uint> &r) {
455 for (uint idx = r.begin(); idx != r.end(); ++idx) {
456 const auto dis_idx = coordinates.from_linear_index(idx);
457 const auto pos = coordinates.forward(dis_idx);
458 // make a tuple of all arguments
459 const auto full_args = device::tuple_cat(pos, m_args);
460 device::apply([&](const auto &...iargs) { get(dest[idx], iargs...); }, full_args);
461 }
462 });
463 }
464
465 template <typename Coordinates, typename... Args>
466 auto map(NT *dest, const Coordinates &coordinates, const Args &...args)
467 {
468 auto space = execution_space();
469
470 // Take care of MPI distribution
471 const auto &node_distribution = AbstractIntegrator::node_distribution;
472 if (node_distribution.mpi_comm != MPI_COMM_NULL && node_distribution.total_size > 0) {
473 auto mpi_comm = node_distribution.mpi_comm;
474 const auto &nodes = node_distribution.nodes;
475 const auto &sizes = node_distribution.sizes;
476
477 // Check if the rank is contained in nodes
478 const size_t m_rank = DiFfRG::MPI::rank(mpi_comm);
479 // If not, return an empty execution space
480 if (std::find(nodes.begin(), nodes.end(), m_rank) == nodes.end()) return execution_space();
481
482 // Get the size of the current rank
483 const size_t rank_size = sizes[m_rank];
484 // Offset is the sum of all previous ranks
485 const size_t offset = std::accumulate(sizes.begin(), sizes.begin() + m_rank, 0);
486
487 // Create a SubCoordinates object
488 const auto sub_coordinates = SubCoordinates(coordinates, offset, rank_size);
489 // Offset the destination pointer
490 NT *dest_offset = dest + offset;
491
492 map(space, dest_offset, sub_coordinates, args...);
493 } else
494 map(space, dest, coordinates, args...);
495 return space;
496 }
497
498 protected:
499 using Base::grid_extents;
500 using Base::grid_scale;
501 using Base::grid_size;
502 using Base::grid_start;
503 using Base::quadrature_provider;
504
505 using Base::matsubara_nodes;
506 using Base::matsubara_weights;
507 using Base::nodes;
508 using Base::weights;
509
510 using Base::matsubara_sum_T;
511 using Base::T;
512 using Base::typical_E;
513 };
514
515} // namespace DiFfRG
Definition abstract_integrator.hh:64
NodeDistribution node_distribution
Definition abstract_integrator.hh:73
QuadratureIntegrator_fT(QuadratureProvider &quadrature_provider, const std::array< size_t, sdim > _grid_size, std::array< ctype, sdim > grid_min, std::array< ctype, sdim > grid_max, const std::array< QuadratureType, sdim > quadrature_type, const ctype T=1, const ctype typical_E=1)
Definition quadrature_integrator_fT.hh:395
void get(NT &dest, const Args &...t) const
Definition quadrature_integrator_fT.hh:405
auto map(NT *dest, const Coordinates &coordinates, const Args &...args)
Definition quadrature_integrator_fT.hh:466
typename get_type::ctype< NT > ctype
Numerical type to be used for integration tasks e.g. the argument or possible jacobians.
Definition quadrature_integrator_fT.hh:390
void map(execution_space &, NT *dest, const Coordinates &coordinates, const Args &...args)
Definition quadrature_integrator_fT.hh:450
Definition quadrature_integrator_fT.hh:19
Kokkos::View< const ctype *, typename ExecutionSpace::memory_space > matsubara_weights
Definition quadrature_integrator_fT.hh:367
device::array< device::array< ctype, sdim >, 2 > grid_extents
Definition quadrature_integrator_fT.hh:354
static constexpr int sdim
Spatial dimension of the integration problem.
Definition quadrature_integrator_fT.hh:34
ctype typical_E
Definition quadrature_integrator_fT.hh:363
QuadratureProvider & quadrature_provider
Definition quadrature_integrator_fT.hh:353
device::array< Kokkos::View< const ctype *, typename ExecutionSpace::memory_space >, sdim > nodes
Definition quadrature_integrator_fT.hh:360
void get(OT &dest, const T &...t) const
Definition quadrature_integrator_fT.hh:113
device::array< ctype, sdim > grid_start
Definition quadrature_integrator_fT.hh:355
void set_typical_E(const ctype typical_E)
Definition quadrature_integrator_fT.hh:82
ExecutionSpace space
Definition quadrature_integrator_fT.hh:352
device::array< Kokkos::View< const ctype *, typename ExecutionSpace::memory_space >, sdim > weights
Definition quadrature_integrator_fT.hh:361
void get(ExecutionSpace &space, OT &dest, const Args &...t) const
Definition quadrature_integrator_fT.hh:121
auto map(NT *dest, const Coordinates &coordinates, const Args &...args)
Definition quadrature_integrator_fT.hh:297
Kokkos::View< NT *, ExecutionSpace > m_dest_device
Definition quadrature_integrator_fT.hh:372
void set_grid_extents(const std::array< ctype, sdim > grid_min, const std::array< ctype, sdim > grid_max)
Definition quadrature_integrator_fT.hh:59
KokkosNDView< 1+dim, NT, ExecutionSpace > m_cache
Definition quadrature_integrator_fT.hh:370
device::array< size_t, dim > grid_size
Definition quadrature_integrator_fT.hh:358
auto map_dist(NT *dest, const Coordinates &coordinates, const Args &...args)
Definition quadrature_integrator_fT.hh:328
device::array< ctype, sdim > grid_scale
Definition quadrature_integrator_fT.hh:356
ctype matsubara_sum_T
Definition quadrature_integrator_fT.hh:364
ExecutionSpace execution_space
Execution space to be used for the integration, e.g. GPU_exec, TBB_exec.
Definition quadrature_integrator_fT.hh:28
Kokkos::View< NT, typenameExecutionSpace::memory_space >::host_mirror_type m_result_host
Definition quadrature_integrator_fT.hh:375
void set_T(const ctype T)
Definition quadrature_integrator_fT.hh:71
Kokkos::View< NT, typename ExecutionSpace::memory_space > m_result_view
Definition quadrature_integrator_fT.hh:374
void map(ExecutionSpace &space, const view_type integral_view, const Coordinates &coordinates, const Args &...args)
Definition quadrature_integrator_fT.hh:171
typename get_type::ctype< NT > ctype
Numerical type to be used for integration tasks e.g. the argument or possible jacobians.
Definition quadrature_integrator_fT.hh:24
Kokkos::View< const ctype *, typename ExecutionSpace::memory_space > matsubara_nodes
Definition quadrature_integrator_fT.hh:366
void get(NT &dest, const T &...t) const
Definition quadrature_integrator_fT.hh:95
QuadratureIntegrator_fT(QuadratureProvider &quadrature_provider, const std::array< size_t, sdim > _grid_size, std::array< ctype, sdim > grid_min, std::array< ctype, sdim > grid_max, const std::array< QuadratureType, sdim > quadrature_type, const ctype T=1, const ctype typical_E=1)
Definition quadrature_integrator_fT.hh:36
ctype T
Definition quadrature_integrator_fT.hh:363
A class that provides quadrature points and weights, in host and device memory. The quadrature points...
Definition quadrature_provider.hh:137
Definition coordinates.hh:149
Definition abstract_integrator.hh:51
uint rank(MPI_Comm comm)
std::array< T, N > array
Definition kokkos.hh:133
typename internal::_ctype< CT >::value ctype
Definition types.hh:134
Definition complex_math.hh:10
Kokkos::View< typename GetKokkosNDStarType< dim, T >::type, ExecutionSpace > KokkosNDView
Definition kokkos.hh:160
auto make_kokkos_nd_range(ExecutionSpace &space, const device::array< size_t, dim > start, const device::array< size_t, dim > end)
Definition kokkos.hh:227
Kokkos::View< typename GetKokkosNDStarType< dim, T >::type, ExecutionSpace, Kokkos::MemoryTraits< Kokkos::Restrict > > KokkosNDViewRestrict
Definition kokkos.hh:165
bool KOKKOS_INLINE_FUNCTION is_close(T1 a, T2 b, T3 eps_)
Function to evaluate whether two floats are equal to numerical precision. Tests for both relative and...
Definition math.hh:168
constexpr auto & get(named_tuple< tuple_type, strSet > &ob)
get a reference to the element with the given name
Definition tuples.hh:111
unsigned int uint
Definition utils.hh:24
NT TBBReduction(const device::array< size_t, dim > &grid_size, const FUN &functor)
Definition tbb.hh:91
auto make_kokkos_nd_view(const std::string &label, const device::array< size_t, dim > &extents)
Definition kokkos.hh:181
ExecutionSpaces::TBB_exec_space TBB_exec
Definition kokkos.hh:49
This is a functor which wraps a lambda for reduction. Basically, this is necessary when one wants to ...
Definition kokkos.hh:314
This is a functor which wraps a lambda. Basically, this is necessary when one wants to call a variadi...
Definition kokkos.hh:288
This execution space is optimal when used in conjunction with the FE discretizations.
Definition kokkos.hh:23