![]() |
OpenSWMM Engine
6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
|
Plugin entry points for the Phase 1 Kokkos/OpenMP surface solver. More...
#include "../solver/GpuPluginAbi.h"#include "../solver/ISurfaceSolver.hpp"#include "CvodeKokkosSurfaceSolver.hpp"#include "ArkodeKokkosSurfaceSolver.hpp"#include <Kokkos_Core.hpp>#include <cstdlib>#include <cstring>Functions | |
| OPENSWMM_GPU_ABI int | openswmm_gpu_probe (OpenSwmmGpuProbe *out) |
| Query the plugin for a usable GPU device. | |
| OPENSWMM_GPU_ABI void * | openswmm_make_gpu_surface_solver (const OpenSwmmGpuProbe *) |
| Construct the GPU surface solver. | |
| OPENSWMM_GPU_ABI void * | openswmm_make_gpu_inertial_solver (const OpenSwmmGpuProbe *) |
| Construct the GPU LOCAL-INERTIAL surface solver (MOMENTUM=inertial). | |
Plugin entry points for the Phase 1 Kokkos/OpenMP surface solver.
Exports the GpuPluginAbi.h contract for the openswmm_gpu_omp plugin. The probe advertises a usable Kokkos-OpenMP backend; the factory constructs a CvodeKokkosSurfaceSolver. The core casts the returned void* back to ISurfaceSolver* and owns it.
Kokkos is initialized lazily on first solver construction and is intentionally NOT finalized: only this plugin uses Kokkos, and finalizing at plugin/process teardown risks destroying Views that outlive the call. Leaving the runtime resident is the safe choice for a dlopen()ed plugin.
| OPENSWMM_GPU_ABI int openswmm_gpu_probe | ( | OpenSwmmGpuProbe * | out | ) |
Query the plugin for a usable GPU device.
Must be cheap and side-effect-free beyond backend initialization.
| out | Caller-allocated struct to fill. Zero-initialized on entry by the plugin. |
| OPENSWMM_GPU_ABI void * openswmm_make_gpu_inertial_solver | ( | const OpenSwmmGpuProbe * | probe | ) |
Construct the GPU LOCAL-INERTIAL surface solver (MOMENTUM=inertial).
OPTIONAL ABI symbol (does not bump OPENSWMM_GPU_ABI_VERSION): the core dlsym()s it only when the model selects the local-inertial momentum closure, and falls back to the serial CPU ArkodeSurfaceSolver when a plugin does not export it. Returns an ISurfaceSolver* (as void*) owned by the caller, or NULL.
| OPENSWMM_GPU_ABI void * openswmm_make_gpu_surface_solver | ( | const OpenSwmmGpuProbe * | probe | ) |
Construct the GPU surface solver.
| probe | The probe result the core obtained from openswmm_gpu_probe(). |