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... | |
Sparse Matrix SpMV operations with HIP.
| 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.
| [in] | matrix | pointer to matrix structure |
| [in] | exclude_diag | exclude diagonal if true, |
| [in] | sync | synchronize ghost cells if true |
| [in] | d_x | multipliying vector values (on device) |
| [out] | d_y | resulting vector (on device) |
| 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.
| 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.
| 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.
| [in] | matrix | pointer to matrix structure |
| [in] | exclude_diag | exclude diagonal if true, |
| [in] | sync | synchronize ghost cells if true |
| [in] | d_x | multipliying vector values (on device) |
| [out] | d_y | resulting vector (on device) |
| 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.
| [in] | matrix | pointer to matrix structure |
| [in] | exclude_diag | exclude diagonal if true, |
| [in] | sync | synchronize ghost cells if true |
| [in] | d_x | multipliying vector values (on device) |
| [out] | d_y | resulting vector (on device) |
| 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.
| [in] | matrix | pointer to matrix structure |
| [in] | exclude_diag | exclude diagonal if true, |
| [in] | sync | synchronize ghost cells if true |
| [in] | d_x | multipliying vector values (on device) |
| [out] | d_y | resulting vector (on device) |
| 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.