OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
GpuPluginSupport.hpp File Reference

Shared support for GPU execution plugins. More...

#include "../solver/GpuPluginAbi.h"
#include "ExplicitKokkosSurfaceSolver.hpp"
#include <cstdio>
#include <exception>
Include dependency graph for GpuPluginSupport.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  openswmm
 
namespace  openswmm::twoD
 
namespace  openswmm::twoD::gpu
 
namespace  openswmm::twoD::gpu::plugin
 

Functions

template<class Initialize>
void * openswmm::twoD::gpu::plugin::make (Initialize initialize) noexcept
 Construct a plugin-owned Kokkos surface marcher with thread-local diagnostics.
 
OPENSWMM_GPU_ABI const char * openswmm_gpu_build_contract ()
 v5 compatibility check, called BEFORE probe or factory.
 
OPENSWMM_GPU_ABI const char * openswmm_gpu_last_error ()
 Last construction error on this controlling thread; plugin-owned text.
 
OPENSWMM_GPU_ABI void openswmm_destroy_gpu_explicit_solver (void *solver)
 Destroy on the execution owner through the allocating plugin.
 

Variables

thread_local char openswmm::twoD::gpu::plugin::error [512] {}
 

Detailed Description

Shared support for GPU execution plugins.

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
License
Apache-2.0

Function Documentation

◆ openswmm_destroy_gpu_explicit_solver()

OPENSWMM_GPU_ABI void openswmm_destroy_gpu_explicit_solver ( void * solver)

Destroy on the execution owner through the allocating plugin.

Destroy a solver using the same plugin that allocated it.

Parameters
[in]solverOwned factory result from this loaded plugin; NULL is safe. Foreign/already-destroyed pointers are unsupported.
Postcondition
Releases solver-owned host/device state without finalizing the process Kokkos runtime.
Note
Call on the controlling execution-owner thread after all solver work/callers finish, before unloading the plugin. Consumes the pointer; no status is returned.

◆ openswmm_gpu_build_contract()

OPENSWMM_GPU_ABI const char * openswmm_gpu_build_contract ( void )

v5 compatibility check, called BEFORE probe or factory.

Borrow the plugin's generated C++ compatibility fingerprint.

Returns
Immutable NUL-terminated build-contract string owned by the loaded plugin, valid until library unload. Do not modify/free it; copy if retained beyond unload.
Note
Must be checked before probing or creating a solver. No runtime initialization, allocation or solver ownership transfer.

◆ openswmm_gpu_last_error()

OPENSWMM_GPU_ABI const char * openswmm_gpu_last_error ( void )

Last construction error on this controlling thread; plugin-owned text.

Borrow the controlling thread's most recent factory diagnostic.

Returns
Plugin-owned NUL-terminated thread-local error text, empty after a successful factory call. Do not free/modify; copy before the next factory call on that thread, thread exit, or library unload.
Note
Does not report arbitrary solver/runtime errors or clear the diagnostic.