include/pops/runtime/module_capabilities.hpp Source File

adc_cpp: include/pops/runtime/module_capabilities.hpp Source File
adc_cpp 0.3.0
Model-free C++23 core for coupled hyperbolic-elliptic systems on adaptive (AMR) meshes, with MPI and GPU (Kokkos) backends
module_capabilities.hpp
Go to the documentation of this file.
1#pragma once
2
24
25namespace pops {
26
32inline constexpr int kAbiVersion = 1;
33
39
53
54namespace detail {
55
60inline constexpr bool kHasGpuBackend =
61#if defined(POPS_HAS_KOKKOS) && (defined(__CUDACC__) || defined(__HIPCC__))
62 true;
63#else
64 false;
65#endif
66
67inline constexpr bool kHasMpi =
68#if defined(POPS_HAS_MPI)
69 true;
70#else
71 false;
72#endif
73
74} // namespace detail
75
88 ModuleCapabilities caps{};
90 caps.supports_uniform = true;
91 caps.supports_amr = true;
92 caps.supports_mpi = detail::kHasMpi;
93 caps.supports_gpu = detail::kHasGpuBackend;
94 caps.supports_stride = (target == CapabilityTarget::kProduction);
95 caps.supports_named_fields = true;
96 caps.supports_partial_imex_mask = false;
97 return caps;
98}
99
100} // namespace pops
constexpr bool kHasMpi
Definition module_capabilities.hpp:67
constexpr bool kHasGpuBackend
True iff this translation unit is compiled for a real GPU device backend.
Definition module_capabilities.hpp:60
Definition amr_hierarchy.hpp:29
CapabilityTarget
The lowering route whose static capabilities are queried.
Definition module_capabilities.hpp:38
constexpr int kAbiVersion
Discrete, monotonic ABI revision of the module capability contract.
Definition module_capabilities.hpp:32
ModuleCapabilities module_capabilities(CapabilityTarget target=CapabilityTarget::kModule)
The module's STATIC capability facts for a given lowering route target (Spec 5 sec....
Definition module_capabilities.hpp:87
The STATIC transport capabilities the built _pops module provides (Spec 5 sec.13.12).
Definition module_capabilities.hpp:43
bool supports_uniform
single-level uniform grid (always available).
Definition module_capabilities.hpp:45
bool supports_gpu
real GPU device backend (Kokkos AND a CUDA/HIP token).
Definition module_capabilities.hpp:48
bool supports_amr
adaptive mesh refinement runtime (AmrSystem; always built in).
Definition module_capabilities.hpp:46
bool supports_partial_imex_mask
partial IMEX mask – FALSE: no C++ path backs it (do not lie).
Definition module_capabilities.hpp:51
bool supports_stride
the route carries a cell stride (production: yes; aot: no).
Definition module_capabilities.hpp:49
bool supports_named_fields
named aux-field transport (named_aux, aux_field; always built).
Definition module_capabilities.hpp:50
int abi_version
pops::kAbiVersion (this build's capability-contract revision).
Definition module_capabilities.hpp:44
bool supports_mpi
real MPI transport (POPS_HAS_MPI); false on a serial module.
Definition module_capabilities.hpp:47