![]() |
OpenSWMM Engine
6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
|
Plugin entry points for the Phase 5 Kokkos/HIP surface solver (AMD). More...
#include "../solver/GpuPluginAbi.h"#include "../solver/ISurfaceSolver.hpp"#include "CvodeKokkosSurfaceSolver.hpp"#include <Kokkos_Core.hpp>#include <hip/hip_runtime.h>#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. | |
Plugin entry points for the Phase 5 Kokkos/HIP surface solver (AMD).
Exports the GpuPluginAbi.h contract for the openswmm_gpu_hip plugin. Identical in shape to GpuPluginCuda.cpp — the probe advertises an AMD device and the factory constructs a CvodeKokkosSurfaceSolver — but the solver's execution space is Kokkos::HIP (selected by the OPENSWMM_GPU_EXECSPACE_HIP define the CMake target sets), so the whole RHS / preconditioner / vector pipeline runs device-resident.
Per strategy §6.1, this file plus a CMake branch, the ExecSpace typedef, and a vcpkg feature are the entire AMD delta: the solver and kernel sources are reused verbatim from the CUDA backend.
Kokkos is initialized lazily on first solver construction and is intentionally NOT finalized (same rationale as the CUDA plugin): only this plugin uses Kokkos, and finalizing at dlclose risks destroying device Views that outlive the call.
Compiles only with a ROCm toolchain (hipcc) against a HIP-enabled Kokkos. Not buildable on macOS/Apple Silicon.
| 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_surface_solver | ( | const OpenSwmmGpuProbe * | probe | ) |
Construct the GPU surface solver.
| probe | The probe result the core obtained from openswmm_gpu_probe(). |