My Project
openclKernels.hpp
1 /*
2  Copyright 2020 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 OPENCL_HPP
21 #define OPENCL_HPP
22 
23 #include <string>
24 
25 #include <opm/simulators/linalg/bda/opencl.hpp>
26 
27 namespace bda
28 {
29 
30 using spmv_kernel_type = cl::KernelFunctor<cl::Buffer&, cl::Buffer&, cl::Buffer&, const unsigned int,
31  cl::Buffer&, cl::Buffer&, const unsigned int, cl::LocalSpaceArg>;
32 using ilu_apply1_kernel_type = cl::KernelFunctor<cl::Buffer&, cl::Buffer&, cl::Buffer&, cl::Buffer&, cl::Buffer&,
33  cl::Buffer&, cl::Buffer&, const unsigned int, const unsigned int, cl::LocalSpaceArg>;
34 using ilu_apply2_kernel_type = cl::KernelFunctor<cl::Buffer&, cl::Buffer&, cl::Buffer&, cl::Buffer&, cl::Buffer&,
35  cl::Buffer&, cl::Buffer&, const unsigned int, const unsigned int, cl::LocalSpaceArg>;
36 using stdwell_apply_kernel_type = cl::KernelFunctor<cl::Buffer&, cl::Buffer&, cl::Buffer&, cl::Buffer&,
37  cl::Buffer&, cl::Buffer&, cl::Buffer&, cl::Buffer&,
38  const unsigned int, const unsigned int, cl::Buffer&,
39  cl::LocalSpaceArg, cl::LocalSpaceArg, cl::LocalSpaceArg>;
40 using stdwell_apply_no_reorder_kernel_type = cl::KernelFunctor<cl::Buffer&, cl::Buffer&, cl::Buffer&, cl::Buffer&,
41  cl::Buffer&, cl::Buffer&, cl::Buffer&,
42  const unsigned int, const unsigned int, cl::Buffer&,
43  cl::LocalSpaceArg, cl::LocalSpaceArg, cl::LocalSpaceArg>;
44 using ilu_decomp_kernel_type = cl::KernelFunctor<const unsigned int, const unsigned int, cl::Buffer&, cl::Buffer&,
45  cl::Buffer&, cl::Buffer&, cl::Buffer&, const int, cl::LocalSpaceArg>;
46 
49  std::string get_axpy_string();
50 
53  std::string get_scale_string();
54 
57  std::string get_dot_1_string();
58 
61  std::string get_norm_string();
62 
66  std::string get_custom_string();
67 
72  std::string get_spmv_blocked_string();
73 
79  std::string get_ILU_apply1_string(bool full_matrix);
80 
86  std::string get_ILU_apply2_string(bool full_matrix);
87 
92  std::string get_stdwell_apply_string(bool reorder);
93 
96  std::string get_ilu_decomp_string();
97 
98 } // end namespace bda
99 
100 #endif