ViennaLS
Loading...
Searching...
No Matches
lsOxidationGpuAbi.hpp File Reference
#include <cstddef>
#include <cstdint>

Go to the source code of this file.

Macros

#define VIENNALS_GPU_ABI_VERSION   3
#define VIENNALS_GPU_ABI   __attribute__((visibility("default")))

Functions

VIENNALS_GPU_ABI int viennalsGpuAbiVersion (void)
 Returns the ABI version this library was built against.
VIENNALS_GPU_ABI const char * viennalsGpuGetLastErrorMessage (void)
 Human-readable detail for the last failure on this thread.
VIENNALS_GPU_ABI int viennalsGpuDiffusionSolve (int64_t n, const int64_t *ptr, const int64_t *col, const double *val, const double *rhs, double *x, unsigned maxIterations, double absTolerance, unsigned *outIterations)
 Diffusion solve of OxidationDiffusion, as on the CPU: BiCGSTAB preconditioned by smoothed-aggregation AMG with an ILU0 smoother on the CSR system (ptr, col, val) of n unknowns, stopping at ||r||_2 <= absTolerance or after maxIterations. x is the initial guess on entry, the solution on exit. Returns 1 when the solve ran and gave finite values (whatever the residual), 0 when no CUDA device is usable (x untouched), -1 when it failed.
VIENNALS_GPU_ABI void * viennalsGpuMacSetup (int64_t n, const int64_t *ptr, const int64_t *col, const double *val, int64_t nvel, int dim, const double *nullspace)
 3-D velocity-pressure solve of OxidationDeformation: set up the preconditioner for the CSR system (ptr, col, val) of n unknowns, the first nvel of them velocities; nullspace holds dim near-nullspace values per velocity unknown. Returns nullptr on failure.
VIENNALS_GPU_ABI int viennalsGpuMacSolve (void *handle, int64_t n, const int64_t *ptr, const int64_t *col, const double *val, const double *rhs, double *x, unsigned maxIterations, double tolerance, unsigned *outIterations, double *outResidual)
 FGMRES on A x = rhs with the preconditioner of handle; A may differ from the matrix of the setup (same unknowns). x is the initial guess on entry, the solution on exit. Non-zero when the solve ran and gave finite values, whatever the residual; iterations and relative residual returned.
VIENNALS_GPU_ABI void viennalsGpuMacFree (void *handle)
 Free a setup. Safe to call with nullptr.

Macro Definition Documentation

◆ VIENNALS_GPU_ABI

#define VIENNALS_GPU_ABI   __attribute__((visibility("default")))

◆ VIENNALS_GPU_ABI_VERSION

#define VIENNALS_GPU_ABI_VERSION   3

Function Documentation

◆ viennalsGpuAbiVersion()

VIENNALS_GPU_ABI int viennalsGpuAbiVersion ( void )

Returns the ABI version this library was built against.

◆ viennalsGpuDiffusionSolve()

VIENNALS_GPU_ABI int viennalsGpuDiffusionSolve ( int64_t n,
const int64_t * ptr,
const int64_t * col,
const double * val,
const double * rhs,
double * x,
unsigned maxIterations,
double absTolerance,
unsigned * outIterations )

Diffusion solve of OxidationDiffusion, as on the CPU: BiCGSTAB preconditioned by smoothed-aggregation AMG with an ILU0 smoother on the CSR system (ptr, col, val) of n unknowns, stopping at ||r||_2 <= absTolerance or after maxIterations. x is the initial guess on entry, the solution on exit. Returns 1 when the solve ran and gave finite values (whatever the residual), 0 when no CUDA device is usable (x untouched), -1 when it failed.

◆ viennalsGpuGetLastErrorMessage()

VIENNALS_GPU_ABI const char * viennalsGpuGetLastErrorMessage ( void )

Human-readable detail for the last failure on this thread.

◆ viennalsGpuMacFree()

VIENNALS_GPU_ABI void viennalsGpuMacFree ( void * handle)

Free a setup. Safe to call with nullptr.

◆ viennalsGpuMacSetup()

VIENNALS_GPU_ABI void * viennalsGpuMacSetup ( int64_t n,
const int64_t * ptr,
const int64_t * col,
const double * val,
int64_t nvel,
int dim,
const double * nullspace )

3-D velocity-pressure solve of OxidationDeformation: set up the preconditioner for the CSR system (ptr, col, val) of n unknowns, the first nvel of them velocities; nullspace holds dim near-nullspace values per velocity unknown. Returns nullptr on failure.

◆ viennalsGpuMacSolve()

VIENNALS_GPU_ABI int viennalsGpuMacSolve ( void * handle,
int64_t n,
const int64_t * ptr,
const int64_t * col,
const double * val,
const double * rhs,
double * x,
unsigned maxIterations,
double tolerance,
unsigned * outIterations,
double * outResidual )

FGMRES on A x = rhs with the preconditioner of handle; A may differ from the matrix of the setup (same unknowns). x is the initial guess on entry, the solution on exit. Non-zero when the solve ran and gave finite values, whatever the residual; iterations and relative residual returned.