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
c0eb4386
Commit
c0eb4386
authored
Nov 12, 2012
by
Sebastian Rettenberger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move if-statements out of the loop, comment on unrolling
parent
bc8b4003
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
14 deletions
+23
-14
SWE_Block.cpp
src/SWE_Block.cpp
+23
-14
No files found.
src/SWE_Block.cpp
View file @
c0eb4386
...
@@ -346,22 +346,31 @@ void SWE_Block::setBoundaryType( const BoundaryEdge i_edge,
...
@@ -346,22 +346,31 @@ void SWE_Block::setBoundaryType( const BoundaryEdge i_edge,
boundary
[
i_edge
]
=
i_boundaryType
;
boundary
[
i_edge
]
=
i_boundaryType
;
neighbour
[
i_edge
]
=
i_inflow
;
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
// set bathymetry values in the ghost layer, if necessary
for
(
int
j
=
0
;
j
<=
ny
+
1
;
j
++
)
{
float
*
tmp
=
b
.
elemVector
();
if
(
boundary
[
BND_LEFT
]
==
OUTFLOW
||
boundary
[
BND_LEFT
]
==
WALL
)
{
if
(
boundary
[
BND_LEFT
]
==
OUTFLOW
||
boundary
[
BND_LEFT
]
==
WALL
)
{
b
[
0
][
j
]
=
b
[
1
][
j
];
//#pragma unroll(4)
}
for
(
int
j
=
0
;
j
<=
ny
+
1
;
j
++
)
{
if
(
boundary
[
BND_RIGHT
]
==
OUTFLOW
||
boundary
[
BND_RIGHT
]
==
WALL
)
{
b
[
0
][
j
]
=
b
[
1
][
j
];
b
[
nx
+
1
][
j
]
=
b
[
nx
][
j
];
}
}
}
}
for
(
int
i
=
0
;
i
<=
nx
+
1
;
i
++
)
{
if
(
boundary
[
BND_RIGHT
]
==
OUTFLOW
||
boundary
[
BND_RIGHT
]
==
WALL
)
{
if
(
boundary
[
BND_BOTTOM
]
==
OUTFLOW
||
boundary
[
BND_BOTTOM
]
==
WALL
)
{
//#pragma unroll(4)
b
[
i
][
0
]
=
b
[
i
][
1
];
for
(
int
j
=
0
;
j
<=
ny
+
1
;
j
++
)
{
}
b
[
nx
+
1
][
j
]
=
b
[
nx
][
j
];
if
(
boundary
[
BND_TOP
]
==
OUTFLOW
||
boundary
[
BND_TOP
]
==
WALL
)
{
}
b
[
i
][
ny
+
1
]
=
b
[
i
][
ny
];
}
}
if
(
boundary
[
BND_BOTTOM
]
==
OUTFLOW
||
boundary
[
BND_BOTTOM
]
==
WALL
)
{
for
(
int
i
=
0
;
i
<=
nx
+
1
;
i
++
)
{
b
[
i
][
0
]
=
b
[
i
][
1
];
}
}
if
(
boundary
[
BND_TOP
]
==
OUTFLOW
||
boundary
[
BND_TOP
]
==
WALL
)
{
for
(
int
i
=
0
;
i
<=
nx
+
1
;
i
++
)
{
b
[
i
][
ny
+
1
]
=
b
[
i
][
ny
];
}
}
}
// synchronize after an external update of the bathymetry
// synchronize after an external update of the bathymetry
...
...
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