9.2
general documentation
cs_matrix_spmv_hip.cpp File Reference

Sparse Matrix SpMV operations with HIP. More...

#include "base/cs_defs.h"
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <math.h>
#include <mpi.h>
#include "bft/bft_error.h"
#include "bft/bft_printf.h"
#include "base/cs_base.h"
#include "base/cs_base_hip.h"
#include "base/cs_halo.h"
#include "base/cs_halo_perio.h"
#include "base/cs_log.h"
#include "base/cs_mem.h"
#include "base/cs_timer.h"
#include "alge/cs_matrix.h"
#include "alge/cs_matrix_priv.h"
#include "alge/cs_matrix_spmv.h"
+ Include dependency graph for cs_matrix_spmv_hip.cpp:

Functions

void cs_matrix_spmv_hip_finalize (void)
 Finalize ROC matrix API. More...
 
void cs_matrix_spmv_hip_set_stream (hipStream_t stream)
 Assign ROC stream for next ROC-based SpMV operations. More...
 
hipStream_t cs_matrix_spmv_hip_get_stream (void)
 Return stream used for ROC-based SpMV operations. More...
 
void cs_matrix_spmv_hip_native (const cs_matrix_t *matrix, bool exclude_diag, bool sync, cs_real_t d_x[], cs_real_t d_y[])
 Matrix.vector product y = A.x with MSR matrix, scalar ROC version. More...
 
void cs_matrix_spmv_hip_csr (cs_matrix_t *matrix, bool exclude_diag, bool sync, cs_real_t d_x[], cs_real_t d_y[])
 Matrix.vector product y = A.x with CSR matrix, scalar ROC version. More...
 
void cs_matrix_spmv_hip_msr (cs_matrix_t *matrix, bool exclude_diag, bool sync, cs_real_t d_x[], cs_real_t d_y[])
 Matrix.vector product y = A.x with MSR matrix, scalar ROC version. More...
 
void cs_matrix_spmv_hip_msr_b (cs_matrix_t *matrix, bool exclude_diag, bool sync, cs_real_t d_x[], cs_real_t d_y[])
 Matrix.vector product y = A.x with MSR matrix, block diagonal ROC version. More...
 

Detailed Description

Sparse Matrix SpMV operations with HIP.

Function Documentation

◆ cs_matrix_spmv_hip_csr()

void cs_matrix_spmv_hip_csr ( cs_matrix_t matrix,
bool  exclude_diag,
bool  sync,
cs_real_t  d_x[],
cs_real_t  d_y[] 
)

Matrix.vector product y = A.x with CSR matrix, scalar ROC version.

Matrix.vector product y = A.x with CSR matrix, scalar HIP version.

Parameters
[in]matrixpointer to matrix structure
[in]exclude_diagexclude diagonal if true,
[in]syncsynchronize ghost cells if true
[in]d_xmultipliying vector values (on device)
[out]d_yresulting vector (on device)

◆ cs_matrix_spmv_hip_finalize()

void cs_matrix_spmv_hip_finalize ( void  )

Finalize ROC matrix API.

Finalize HIP matrix API.

This frees resources such as the rocSPARSE handle, if used.

◆ cs_matrix_spmv_hip_get_stream()

hipStream_t cs_matrix_spmv_hip_get_stream ( void  )

Return stream used for ROC-based SpMV operations.

This function is callable only from ROC code.

◆ cs_matrix_spmv_hip_msr()

void cs_matrix_spmv_hip_msr ( cs_matrix_t matrix,
bool  exclude_diag,
bool  sync,
cs_real_t  d_x[],
cs_real_t  d_y[] 
)

Matrix.vector product y = A.x with MSR matrix, scalar ROC version.

Matrix.vector product y = A.x with MSR matrix, scalar HIP version.

Parameters
[in]matrixpointer to matrix structure
[in]exclude_diagexclude diagonal if true,
[in]syncsynchronize ghost cells if true
[in]d_xmultipliying vector values (on device)
[out]d_yresulting vector (on device)

◆ cs_matrix_spmv_hip_msr_b()

void cs_matrix_spmv_hip_msr_b ( cs_matrix_t matrix,
bool  exclude_diag,
bool  sync,
cs_real_t  d_x[],
cs_real_t  d_y[] 
)

Matrix.vector product y = A.x with MSR matrix, block diagonal ROC version.

Matrix.vector product y = A.x with MSR matrix, block diagonal HIP version.

Parameters
[in]matrixpointer to matrix structure
[in]exclude_diagexclude diagonal if true,
[in]syncsynchronize ghost cells if true
[in]d_xmultipliying vector values (on device)
[out]d_yresulting vector (on device)

◆ cs_matrix_spmv_hip_native()

void cs_matrix_spmv_hip_native ( const cs_matrix_t matrix,
bool  exclude_diag,
bool  sync,
cs_real_t  d_x[],
cs_real_t  d_y[] 
)

Matrix.vector product y = A.x with MSR matrix, scalar ROC version.

Parameters
[in]matrixpointer to matrix structure
[in]exclude_diagexclude diagonal if true,
[in]syncsynchronize ghost cells if true
[in]d_xmultipliying vector values (on device)
[out]d_yresulting vector (on device)

◆ cs_matrix_spmv_hip_set_stream()

void cs_matrix_spmv_hip_set_stream ( hipStream_t  stream)

Assign ROC stream for next ROC-based SpMV operations.

If a stream other than the default stream (0) is used, it will not be synchronized automatically after sparse matrix-vector products (so as to avoid the corresponding overhead), so the caller will need to manage stream syncronization manually.

This function is callable only from ROC code.