AQUAgpusph 5.0.4
Loading...
Searching...
No Matches
Sort.hpp
Go to the documentation of this file.
1/*
2 * This file is part of AQUAgpusph, a free CFD program based on SPH.
3 * Copyright (C) 2012 Jose Luis Cercos Pita <jl.cercos@upm.es>
4 *
5 * AQUAgpusph is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * AQUAgpusph is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with AQUAgpusph. If not, see <http://www.gnu.org/licenses/>.
17 */
18
26
27#ifndef SORT_H_INCLUDED
28#define SORT_H_INCLUDED
29
31#include "CalcServer.hpp"
32#include "Tool.hpp"
33#include "Kernel.hpp"
34
35namespace Aqua {
36namespace CalcServer {
37
48{
49 public:
58 Sort(const std::string tool_name,
59 const std::string variable = "icell",
60 const std::string permutations = "id_unsorted",
61 const std::string inv_permutations = "id_sorted",
62 bool once = false);
63
66 ~Sort();
67
70 void setup();
71
72 protected:
77 cl_event _execute(const std::vector<cl_event> events);
78
79 private:
82 void variables();
83
86 void setupOpenCL();
87
94 std::vector<cl_kernel> compileOpenCL();
95
98 void setupMems();
99
102 void setupArgs();
103
105 std::string _var_name;
106
108 std::string _perms_name;
109
111 std::string _inv_perms_name;
112
115
118
120 InputOutput::ArrayVariable* _inv_perms;
121
123 size_t _n;
124
126 size_t _n_padded;
127
129 std::string _var_type;
130
132 std::string _var_max;
133
135 cl_kernel _init_kernel;
137 cl_kernel _start_kernel;
139 cl_kernel _local_kernel;
141 cl_kernel _global_kernel;
143 cl_kernel _inv_perms_kernel;
144
146 cl_mem _vals;
148 cl_mem _permut;
149
156 size_t _local_work_size;
159 size_t _global_work_size;
160};
161
162}
163} // namespace
164
165#endif // SORT_H_INCLUDED
The calculation main entry point. (See Aqua::CalcServer::CalcServer for details)
OpenCL kernel kernel based tool. (see Aqua::CalcServer::Kernel for details)
Tools virtual environment to allow the user to define/manipulate the tools used to carry out the simu...
Sort(const std::string tool_name, const std::string variable="icell", const std::string permutations="id_unsorted", const std::string inv_permutations="id_sorted", bool once=false)
Definition Sort.cpp:42
~Sort()
Definition Sort.cpp:73
cl_event _execute(const std::vector< cl_event > events)
Definition Sort.cpp:108
void setup()
Definition Sort.cpp:92
Tools base class.
Definition Tool.hpp:176
An array variable.
Definition Variable.hpp:894
Calculation server name space.
Definition Assert.cpp:32
Main AQUAgpusph namespace.
Definition ArgumentsManager.cpp:50
Set of definitions and macros related with the implementation.