BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
fspblas.hpp
Go to the documentation of this file.
1/*
2 * BELFEM -- The Berkeley Lab Finite Element Framework
3 * Copyright (c) 2026, The Regents of the University of California,
4 * through Lawrence Berkeley National Laboratory (subject to receipt of any required
5 * approvals from the U.S. Dept. of Energy). All rights reserved.
6 *
7 * Developers: Christian Messe, Gregory Giard
8 *
9 * See the top-level LICENSE file for the complete license and disclaimer.
10 */
11
12#ifndef BELFEM_FSPBLAS_HPP
13#define BELFEM_FSPBLAS_HPP
14#include "typedefs.hpp"
15
16// sparse matrix-vector kernels ( splinalg.f90 ); base-agnostic - the
17// caller passes the indexing base ( pointers[ 0 ], 0 or 1 ) and the
18// kernel shifts internally, so a matvec never rewrites the matrix.
19// They overwrite y, so scaling with alpha and beta is handled by the caller
20
21#ifdef __cplusplus
22extern"C" {
23#endif
24
25 void
27 const belfem::int_t * n,
28 const belfem::int_t * m,
29 const belfem::int_t * nnz,
30 const belfem::real * values,
31 const belfem::int_t * indices,
32 const belfem::int_t * pointers,
33 const belfem::real * x,
34 belfem::real * y,
35 const belfem::int_t * base
36 );
37
38 void
40 const belfem::int_t * n,
41 const belfem::int_t * m,
42 const belfem::int_t * nnz,
43 const belfem::real * values,
44 const belfem::int_t * indices,
45 const belfem::int_t * pointers,
46 const belfem::real * x,
47 belfem::real * y,
48 const belfem::int_t * base
49 );
50
51#ifdef __cplusplus
52}
53#endif
54
55// for the extended product y = alpha * op(A) * x + beta * y, MKL's
56// Inspector-Executor sparse BLAS is used when available ( the classic
57// NIST-style mkl_dcscmm / mkl_dcsrmm was removed in oneMKL 2026 )
58#ifdef BELFEM_MKL
59#include <mkl_spblas.h>
60#endif
61
62#endif //BELFEM_FSPBLAS_HPP
void matvec_csr(const belfem::int_t *n, const belfem::int_t *m, const belfem::int_t *nnz, const belfem::real *values, const belfem::int_t *indices, const belfem::int_t *pointers, const belfem::real *x, belfem::real *y, const belfem::int_t *base)
void matvec_csc(const belfem::int_t *n, const belfem::int_t *m, const belfem::int_t *nnz, const belfem::real *values, const belfem::int_t *indices, const belfem::int_t *pointers, const belfem::real *x, belfem::real *y, const belfem::int_t *base)
double real
Definition typedefs.hpp:36
int32_t int_t
Definition typedefs.hpp:51