rocsparseWellContributions.hpp
Go to the documentation of this file.
1/*
2 Copyright 2023 Equinor ASA
3
4 This file is part of the Open Porous Media project (OPM).
5
6 OPM is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 OPM is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with OPM. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#ifndef WELLCONTRIBUTIONS_ROCSPARSE_HEADER_INCLUDED
21#define WELLCONTRIBUTIONS_ROCSPARSE_HEADER_INCLUDED
22
24
25#include <hip/hip_runtime_api.h>
26
27#include <vector>
28
29namespace Opm {
30
31template<class Scalar>
33{
34private:
35 hipStream_t stream;
36
37public:
38 void apply_stdwells(Scalar* d_x, Scalar* d_y);
39 void apply_mswells(Scalar* d_x, Scalar* d_y);
40 void apply(Scalar* d_x, Scalar* d_y);
41 void setStream(hipStream_t stream);
42
43protected:
45 void APIalloc() override;
46
48
49 void APIaddMatrix(MatrixType type, int* colIndices,
50 Scalar* values, unsigned int val_size) override;
51
55
56 std::vector<Scalar> h_x;
57 std::vector<Scalar> h_y;
58};
59
60} //namespace Opm
61
62#endif
Definition: WellContributions.hpp:53
MatrixType
StandardWell has C, D and B matrices that need to be copied.
Definition: WellContributions.hpp:59
Definition: rocsparseWellContributions.hpp:33
void apply_mswells(Scalar *d_x, Scalar *d_y)
Scalar * d_Dnnzs_hip
Definition: rocsparseWellContributions.hpp:52
void apply_stdwells(Scalar *d_x, Scalar *d_y)
Scalar * d_Bnnzs_hip
Definition: rocsparseWellContributions.hpp:52
Scalar * d_Cnnzs_hip
Definition: rocsparseWellContributions.hpp:52
unsigned * d_Bcols_hip
Definition: rocsparseWellContributions.hpp:53
std::vector< Scalar > h_x
Definition: rocsparseWellContributions.hpp:56
void APIaddMatrix(MatrixType type, int *colIndices, Scalar *values, unsigned int val_size) override
Api specific upload of matrix.
unsigned * d_Ccols_hip
Definition: rocsparseWellContributions.hpp:53
void apply(Scalar *d_x, Scalar *d_y)
unsigned * d_val_pointers_hip
Definition: rocsparseWellContributions.hpp:54
std::vector< Scalar > h_y
Definition: rocsparseWellContributions.hpp:57
void APIalloc() override
Allocate memory for the StandardWells.
void setStream(hipStream_t stream)
Definition: blackoilboundaryratevector.hh:37