My Project
Loading...
Searching...
No Matches
Opm::HipKernels< Scalar > Class Template Reference

Static Public Member Functions

static void init (int verbosity)
 Initialize verbosity level for the HIP kernels.
 
static void full_to_pressure_restriction (const Scalar *fine_y, Scalar *weights, Scalar *coarse_y, int Nb, hipStream_t stream)
 Transform blocked vector to scalar vector using pressure-weights, where every workitem handles one blockrow.
 
static void add_coarse_pressure_correction (Scalar *coarse_x, Scalar *fine_x, int pressure_idx, int Nb, hipStream_t stream)
 Add the coarse pressure solution back to the finer, complete solution; every workitem handles one blockrow.
 
static void vmul (const Scalar alpha, Scalar *in1, Scalar *in2, Scalar *out, int N, hipStream_t stream)
 Function to multiply vector with another vector and a scalar, element-wise and add the result to a third vector (out = alpha * in1 + in2)
 
static void prolongate_vector (const Scalar *in, Scalar *out, const int *cols, int N, hipStream_t stream)
 Function to prolongate vector during amg cycle, every workitem handles one row.
 
static void residual (Scalar *vals, int *cols, int *rows, Scalar *x, const Scalar *rhs, Scalar *out, int Nb, unsigned int block_size, hipStream_t stream)
 Function to perform res = rhs - mat * x.
 
static void spmv (Scalar *vals, int *cols, int *rows, Scalar *x, Scalar *y, int Nb, unsigned int block_size, hipStream_t stream)
 Function to perform sparse matrix vector multipliation.
 

Member Function Documentation

◆ add_coarse_pressure_correction()

template<class Scalar >
void Opm::HipKernels< Scalar >::add_coarse_pressure_correction ( Scalar * coarse_x,
Scalar * fine_x,
int pressure_idx,
int Nb,
hipStream_t stream )
static

Add the coarse pressure solution back to the finer, complete solution; every workitem handles one blockrow.

Parameters
[in]coarse_xInput scalar x vector
[out]fine_xOutput blocked x vector
[in]pressure_idxPressure index
[in]NbNumber of blocks in the original matrix
[in]streamHip stream to use for the computations

◆ full_to_pressure_restriction()

template<class Scalar >
void Opm::HipKernels< Scalar >::full_to_pressure_restriction ( const Scalar * fine_y,
Scalar * weights,
Scalar * coarse_y,
int Nb,
hipStream_t stream )
static

Transform blocked vector to scalar vector using pressure-weights, where every workitem handles one blockrow.

Parameters
[in]fine_yInput y vector
[in]weightsWeights used to combine cells
[out]course_yOutput y vector
[in]NbNumber of blocks in the original matrix
[in]streamHip stream to use for the computations

◆ init()

template<class Scalar >
void Opm::HipKernels< Scalar >::init ( int verbosity)
static

Initialize verbosity level for the HIP kernels.

Parameters
[in]verbosityverbosity level

◆ prolongate_vector()

template<class Scalar >
void Opm::HipKernels< Scalar >::prolongate_vector ( const Scalar * in,
Scalar * out,
const int * cols,
int N,
hipStream_t stream )
static

Function to prolongate vector during amg cycle, every workitem handles one row.

Parameters
[in]inInput fine-grained vector
[out]outOutput course-graned vector
[in]colsColumn indexes
[in]NSize of the vector
[in]streamHip stream to use for the computations

◆ residual()

template<class Scalar >
void Opm::HipKernels< Scalar >::residual ( Scalar * vals,
int * cols,
int * rows,
Scalar * x,
const Scalar * rhs,
Scalar * out,
int Nb,
unsigned int block_size,
hipStream_t stream )
static

Function to perform res = rhs - mat * x.

Parameters
[in]valsMatrix values
[in]colsColumn indexes
[in]rowsRow pointers
[in]xX vector
[in]rhsRhs vector
[out]outOutput res vector
[in]NbNumber of non-zero blocks in the original matrix
[in]block_sizeBlock size
[in]streamHip stream to use for the computations

◆ spmv()

template<class Scalar >
void Opm::HipKernels< Scalar >::spmv ( Scalar * vals,
int * cols,
int * rows,
Scalar * x,
Scalar * y,
int Nb,
unsigned int block_size,
hipStream_t stream )
static

Function to perform sparse matrix vector multipliation.

Parameters
[in]valsMatrix values
[in]colsColumn indexes
[in]rowsRow pointers
[in]xInput x vector
[out]yOutput y vector
[in]NbNumber of non-zero blocks in the original matrix
[in]block_sizeBlock size
[in]streamHip stream to use for the computations

◆ vmul()

template<class Scalar >
void Opm::HipKernels< Scalar >::vmul ( const Scalar alpha,
Scalar * in1,
Scalar * in2,
Scalar * out,
int N,
hipStream_t stream )
static

Function to multiply vector with another vector and a scalar, element-wise and add the result to a third vector (out = alpha * in1 + in2)

Parameters
[in]alphaInput scalar
[in]in1First input vector
[in]in2Second input vector
[out]outOutput vector
[in]NSize of the vector
[in]streamHip stream to use for the computations

The documentation for this class was generated from the following files: