ASL
0.1.7
Advanced Simulation Library
Toggle main menu visibility
Loading...
Searching...
No Matches
src
acl
aclElementBase.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 ACLELEMENTBASE_H
25
#define ACLELEMENTBASE_H
26
27
#include "
aclStdIncludes.h
"
28
//#include "aclHardware.h"
29
#include "
Kernels/aclKernelConfiguration.h
"
30
#include <memory>
31
#include "
aclTypes.h
"
32
33
namespace
cl
34
{
35
class
CommandQueue
;
36
class
Kernel
;
37
}
38
39
namespace
acl
40
{
41
typedef
std::shared_ptr<cl::CommandQueue>
CommandQueue
;
42
43
// GLOBALS
44
extern
const
std::string
INDEX
;
45
extern
const
KernelConfiguration
KERNEL_BASIC
;
46
47
using namespace
std
;
48
49
class
ElementBase
50
{
51
protected
:
52
unsigned
int
size
;
53
TypeID
typeID
;
54
CommandQueue
queue
;
55
ElementBase
(
bool
isWritable_,
unsigned
int
size_,
TypeID
typeID_);
56
public
:
57
const
bool
isWritable
;
58
virtual
string
str
(
const
KernelConfiguration
& kernelConfig =
KERNEL_BASIC
)
const
= 0;
59
virtual
string
getName
()
const
= 0;
60
virtual
string
getAddressSpaceQualifier
()
const
;
61
unsigned
int
getSize
()
const
;
62
CommandQueue
getQueue
()
const
;
63
TypeID
getTypeID
()
const
;
64
virtual
string
getTypeSignature
(
const
KernelConfiguration
& kernelConfig =
KERNEL_BASIC
)
const
= 0;
65
virtual
string
getLocalDeclaration
(
const
KernelConfiguration
& kernelConfig =
KERNEL_BASIC
)
const
= 0;
67
virtual
void
addToKernelSource
(vector<shared_ptr<ElementBase> > & arguments,
68
vector<shared_ptr<ElementBase> > & localDeclarations)
const
= 0;
69
70
virtual
void
setAsArgument
(
cl::Kernel
& kernel,
unsigned
int
argumentIndex)
const
= 0;
71
virtual
~ElementBase
();
72
};
73
74
typedef
std::shared_ptr<ElementBase>
Element
;
75
76
}
// namespace acl
77
#endif
// ACLELEMENTBASE_H
aclKernelConfiguration.h
aclStdIncludes.h
aclTypes.h
acl::ElementBase::getTypeID
TypeID getTypeID() const
acl::ElementBase::addToKernelSource
virtual void addToKernelSource(vector< shared_ptr< ElementBase > > &arguments, vector< shared_ptr< ElementBase > > &localDeclarations) const =0
Adds ElementBase to the kernel source either as an argument or as a local declaration.
acl::ElementBase::str
virtual string str(const KernelConfiguration &kernelConfig=KERNEL_BASIC) const =0
acl::ElementBase::ElementBase
ElementBase(bool isWritable_, unsigned int size_, TypeID typeID_)
acl::ElementBase::getQueue
CommandQueue getQueue() const
acl::ElementBase::typeID
TypeID typeID
Definition
aclElementBase.h:53
acl::ElementBase::queue
CommandQueue queue
Definition
aclElementBase.h:54
acl::ElementBase::getLocalDeclaration
virtual string getLocalDeclaration(const KernelConfiguration &kernelConfig=KERNEL_BASIC) const =0
acl::ElementBase::~ElementBase
virtual ~ElementBase()
acl::ElementBase::getTypeSignature
virtual string getTypeSignature(const KernelConfiguration &kernelConfig=KERNEL_BASIC) const =0
acl::ElementBase::isWritable
const bool isWritable
Definition
aclElementBase.h:57
acl::ElementBase::setAsArgument
virtual void setAsArgument(cl::Kernel &kernel, unsigned int argumentIndex) const =0
acl::ElementBase::getAddressSpaceQualifier
virtual string getAddressSpaceQualifier() const
acl::ElementBase::size
unsigned int size
Definition
aclElementBase.h:52
acl::ElementBase::getName
virtual string getName() const =0
acl::ElementBase::getSize
unsigned int getSize() const
acl::KernelConfiguration
ACL Kernel configuration class.
Definition
aclKernelConfiguration.h:35
cl::CommandQueue
CommandQueue interface for cl_command_queue.
Definition
cl.hpp:5355
cl::Kernel
Class interface for cl_kernel.
Definition
cl.hpp:4722
acl::KERNEL_BASIC
const KernelConfiguration KERNEL_BASIC
Definition
aclElementBase.h:45
acl
Advanced Computational Language.
Definition
acl.h:41
acl::INDEX
const std::string INDEX
Definition
aclUtilities.h:39
acl::CommandQueue
std::shared_ptr< cl::CommandQueue > CommandQueue
Definition
acl.h:51
acl::TypeID
TypeID
Definition
aclTypes.h:39
acl::Element
std::shared_ptr< ElementBase > Element
Definition
acl.h:49
cl
The OpenCL C++ bindings are defined within this namespace.
Definition
acl.h:34
std
STL namespace.
Generated by
1.17.0