ASL
0.1.7
Advanced Simulation Library
src
acl
Kernels
aclExpressionContainer.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 ACLEXPRESSIONCONTAINER_H
25
#define ACLEXPRESSIONCONTAINER_H
26
27
#include <vector>
28
#include <memory>
29
//#include <CL/cl.hpp>
30
// Supply "cl.hpp" with ASL, since it is not present in OpenCL 2.0
31
// Remove the file after switching to OpenCL 2.1
32
#include "
acl/cl.hpp
"
33
34
35
namespace
acl
36
{
37
38
typedef
std::shared_ptr<cl::CommandQueue>
CommandQueue
;
39
40
class
ElementBase;
41
typedef
std::shared_ptr<ElementBase>
Element
;
42
43
class
ExpressionContainer
44
{
45
protected
:
46
unsigned
int
size
;
//< initialized with 0, is overidden by first addExpression()
47
CommandQueue
queue
;
48
bool
regenerateKernelSource
;
49
public
:
50
std::vector<Element>
expression
;
51
protected
:
52
std::vector<Element>
arguments
;
53
std::vector<Element>
localDeclarations
;
54
void
filterDeclarations
();
55
public
:
56
ExpressionContainer
();
57
void
addExpression
(
Element
expression_);
58
unsigned
int
getSize
();
59
inline
const
CommandQueue
getQueue
()
const
;
60
};
61
62
63
//------------------------------ Imlementation --------------------
64
65
inline
const
CommandQueue
ExpressionContainer::getQueue
()
const
66
{
67
return
queue
;
68
}
69
70
}
// namespace acl
71
72
#endif // ACLEXPRESSIONCONTAINER_H
acl::ExpressionContainer::getQueue
const CommandQueue getQueue() const
Definition:
aclExpressionContainer.h:65
acl::ExpressionContainer::addExpression
void addExpression(Element expression_)
acl::ExpressionContainer::regenerateKernelSource
bool regenerateKernelSource
Definition:
aclExpressionContainer.h:48
acl::ExpressionContainer
Definition:
aclExpressionContainer.h:44
acl::CommandQueue
std::shared_ptr< cl::CommandQueue > CommandQueue
Definition:
acl.h:51
acl::ExpressionContainer::size
unsigned int size
Definition:
aclExpressionContainer.h:46
acl::ExpressionContainer::arguments
std::vector< Element > arguments
Definition:
aclExpressionContainer.h:52
acl::ExpressionContainer::queue
CommandQueue queue
Definition:
aclExpressionContainer.h:47
acl::ExpressionContainer::ExpressionContainer
ExpressionContainer()
acl::ExpressionContainer::getSize
unsigned int getSize()
acl::Element
std::shared_ptr< ElementBase > Element
Definition:
acl.h:49
cl.hpp
C++ bindings for OpenCL 1.0 (rev 48), OpenCL 1.1 (rev 33) and OpenCL 1.2 (rev 15)
acl::ExpressionContainer::expression
std::vector< Element > expression
Definition:
aclExpressionContainer.h:50
acl
Advanced Computational Language.
Definition:
acl.h:41
acl::ExpressionContainer::filterDeclarations
void filterDeclarations()
acl::ExpressionContainer::localDeclarations
std::vector< Element > localDeclarations
Definition:
aclExpressionContainer.h:53
Generated by
1.8.20