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

Plugin entry points for the Phase 5 Kokkos/SYCL surface solver (Intel). More...

#include "../solver/GpuPluginAbi.h"
#include "../solver/ISurfaceSolver.hpp"
#include "CvodeKokkosSurfaceSolver.hpp"
#include <Kokkos_Core.hpp>
#include <sycl/sycl.hpp>
#include <cstring>
#include <vector>
Include dependency graph for GpuPluginSycl.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

Plugin entry points for the Phase 5 Kokkos/SYCL surface solver (Intel).

Exports the GpuPluginAbi.h contract for the openswmm_gpu_sycl plugin. Same shape as GpuPluginCuda.cpp — the probe advertises an Intel device and the factory constructs a CvodeKokkosSurfaceSolver — but the solver's execution space is Kokkos::SYCL (selected by the OPENSWMM_GPU_EXECSPACE_SYCL define the CMake target sets), so the whole RHS / preconditioner / vector pipeline runs device-resident.

The only structural difference from the CUDA/HIP probes is device discovery: SYCL enumerates devices through the SYCL runtime API (<sycl/sycl.hpp>) rather than a C device-count call, and it reports errors by throwing, so the probe wraps enumeration in a try/catch and maps any failure to the "no device -> CPU fallback" contract.

Per strategy §6.1, this file plus a CMake branch, the ExecSpace typedef, and a vcpkg feature are the entire Intel 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 oneAPI toolchain (icpx) against a SYCL-enabled Kokkos. Not buildable on macOS/Apple Silicon.

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.