9.1
general documentation
cs_sles_cudss.h File Reference
#include "base/cs_base.h"
#include "alge/cs_matrix.h"
#include "alge/cs_sles.h"
+ Include dependency graph for cs_sles_cudss.h:

Go to the source code of this file.

Typedefs

typedef struct _cs_sles_cudss_t cs_sles_cudss_t
 

Functions

cs_sles_cudss_tcs_sles_cudss_define (int f_id, const char *name)
 Define and associate an cuDSS linear system solver for a given field or equation name. More...
 
cs_sles_cudss_tcs_sles_cudss_create (void)
 Create cuDSS linear system solver info and context. More...
 
void * cs_sles_cudss_copy (const void *context)
 Create cuDSS linear system solver info and context based on existing info and context. More...
 
void cs_sles_cudss_destroy (void **context)
 Destroy cuDSS linear system solver info and context. More...
 
void cs_sles_cudss_set_flags (void *context, int flags)
 Define additional cuDSS solver usage flags. More...
 
int cs_sles_cudss_get_flags (void *context)
 Query additional cuDSS solver usage flags. More...
 
void cs_sles_cudss_setup (void *context, const char *name, const cs_matrix_t *a, int verbosity)
 Setup cuDSS linear equation solver. More...
 
cs_sles_convergence_state_t cs_sles_cudss_solve (void *context, const char *name, const cs_matrix_t *a, int verbosity, double precision, double r_norm, int *n_iter, double *residual, const cs_real_t *rhs, cs_real_t *vx_ini, cs_real_t *vx, size_t aux_size, void *aux_vectors)
 Call cuDSS linear equation solver. More...
 
void cs_sles_cudss_free (void *context)
 Free cuDSS linear equation solver setup context. More...
 
void cs_sles_cudss_log (const void *context, cs_log_t log_type)
 Log sparse linear equation solver info. More...
 
void cs_sles_cudss_library_info (cs_log_t log_type)
 Print information on cuDSS library. More...
 

Typedef Documentation

◆ cs_sles_cudss_t

typedef struct _cs_sles_cudss_t cs_sles_cudss_t

cuDSS wrapper option flags

Function Documentation

◆ cs_sles_cudss_copy()

void * cs_sles_cudss_copy ( const void *  context)

Create cuDSS linear system solver info and context based on existing info and context.

Most configuration parameters will be copied from the existing context, though not all, since cuDSS does not provide a comprehensive way to do this.

Parameters
[in]contextpointer to reference info and context (actual type: cs_sles_cudss_t *)
Returns
pointer to newly created solver info object. (actual type: cs_sles_cudss_t *)

◆ cs_sles_cudss_create()

cs_sles_cudss_t * cs_sles_cudss_create ( void  )

Create cuDSS linear system solver info and context.

In case of rotational periodicity for a block (non-scalar) matrix, the matrix type will be forced to MATSHELL ("shell") regardless of the option used.

Returns
pointer to associated linear system object.

◆ cs_sles_cudss_define()

cs_sles_cudss_t * cs_sles_cudss_define ( int  f_id,
const char *  name 
)

Define and associate an cuDSS linear system solver for a given field or equation name.

If this system did not previously exist, it is added to the list of "known" systems. Otherwise, its definition is replaced by the one defined here.

This is a utility function: if finer control is needed, see cs_sles_define and cs_sles_cudss_create.

In case of rotational periodicity for a block (non-scalar) matrix, the matrix type will be forced to MATSHELL ("shell") regardless of the option used.

Note that this function returns a pointer directly to the solver management structure. This may be used to set further options. If needed, cs_sles_find may be used to obtain a pointer to the matching cs_sles_t container.

Parameters
[in]f_idassociated field id, or < 0
[in]nameassociated name if f_id < 0, or nullptr
Returns
pointer to newly created cuDSS solver info object.

◆ cs_sles_cudss_destroy()

void cs_sles_cudss_destroy ( void **  context)

Destroy cuDSS linear system solver info and context.

Parameters
[in,out]contextpointer to cuDSS solver info and context (actual type: cs_sles_cudss_t **)

◆ cs_sles_cudss_free()

void cs_sles_cudss_free ( void *  context)

Free cuDSS linear equation solver setup context.

This function frees resolution-related data, such as buffers and preconditioning but does not free the whole context, as info used for logging (especially performance data) is maintained.

Parameters
[in,out]contextpointer to cuDSS solver info and context (actual type: cs_sles_cudss_t *)

◆ cs_sles_cudss_get_flags()

int cs_sles_cudss_get_flags ( void *  context)

Query additional cuDSS solver usage flags.

Parameters
[in]contextpointer to cuDSS solver info and context
Returns
associated flags

◆ cs_sles_cudss_library_info()

void cs_sles_cudss_library_info ( cs_log_t  log_type)

Print information on cuDSS library.

Parameters
[in]log_typelog type

◆ cs_sles_cudss_log()

void cs_sles_cudss_log ( const void *  context,
cs_log_t  log_type 
)

Log sparse linear equation solver info.

Parameters
[in]contextpointer to cuDSS solver info and context (actual type: cs_sles_cudss_t *)
[in]log_typelog type

◆ cs_sles_cudss_set_flags()

void cs_sles_cudss_set_flags ( void *  context,
int  flags 
)

Define additional cuDSS solver usage flags.

By default, the device will be used, but by calling this function with "use_device = false", only the host will be used.

Parameters
[in,out]contextpointer to cuDSS solver info and context
[in]flagsflags (sum/bitwise of) for cuDSS usage options.

◆ cs_sles_cudss_setup()

void cs_sles_cudss_setup ( void *  context,
const char *  name,
const cs_matrix_t a,
int  verbosity 
)

Setup cuDSS linear equation solver.

Parameters
[in,out]contextpointer to cuDSS solver info and context (actual type: cs_sles_cudss_t *)
[in]namepointer to system name
[in]aassociated matrix
[in]verbosityassociated verbosity

◆ cs_sles_cudss_solve()

cs_sles_convergence_state_t cs_sles_cudss_solve ( void *  context,
const char *  name,
const cs_matrix_t a,
int  verbosity,
double  precision,
double  r_norm,
int *  n_iter,
double *  residual,
const cs_real_t rhs,
cs_real_t vx_ini,
cs_real_t vx,
size_t  aux_size,
void *  aux_vectors 
)

Call cuDSS linear equation solver.

Warning
The precision, r_norm, and n_iter parameters are ignored here. the matching configuration options should be set earlier, using the cs_sles_cudss_set_config function
Parameters
[in,out]contextpointer to cuDSS solver info and context (actual type: cs_sles_cudss_t *)
[in]namepointer to system name
[in]amatrix
[in]verbosityassociated verbosity
[in]precisionsolver precision
[in]r_normresidual normalization
[out]n_iternumber of "equivalent" iterations
[out]residualresidual
[in]rhsright hand side
[in]vx_iniinitial system solution (vx if nonzero, nullptr if zero)
[in,out]vxsystem solution
[in]aux_sizenumber of elements in aux_vectors (in bytes)
aux_vectorsoptional working area (internal allocation if nullptr)
Returns
convergence state