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
29
30namespace Opm
31{
32
34{
35private:
36 hipStream_t stream;
37
38public:
39 void apply_stdwells(double *d_x, double *d_y);
40 void apply_mswells(double *d_x, double *d_y);
41 void apply(double *d_x, double *d_y);
42 void setStream(hipStream_t stream);
43
44protected:
46 void APIalloc() override;
47
48 void APIaddMatrix(MatrixType type, int *colIndices, double *values, unsigned int val_size) override;
49
53
54 std::vector<double> h_x;
55 std::vector<double> h_y;
56};
57
58} //namespace Opm
59
60#endif
Definition: WellContributions.hpp:52
MatrixType
StandardWell has C, D and B matrices that need to be copied.
Definition: WellContributions.hpp:58
Definition: rocsparseWellContributions.hpp:34
double * d_Dnnzs_hip
Definition: rocsparseWellContributions.hpp:50
void apply(double *d_x, double *d_y)
void APIaddMatrix(MatrixType type, int *colIndices, double *values, unsigned int val_size) override
Api specific upload of matrix.
void setStream(hipStream_t stream)
void APIalloc() override
Allocate memory for the StandardWells.
void apply_stdwells(double *d_x, double *d_y)
std::vector< double > h_y
Definition: rocsparseWellContributions.hpp:55
void apply_mswells(double *d_x, double *d_y)
unsigned * d_Ccols_hip
Definition: rocsparseWellContributions.hpp:51
std::vector< double > h_x
Definition: rocsparseWellContributions.hpp:54
double * d_Bnnzs_hip
Definition: rocsparseWellContributions.hpp:50
double * d_Cnnzs_hip
Definition: rocsparseWellContributions.hpp:50
unsigned * d_Bcols_hip
Definition: rocsparseWellContributions.hpp:51
unsigned * d_val_pointers_hip
Definition: rocsparseWellContributions.hpp:52
Definition: BlackoilPhases.hpp:27