ASL
0.1.7
Advanced Simulation Library
Toggle main menu visibility
Loading...
Searching...
No Matches
src
acl
aclMath
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
27
#include "
aclVectorOfElementsDef.h
"
28
#include <
math/aslVectors.h
>
29
#include <
utilities/aslUValue.h
>
30
31
32
namespace
acl
33
{
34
class
Kernel
;
35
enum
ReductionOperatorType
{
ROT_SUM
,
ROT_PRODUCT
,
ROT_MINIMUM
,
ROT_MAXIMUM
};
36
38
41
template
<
typename
ResType, enum ReductionOperatorType Op>
class
ReductionAlgGenerator
42
{
43
private
:
44
VectorOfElements
ve;
45
unsigned
int
nGroups;
46
unsigned
int
nLocal;
47
public
:
48
asl::UValue<asl::AVec<ResType>
>
res
;
49
private
:
50
std::vector<std::vector<ResType>> groupRes;
51
VectorOfElementsData
groupResACL;
52
53
shared_ptr<Kernel> kernel;
54
55
public
:
56
ReductionAlgGenerator
(
VectorOfElements
v);
57
void
compute
();
58
void
generateAlg
(
Kernel
& k);
59
void
generateAlg
();
60
};
61
62
template
<
typename
ResType> std::shared_ptr<ReductionAlgGenerator<ResType, ROT_SUM>>
63
generateSumAlg
(
VectorOfElements
v);
64
65
template
<
typename
ResType> std::shared_ptr<ReductionAlgGenerator<ResType, ROT_MINIMUM>>
66
generateMinAlg
(
VectorOfElements
v);
67
68
template
<
typename
ResType> std::shared_ptr<ReductionAlgGenerator<ResType, ROT_MAXIMUM>>
69
generateMaxAlg
(
VectorOfElements
v);
70
71
template
<
typename
ResType> std::shared_ptr<ReductionAlgGenerator<ResType, ROT_PRODUCT>>
72
generateProductAlg
(
VectorOfElements
v);
73
74
75
}
//namespace acl
76
77
#endif
// ACLREDUCTIONALGGENERATUR_H
aclVectorOfElementsDef.h
aslUValue.h
aslVectors.h
definition of class АVec<T>
acl::Kernel
OpenCl Kernel generator.
Definition
aclKernel.h:49
acl::ReductionAlgGenerator::generateAlg
void generateAlg()
acl::ReductionAlgGenerator::ReductionAlgGenerator
ReductionAlgGenerator(VectorOfElements v)
acl::ReductionAlgGenerator::generateAlg
void generateAlg(Kernel &k)
acl::ReductionAlgGenerator::res
asl::UValue< asl::AVec< ResType > > res
Definition
aclReductionAlgGenerator.h:48
acl::ReductionAlgGenerator::compute
void compute()
acl::VectorOfElementsData
The class represents several ElementData.
Definition
aclVectorOfElementsDef.h:57
acl::VectorOfElements
The class represents several Element.
Definition
aclVectorOfElementsDef.h:92
asl::UValue
Updatable value. This class stores value and its TimeStamp.
Definition
aslUValue.h:35
acl
Advanced Computational Language.
Definition
acl.h:41
acl::generateSumAlg
std::shared_ptr< ReductionAlgGenerator< ResType, ROT_SUM > > generateSumAlg(VectorOfElements v)
acl::generateProductAlg
std::shared_ptr< ReductionAlgGenerator< ResType, ROT_PRODUCT > > generateProductAlg(VectorOfElements v)
acl::ReductionOperatorType
ReductionOperatorType
Definition
aclReductionAlgGenerator.h:35
acl::ROT_PRODUCT
@ ROT_PRODUCT
Definition
aclReductionAlgGenerator.h:35
acl::ROT_MINIMUM
@ ROT_MINIMUM
Definition
aclReductionAlgGenerator.h:35
acl::ROT_SUM
@ ROT_SUM
Definition
aclReductionAlgGenerator.h:35
acl::ROT_MAXIMUM
@ ROT_MAXIMUM
Definition
aclReductionAlgGenerator.h:35
acl::generateMaxAlg
std::shared_ptr< ReductionAlgGenerator< ResType, ROT_MAXIMUM > > generateMaxAlg(VectorOfElements v)
acl::generateMinAlg
std::shared_ptr< ReductionAlgGenerator< ResType, ROT_MINIMUM > > generateMinAlg(VectorOfElements v)
Generated by
1.17.0