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_x | Input scalar x vector
  [out] | fine_x | Output blocked x vector
  [in] | pressure_idx | Pressure index
  [in] | Nb | Number of blocks in the original matrix
  [in] | stream | Hip 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_y | Input y vector
  [in] | weights | Weights used to combine cells
  [out] | coarse_y | Output y vector
  [in] | Nb | Number of blocks in the original matrix
  [in] | stream | Hip 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] | verbosity | verbosity 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] | in | Input fine-grained vector
  [out] | out | Output course-graned vector
  [in] | cols | Column indexes
  [in] | N | Size of the vector
  [in] | stream | Hip 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] | vals | Matrix values
  [in] | cols | Column indexes
  [in] | rows | Row pointers
  [in] | x | X vector
  [in] | rhs | Rhs vector
  [out] | out | Output res vector
  [in] | Nb | Number of non-zero blocks in the original matrix
  [in] | block_size | Block size
  [in] | stream | Hip 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] | vals | Matrix values
  [in] | cols | Column indexes
  [in] | rows | Row pointers
  [in] | x | Input x vector
  [out] | y | Output y vector
  [in] | Nb | Number of non-zero blocks in the original matrix
  [in] | block_size | Block size
  [in] | stream | Hip 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] | alpha | Input scalar
  [in] | in1 | First input vector
  [in] | in2 | Second input vector
  [out] | out | Output vector
  [in] | N | Size of the vector
  [in] | stream | Hip stream to use for the computations

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

- opm/simulators/linalg/gpubridge/rocm/hipKernels.hpp
- opm/simulators/linalg/gpubridge/rocm/hipKernels.cpp