9.2
general documentation
cs_matrix_spmv_cuda.h
Go to the documentation of this file.
1#ifndef CS_MATRIX_SPMV_CUDA_H
2#define CS_MATRIX_SPMV_CUDA_H
3
4/*============================================================================
5 * Sparse Matrix-vector multiplication kernels using CUDA.
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 CUDA kernel prototypes
45 *============================================================================*/
46
47#if defined(__CUDACC__)
48
49#endif /* defined(__CUDACC__) */
50
51/*============================================================================
52 * Public function prototypes
53 *============================================================================*/
54
55/*----------------------------------------------------------------------------*/
61/*----------------------------------------------------------------------------*/
62
63extern "C" void
65
66#if defined(__CUDACC__)
67
68/*----------------------------------------------------------------------------*/
79/*----------------------------------------------------------------------------*/
80
81extern "C" void
82cs_matrix_spmv_cuda_set_stream(cudaStream_t stream);
83
84/*----------------------------------------------------------------------------*/
90/*----------------------------------------------------------------------------*/
91
92extern "C" cudaStream_t
93cs_matrix_spmv_cuda_get_stream(void);
94
95#endif /* defined(__CUDACC__) */
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_CUSPARSE)
136
137/*----------------------------------------------------------------------------*/
147/*----------------------------------------------------------------------------*/
148
149extern "C" void
150cs_matrix_spmv_cuda_csr_cusparse(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_CUSPARSE) */
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_CUSPARSE)
178
179/*----------------------------------------------------------------------------*/
189/*----------------------------------------------------------------------------*/
190
191extern "C" void
192cs_matrix_spmv_cuda_msr_cusparse(cs_matrix_t *matrix,
193 bool exclude_diag,
194 bool sync,
195 cs_real_t d_x[],
196 cs_real_t d_y[]);
197
198#endif /* defined(HAVE_CUSPARSE) */
199
200/*----------------------------------------------------------------------------*/
211/*----------------------------------------------------------------------------*/
212
213extern "C" void
215 bool exclude_diag,
216 bool sync,
217 cs_real_t d_x[],
218 cs_real_t d_y[]);
219
220#if defined(HAVE_CUSPARSE)
221
222/*----------------------------------------------------------------------------*/
238/*----------------------------------------------------------------------------*/
239
240extern "C" void
241cs_matrix_spmv_cuda_msr_b_cusparse(cs_matrix_t *matrix,
242 bool exclude_diag,
243 bool sync,
244 cs_real_t d_x[],
245 cs_real_t d_y[]);
246
247#endif /* defined(HAVE_CUSPARSE) */
248
249/*----------------------------------------------------------------------------*/
265/*----------------------------------------------------------------------------*/
266
267extern "C" void
269 bool exclude_diag,
270 bool sync,
271 cs_real_t d_x[],
272 cs_real_t d_y[]);
273
274/*----------------------------------------------------------------------------*/
275
276#endif /* CS_MATRIX_SPMV__CUDA_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_cuda_msr_bb_cusparse(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 cuSPARSE version.
void cs_matrix_spmv_cuda_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 CUDA version.
void cs_matrix_spmv_cuda_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 CUDA version.
void cs_matrix_spmv_cuda_finalize(void)
Finalize CUDA matrix API.
void cs_matrix_spmv_cuda_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 CUDA version.
void cs_matrix_spmv_cuda_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 CUDA version.