OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
GpuPluginStub.cpp File Reference

Placeholder GPU surface-solver plugin (Phase 0 scaffold). More...

#include "../solver/GpuPluginAbi.h"
#include <cstring>
Include dependency graph for GpuPluginStub.cpp:

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.
 

Detailed Description

Placeholder GPU surface-solver plugin (Phase 0 scaffold).

Implements the GpuPluginAbi.h contract with NO actual GPU backend. It exists so the runtime discovery / dlopen / fallback wiring (docs/2D_GPU_PORTABLE_CVODE_STRATEGY.md §4.2) can be built and exercised before the Kokkos kernel lands (Phase 2). The probe reports "no device", so the core's auto-selection falls back to the serial CPU CvodeSurfaceSolver.

This translation unit deliberately depends on NOTHING beyond the C ABI header and the C++ standard library — no Kokkos, no SUNDIALS — so it compiles with a plain host compiler on every platform.

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
License\n MIT License

Function Documentation

◆ openswmm_gpu_probe()

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.

Parameters
outCaller-allocated struct to fill. Zero-initialized on entry by the plugin.
Returns
0 on success with at least one usable device; non-zero if no device is available or the probe failed. A non-zero return tells the core to fall back to the CPU solver.

◆ openswmm_make_gpu_surface_solver()

OPENSWMM_GPU_ABI void * openswmm_make_gpu_surface_solver ( const OpenSwmmGpuProbe * probe)

Construct the GPU surface solver.

Parameters
probeThe probe result the core obtained from openswmm_gpu_probe().
Returns
An ISurfaceSolver* (as void*) owned by the caller, or NULL on failure. The core deletes it via the ISurfaceSolver destructor.