8.3
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-2024 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 "cs_defs.h"
35
36/*----------------------------------------------------------------------------*/
37
39
40/*----------------------------------------------------------------------------*/
45/*----------------------------------------------------------------------------*/
46
47/*============================================================================
48 * Public CUDA kernel prototypes
49 *============================================================================*/
50
51#if defined(__CUDACC__)
52
53#endif /* defined(__CUDACC__) */
54
55/*============================================================================
56 * Public function prototypes
57 *============================================================================*/
58
59/*----------------------------------------------------------------------------*/
65/*----------------------------------------------------------------------------*/
66
67void
69
70#if defined(__CUDACC__)
71
72/*----------------------------------------------------------------------------*/
83/*----------------------------------------------------------------------------*/
84
85void
86cs_matrix_spmv_cuda_set_stream(cudaStream_t stream);
87
88/*----------------------------------------------------------------------------*/
94/*----------------------------------------------------------------------------*/
95
96cudaStream_t
97cs_matrix_spmv_cuda_get_stream(void);
98
99#endif /* defined(__CUDACC__) */
100
101/*----------------------------------------------------------------------------*/
111/*----------------------------------------------------------------------------*/
112
113void
115 bool exclude_diag,
116 bool sync,
117 cs_real_t d_x[],
118 cs_real_t d_y[]);
119
120/*----------------------------------------------------------------------------*/
130/*----------------------------------------------------------------------------*/
131
132void
134 bool exclude_diag,
135 bool sync,
136 cs_real_t d_x[],
137 cs_real_t d_y[]);
138
139/*----------------------------------------------------------------------------*/
149/*----------------------------------------------------------------------------*/
150
151void
153 bool exclude_diag,
154 bool sync,
155 cs_real_t d_x[],
156 cs_real_t d_y[]);
157
158/*----------------------------------------------------------------------------*/
168/*----------------------------------------------------------------------------*/
169
170void
172 bool exclude_diag,
173 bool sync,
174 cs_real_t d_x[],
175 cs_real_t d_y[]);
176
177/*----------------------------------------------------------------------------*/
187/*----------------------------------------------------------------------------*/
188
189void
191 bool exclude_diag,
192 bool sync,
193 cs_real_t d_x[],
194 cs_real_t d_y[]);
195
196/*----------------------------------------------------------------------------*/
207/*----------------------------------------------------------------------------*/
208
209void
211 bool exclude_diag,
212 bool sync,
213 cs_real_t d_x[],
214 cs_real_t d_y[]);
215
216#if defined(HAVE_CUSPARSE_GENERIC_API)
217
218/*----------------------------------------------------------------------------*/
234/*----------------------------------------------------------------------------*/
235
236void
237cs_matrix_spmv_cuda_msr_b_cusparse(cs_matrix_t *matrix,
238 bool exclude_diag,
239 bool sync,
240 cs_real_t d_x[],
241 cs_real_t d_y[]);
242
243#endif /* defined(HAVE_CUSPARSE_GENERIC_API) */
244
245/*----------------------------------------------------------------------------*/
261/*----------------------------------------------------------------------------*/
262
263void
265 bool exclude_diag,
266 bool sync,
267 cs_real_t d_x[],
268 cs_real_t d_y[]);
269
270/*----------------------------------------------------------------------------*/
271
273
274#endif /* __CS_MATRIX_SPMV__CUDA_H__ */
#define BEGIN_C_DECLS
Definition: cs_defs.h:542
double cs_real_t
Floating-point value.
Definition: cs_defs.h:342
#define END_C_DECLS
Definition: cs_defs.h:543
struct _cs_matrix_t cs_matrix_t
Definition: cs_matrix.h:110
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_csr_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 CSR matrix, scalar cuSPARSE 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_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, scalar cuSPARSE version.
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.