ASL
0.1.7
Advanced Simulation Library
Toggle main menu visibility
Loading...
Searching...
No Matches
src
acl
aclMath
aclVectorOfElementsDef.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 ACLVECTORELEMENTSDEF_H
25
#define ACLVECTORELEMENTSDEF_H
26
27
#include <memory>
28
#include <vector>
29
#include "
../aclTypes.h
"
30
31
using namespace
std
;
32
33
namespace
cl
34
{
35
class
CommandQueue
;
36
}
37
38
namespace
acl
39
{
40
41
class
ElementBase
;
42
class
MemBlock
;
43
44
typedef
std::shared_ptr<ElementBase>
Element
;
45
typedef
std::shared_ptr<MemBlock>
ElementData
;
46
47
class
VectorOfElements
;
48
typedef
std::shared_ptr<cl::CommandQueue>
CommandQueue
;
49
51
56
class
VectorOfElementsData
:
public
std::vector<ElementData>
57
{
60
bool
checkCompatibility()
const
;
61
public
:
63
bool
checkSizesCompatibility
(
unsigned
int
n)
const
;
64
VectorOfElementsData
();
65
explicit
VectorOfElementsData
(
unsigned
int
n);
72
template
<
typename
T>
VectorOfElementsData
(
unsigned
int
n,
73
unsigned
int
s,
74
T);
75
template
<
typename
T>
VectorOfElementsData
(
unsigned
int
n,
76
unsigned
int
s,
77
T,
78
CommandQueue
queue);
79
80
VectorOfElements
operator=
(
const
VectorOfElements
& a)
const
;
81
VectorOfElements
operator=
(
const
VectorOfElementsData
& a)
const
;
82
void
resizeElements
(
unsigned
int
n);
83
};
84
86
91
class
VectorOfElements
:
public
std::vector<Element>
92
{
95
bool
checkCompatibility()
const
;
96
public
:
98
bool
checkSizesCompatibility
(
unsigned
int
n)
const
;
99
VectorOfElements
();
100
explicit
VectorOfElements
(
unsigned
int
n);
101
VectorOfElements
(
const
VectorOfElementsData
& a);
102
VectorOfElements
operator=
(
const
VectorOfElements
& a)
const
;
103
};
104
105
typedef
shared_ptr<VectorOfElementsData>
SPVectorOfElementsData
;
106
typedef
shared_ptr<VectorOfElements>
SPVectorOfElements
;
107
108
inline
bool
compatibleSizes
(
unsigned
int
s,
const
VectorOfElements
& a);
109
111
acl::TypeID
getElementType
(
const
VectorOfElements
& a,
unsigned
int
i = 0);
112
114
unsigned
int
getElementsSize
(
const
VectorOfElements
& a);
115
116
//------------------------- Implementation -----------------
117
118
inline
bool
compatibleSizes
(
unsigned
int
s,
const
VectorOfElements
& a)
119
{
120
return
a.
checkSizesCompatibility
(s);
121
}
122
123
124
}
// namespace acl
125
126
#endif
// ACLVECTORELEMENTSDEF_H
aclTypes.h
acl::ElementBase
Definition
aclElementBase.h:50
acl::MemBlock
Definition
aclMemBlock.h:40
acl::VectorOfElementsData
The class represents several ElementData.
Definition
aclVectorOfElementsDef.h:57
acl::VectorOfElementsData::VectorOfElementsData
VectorOfElementsData(unsigned int n)
acl::VectorOfElementsData::resizeElements
void resizeElements(unsigned int n)
acl::VectorOfElementsData::VectorOfElementsData
VectorOfElementsData(unsigned int n, unsigned int s, T, CommandQueue queue)
acl::VectorOfElementsData::checkSizesCompatibility
bool checkSizesCompatibility(unsigned int n) const
checks whether all Elements have sizes compatible with n
acl::VectorOfElementsData::VectorOfElementsData
VectorOfElementsData(unsigned int n, unsigned int s, T)
acl::VectorOfElementsData::operator=
VectorOfElements operator=(const VectorOfElementsData &a) const
acl::VectorOfElementsData::operator=
VectorOfElements operator=(const VectorOfElements &a) const
acl::VectorOfElementsData::VectorOfElementsData
VectorOfElementsData()
acl::VectorOfElements
The class represents several Element.
Definition
aclVectorOfElementsDef.h:92
acl::VectorOfElements::VectorOfElements
VectorOfElements(unsigned int n)
acl::VectorOfElements::getElementType
acl::TypeID getElementType(const VectorOfElements &a, unsigned int i=0)
acl::VectorOfElements::VectorOfElements
VectorOfElements()
acl::VectorOfElements::operator=
VectorOfElements operator=(const VectorOfElements &a) const
acl::VectorOfElements::VectorOfElements
VectorOfElements(const VectorOfElementsData &a)
acl::VectorOfElements::checkSizesCompatibility
bool checkSizesCompatibility(unsigned int n) const
checks whether all Elements have sizes compatible with n
acl::VectorOfElements::getElementsSize
unsigned int getElementsSize(const VectorOfElements &a)
cl::CommandQueue
CommandQueue interface for cl_command_queue.
Definition
cl.hpp:5355
acl
Advanced Computational Language.
Definition
acl.h:41
acl::SPVectorOfElementsData
shared_ptr< VectorOfElementsData > SPVectorOfElementsData
Definition
aclVectorOfElementsDef.h:105
acl::CommandQueue
std::shared_ptr< cl::CommandQueue > CommandQueue
Definition
acl.h:51
acl::TypeID
TypeID
Definition
aclTypes.h:39
acl::compatibleSizes
bool compatibleSizes(unsigned int s, const VectorOfElements &a)
Definition
aclVectorOfElementsDef.h:118
acl::ElementData
std::shared_ptr< MemBlock > ElementData
Definition
acl.h:48
acl::SPVectorOfElements
shared_ptr< VectorOfElements > SPVectorOfElements
Definition
aclVectorOfElementsDef.h:106
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