Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
caddies
caddies-api
Commits
f84f3c86
Commit
f84f3c86
authored
Jul 19, 2016
by
mjg226
Browse files
.
parent
8698635a
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12214 additions
and
11652 deletions
+12214
-11652
impls/square-cell/vn-neighbours/1-levels/opencl/CellBuff.cpp
impls/square-cell/vn-neighbours/1-levels/opencl/CellBuff.cpp
+4
-4
impls/square-cell/vn-neighbours/1-levels/opencl/CellBuff.hpp
impls/square-cell/vn-neighbours/1-levels/opencl/CellBuff.hpp
+4
-2
impls/square-cell/vn-neighbours/1-levels/opencl/EdgeBuff.cpp
impls/square-cell/vn-neighbours/1-levels/opencl/EdgeBuff.cpp
+4
-4
impls/square-cell/vn-neighbours/1-levels/opencl/EdgeBuff.hpp
impls/square-cell/vn-neighbours/1-levels/opencl/EdgeBuff.hpp
+3
-2
impls/square-cell/vn-neighbours/1-levels/opencl/extra/CL/cl.hpp
...square-cell/vn-neighbours/1-levels/opencl/extra/CL/cl.hpp
+12145
-11640
impls/square-cell/vn-neighbours/1-levels/simple/ESRI_ASCIIGrid.hpp
...are-cell/vn-neighbours/1-levels/simple/ESRI_ASCIIGrid.hpp
+54
-0
No files found.
impls/square-cell/vn-neighbours/1-levels/opencl/CellBuff.cpp
View file @
f84f3c86
...
@@ -39,9 +39,9 @@ namespace CA {
...
@@ -39,9 +39,9 @@ namespace CA {
/// ----- Static variables ----- ///
/// ----- Static variables ----- ///
template
<
>
//
template<>
std
::
vector
<
Real
>
CellBuff
<
Real
>::
mem_io
=
std
::
vector
<
Real
>
();
//
std::vector<Real> CellBuff<Real>::mem_io = std::vector<Real>();
template
<
>
//
template<>
std
::
vector
<
State
>
CellBuff
<
State
>::
mem_io
=
std
::
vector
<
State
>
();
//
std::vector<State> CellBuff<State>::mem_io = std::vector<State>();
}
}
impls/square-cell/vn-neighbours/1-levels/opencl/CellBuff.hpp
View file @
f84f3c86
...
@@ -356,7 +356,7 @@ namespace CA {
...
@@ -356,7 +356,7 @@ namespace CA {
cl
::
Kernel
_kernel_copy1DBuffToPLCellBuffState
;
cl
::
Kernel
_kernel_copy1DBuffToPLCellBuffState
;
//! Buffer used for direct I/O.
//! Buffer used for direct I/O.
static
std
::
vector
<
T
>
mem_io
;
std
::
vector
<
T
>
mem_io
;
};
};
...
@@ -380,7 +380,9 @@ namespace CA {
...
@@ -380,7 +380,9 @@ namespace CA {
_kernel_copyPLCellBuffRealTo1DBuff
(),
_kernel_copyPLCellBuffRealTo1DBuff
(),
_kernel_copyPLCellBuffStateTo1DBuff
(),
_kernel_copyPLCellBuffStateTo1DBuff
(),
_kernel_copy1DBuffToPLCellBuffReal
(),
_kernel_copy1DBuffToPLCellBuffReal
(),
_kernel_copy1DBuffToPLCellBuffState
()
_kernel_copy1DBuffToPLCellBuffState
(),
mem_io
()
{
{
// Create the buffer in the device memory of GRID context. The x
// Create the buffer in the device memory of GRID context. The x
// size of the buffer is the stride in order to keep the memory
// size of the buffer is the stride in order to keep the memory
...
...
impls/square-cell/vn-neighbours/1-levels/opencl/EdgeBuff.cpp
View file @
f84f3c86
...
@@ -39,9 +39,9 @@ namespace CA {
...
@@ -39,9 +39,9 @@ namespace CA {
/// ----- Static variables ----- ///
/// ----- Static variables ----- ///
template
<
>
//
template<>
std
::
vector
<
Real
>
EdgeBuff
<
Real
>::
mem_io
=
std
::
vector
<
Real
>
();
//
std::vector<Real> EdgeBuff<Real>::mem_io = std::vector<Real>();
template
<
>
//
template<>
std
::
vector
<
State
>
EdgeBuff
<
State
>::
mem_io
=
std
::
vector
<
State
>
();
//
std::vector<State> EdgeBuff<State>::mem_io = std::vector<State>();
}
}
impls/square-cell/vn-neighbours/1-levels/opencl/EdgeBuff.hpp
View file @
f84f3c86
...
@@ -260,7 +260,7 @@ namespace CA {
...
@@ -260,7 +260,7 @@ namespace CA {
cl
::
Kernel
_kernel_setValueEdgeBuffState
;
cl
::
Kernel
_kernel_setValueEdgeBuffState
;
//! Buffer used for direct I/O.
//! Buffer used for direct I/O.
static
std
::
vector
<
T
>
mem_io
;
std
::
vector
<
T
>
mem_io
;
};
};
...
@@ -278,7 +278,8 @@ namespace CA {
...
@@ -278,7 +278,8 @@ namespace CA {
_buff
(),
_buff
(),
_event
(),
_event
(),
_kernel_setValueEdgeBuffReal
(),
_kernel_setValueEdgeBuffReal
(),
_kernel_setValueEdgeBuffState
()
_kernel_setValueEdgeBuffState
(),
mem_io
()
{
{
// Create the buffer in the device memory of GRID context. The
// Create the buffer in the device memory of GRID context. The
// buffer is the sum of the two sub-buffers. The x size of the
// buffer is the sum of the two sub-buffers. The x size of the
...
...
impls/square-cell/vn-neighbours/1-levels/opencl/extra/CL/cl.hpp
View file @
f84f3c86
This diff is collapsed.
Click to expand it.
impls/square-cell/vn-neighbours/1-levels/simple/ESRI_ASCIIGrid.hpp
View file @
f84f3c86
...
@@ -55,6 +55,12 @@ namespace CA {
...
@@ -55,6 +55,12 @@ namespace CA {
//};
//};
//! Read token and value pair from a line of the header of an ARC/INFO
//! Read token and value pair from a line of the header of an ARC/INFO
//! ASCII GRID file.
//! ASCII GRID file.
template
<
typename
A
>
template
<
typename
A
>
...
@@ -85,6 +91,10 @@ namespace CA {
...
@@ -85,6 +91,10 @@ namespace CA {
// Get starting time.
// Get starting time.
//Clock total_timer;
//Clock total_timer;
//std::cout << "READING DATA!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
// Open file
// Open file
std
::
ifstream
infile
(
filename
.
c_str
());
std
::
ifstream
infile
(
filename
.
c_str
());
...
@@ -880,6 +890,50 @@ namespace CA {
...
@@ -880,6 +890,50 @@ namespace CA {
}
// end of compareAsciiGridHeader
}
// end of compareAsciiGridHeader
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//std::ostream & operator<<(std::ostream & Str, ESRI_ASCIIGrid<CA::Real> const & value) {
inline
std
::
string
getString
(){
// print something from v to str, e.g: Str << v.getX();
std
::
ostringstream
Str
;
std
::
string
output
;
Str
<<
"n cols: "
<<
ncols
<<
std
::
endl
;
Str
<<
"n rows: "
<<
nrows
<<
std
::
endl
;
Str
<<
"xllcorner: "
<<
xllcorner
<<
std
::
endl
;
Str
<<
"yllcorner: "
<<
yllcorner
<<
std
::
endl
;
Str
<<
"no_data: "
<<
nodata
<<
std
::
endl
;
output
=
Str
.
str
();
//return Str;
return
output
;
}
//--------------------------------------------------------------------------------------------------------------
inline
void
copyData
(
ESRI_ASCIIGrid
inGrid
)
{
AsciiGridGeneral
<
T
>::
ncols
=
inGrid
.
ncols
;
AsciiGridGeneral
<
T
>::
nrows
=
inGrid
.
nrows
;
AsciiGridGeneral
<
T
>::
xllcorner
=
inGrid
.
xllcorner
;
AsciiGridGeneral
<
T
>::
yllcorner
=
inGrid
.
yllcorner
;
AsciiGridGeneral
<
T
>::
cellsize
=
inGrid
.
cellsize
;
AsciiGridGeneral
<
T
>::
nodata
=
inGrid
.
nodata
;
AsciiGridGeneral
<
T
>::
data
.
resize
(
inGrid
.
data
.
size
());
for
(
int
counter
=
0
;
counter
<
inGrid
.
data
.
size
();
++
counter
){
AsciiGridGeneral
<
T
>::
data
[
counter
]
=
inGrid
.
data
[
counter
];
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment