9.2
general documentation
cs_matrix_spmv_hip.h
Go to the documentation of this file.
1#ifndef CS_MATRIX_SPMV_HIP_H
2#define CS_MATRIX_SPMV_HIP_H
3
4/*============================================================================
5 * Sparse Matrix-vector multiplication kernels using HIP.
6 *============================================================================*/
7
8/*
9 This file is part of code_saturne, a general-purpose CFD tool.
10
11 Copyright (C) 1998-2026 EDF S.A.
12
13 This program is free software; you can redistribute it and/or modify it under
14 the terms of the GNU General Public License as published by the Free Software
15 Foundation; either version 2 of the License, or (at your option) any later
16 version.
17
18 This program is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21 details.
22
23 You should have received a copy of the GNU General Public License along with
24 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
25 Street, Fifth Floor, Boston, MA 02110-1301, USA.
26*/
27
28/*----------------------------------------------------------------------------*/
29
30/*----------------------------------------------------------------------------
31 * Local headers
32 *----------------------------------------------------------------------------*/
33
34#include "base/cs_defs.h"
35
36/*----------------------------------------------------------------------------*/
41/*----------------------------------------------------------------------------*/
42
43/*============================================================================
44 * Public HIP kernel prototypes
45 *============================================================================*/
46
47#if defined(__HIPCC__)
48
49#endif /* defined(__HIPCC__) */
50
51/*============================================================================
52 * Public function prototypes
53 *============================================================================*/
54
55/*----------------------------------------------------------------------------*/
61/*----------------------------------------------------------------------------*/
62
63extern "C" void
65
66#if defined(__HIPCC__)
67
68/*----------------------------------------------------------------------------*/
79/*----------------------------------------------------------------------------*/
80
81extern "C" void
82cs_matrix_spmv_hip_set_stream(hipStream_t stream);
83
84/*----------------------------------------------------------------------------*/
90/*----------------------------------------------------------------------------*/
91
92extern "C" hipStream_t
94
95#endif /* defined(__HIPCC__) */
96
97/*----------------------------------------------------------------------------*/
107/*----------------------------------------------------------------------------*/
108
109extern "C" void
111 bool exclude_diag,
112 bool sync,
113 cs_real_t d_x[],
114 cs_real_t d_y[]);
115
116/*----------------------------------------------------------------------------*/
126/*----------------------------------------------------------------------------*/
127
128extern "C" void
130 bool exclude_diag,
131 bool sync,
132 cs_real_t d_x[],
133 cs_real_t d_y[]);
134
135#if defined(HAVE_ROCSPARSE)
136
137/*----------------------------------------------------------------------------*/
147/*----------------------------------------------------------------------------*/
148
149extern "C" void
150cs_matrix_spmv_hip_csr_rocsparse(cs_matrix_t *matrix,
151 bool exclude_diag,
152 bool sync,
153 cs_real_t d_x[],
154 cs_real_t d_y[]);
155
156#endif /* defined(HAVE_ROCSPARSE) */
157
158/*----------------------------------------------------------------------------*/
168/*----------------------------------------------------------------------------*/
169
170extern "C" void
172 bool exclude_diag,
173 bool sync,
174 cs_real_t d_x[],
175 cs_real_t d_y[]);
176
177#if defined(HAVE_ROCSPARSE)
178
179/*----------------------------------------------------------------------------*/
190/*----------------------------------------------------------------------------*/
191
192extern "C" void
193cs_matrix_spmv_hip_msr_rocsparse(cs_matrix_t *matrix,
194 bool exclude_diag,
195 bool sync,
196 cs_real_t d_x[],
197 cs_real_t d_y[]);
198
199#endif /* defined(HAVE_ROCSPARSE) */
200
201/*----------------------------------------------------------------------------*/
212/*----------------------------------------------------------------------------*/
213
214extern "C" void
216 bool exclude_diag,
217 bool sync,
218 cs_real_t d_x[],
219 cs_real_t d_y[]);
220
221#if defined(HAVE_ROCSPARSE)
222
223/*----------------------------------------------------------------------------*/
239/*----------------------------------------------------------------------------*/
240
241extern "C" void
242cs_matrix_spmv_hip_msr_b_rocsparse(cs_matrix_t *matrix,
243 bool exclude_diag,
244 bool sync,
245 cs_real_t d_x[],
246 cs_real_t d_y[]);
247
248#endif /* defined(HAVE_ROCSPARSE) */
249
250/*----------------------------------------------------------------------------*/
266/*----------------------------------------------------------------------------*/
267
268extern "C" void
270 bool exclude_diag,
271 bool sync,
272 cs_real_t d_x[],
273 cs_real_t d_y[]);
274
275/*----------------------------------------------------------------------------*/
276
277#endif /* CS_MATRIX_SPMV_HIP_H */
double cs_real_t
Floating-point value.
Definition: cs_defs.h:332
struct _cs_matrix_t cs_matrix_t
Definition: cs_matrix.h:108
void cs_matrix_spmv_hip_set_stream(hipStream_t stream)
Assign ROC stream for next ROC-based SpMV operations.
Definition: cs_matrix_spmv_hip.cpp:1309
hipStream_t cs_matrix_spmv_hip_get_stream(void)
Return stream used for ROC-based SpMV operations.
Definition: cs_matrix_spmv_hip.cpp:1323
void cs_matrix_spmv_hip_msr_bb_rocsparse(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 rocSPARSE version.
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 HIP version.
Definition: cs_matrix_spmv_hip.cpp:1761
void cs_matrix_spmv_hip_native(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 HIP version.
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 HIP version.
Definition: cs_matrix_spmv_hip.cpp:1604
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 HIP version.
Definition: cs_matrix_spmv_hip.cpp:1446
void cs_matrix_spmv_hip_finalize(void)
Finalize HIP matrix API.
Definition: cs_matrix_spmv_hip.cpp:1281