ASL 0.1.7
Advanced Simulation Library
Loading...
Searching...
No Matches
aclReductionAlgGenerator.h
Go to the documentation of this file.
1/*
2 * Advanced Simulation Library <http://asl.org.il>
3 *
4 * Copyright 2015 Avtech Scientific <http://avtechscientific.com>
5 *
6 *
7 * This file is part of Advanced Simulation Library (ASL).
8 *
9 * ASL is free software: you can redistribute it and/or modify it
10 * under the terms of the GNU Affero General Public License as
11 * published by the Free Software Foundation, version 3 of the License.
12 *
13 * ASL is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Affero General Public License for more details.
17 *
18 * You should have received a copy of the GNU Affero General Public License
19 * along with ASL. If not, see <http://www.gnu.org/licenses/>.
20 *
21 */
22
23
24#ifndef ACLREDUCTIONALGGENERATUR_H
25#define ACLREDUCTIONALGGENERATUR_H
26
28#include <math/aslVectors.h>
29#include <utilities/aslUValue.h>
30
31
32namespace acl
33{
34 class Kernel;
36
38
41 template <typename ResType, enum ReductionOperatorType Op> class ReductionAlgGenerator
42 {
43 private:
45 unsigned int nGroups;
46 unsigned int nLocal;
47 public:
49 private:
50 std::vector<std::vector<ResType>> groupRes;
51 VectorOfElementsData groupResACL;
52
53 shared_ptr<Kernel> kernel;
54
55 public:
57 void compute();
60 };
61
62 template <typename ResType> std::shared_ptr<ReductionAlgGenerator<ResType, ROT_SUM>>
64
65 template <typename ResType> std::shared_ptr<ReductionAlgGenerator<ResType, ROT_MINIMUM>>
67
68 template <typename ResType> std::shared_ptr<ReductionAlgGenerator<ResType, ROT_MAXIMUM>>
70
71 template <typename ResType> std::shared_ptr<ReductionAlgGenerator<ResType, ROT_PRODUCT>>
73
74
75} //namespace acl
76
77#endif // ACLREDUCTIONALGGENERATUR_H
definition of class АVec<T>
OpenCl Kernel generator.
Definition aclKernel.h:49
The class generates code corresponding to a reduction operation of elements.
ReductionAlgGenerator(VectorOfElements v)
void generateAlg(Kernel &k)
asl::UValue< asl::AVec< ResType > > res
The class represents several ElementData.
The class represents several Element.
Updatable value. This class stores value and its TimeStamp.
Definition aslUValue.h:35
Advanced Computational Language.
Definition acl.h:41
std::shared_ptr< ReductionAlgGenerator< ResType, ROT_SUM > > generateSumAlg(VectorOfElements v)
std::shared_ptr< ReductionAlgGenerator< ResType, ROT_PRODUCT > > generateProductAlg(VectorOfElements v)
std::shared_ptr< ReductionAlgGenerator< ResType, ROT_MAXIMUM > > generateMaxAlg(VectorOfElements v)
std::shared_ptr< ReductionAlgGenerator< ResType, ROT_MINIMUM > > generateMinAlg(VectorOfElements v)