Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
S
SWE
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Gaurav Kukreja
SWE
Commits
a313b7d7
Commit
a313b7d7
authored
Nov 13, 2012
by
Sebastian Rettenberger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace some loops with memcp
parent
6210303c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
11 deletions
+2
-11
SWE_Block.cpp
src/SWE_Block.cpp
+2
-11
No files found.
src/SWE_Block.cpp
View file @
a313b7d7
...
...
@@ -346,21 +346,12 @@ void SWE_Block::setBoundaryType( const BoundaryEdge i_edge,
boundary
[
i_edge
]
=
i_boundaryType
;
neighbour
[
i_edge
]
=
i_inflow
;
// TODO unrolling seams to help vectorization, but only for the first 2 loops ...
// set bathymetry values in the ghost layer, if necessary
float
*
tmp
=
b
.
elemVector
();
if
(
boundary
[
BND_LEFT
]
==
OUTFLOW
||
boundary
[
BND_LEFT
]
==
WALL
)
{
//#pragma unroll(4)
for
(
int
j
=
0
;
j
<=
ny
+
1
;
j
++
)
{
b
[
0
][
j
]
=
b
[
1
][
j
];
}
memcpy
(
b
[
0
],
b
[
1
],
sizeof
(
float
)
*
(
ny
+
2
));
}
if
(
boundary
[
BND_RIGHT
]
==
OUTFLOW
||
boundary
[
BND_RIGHT
]
==
WALL
)
{
//#pragma unroll(4)
for
(
int
j
=
0
;
j
<=
ny
+
1
;
j
++
)
{
b
[
nx
+
1
][
j
]
=
b
[
nx
][
j
];
}
memcpy
(
b
[
nx
+
1
],
b
[
nx
],
sizeof
(
float
)
*
(
ny
+
2
));
}
if
(
boundary
[
BND_BOTTOM
]
==
OUTFLOW
||
boundary
[
BND_BOTTOM
]
==
WALL
)
{
for
(
int
i
=
0
;
i
<=
nx
+
1
;
i
++
)
{
...
...
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