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
c89e6af4
Commit
c89e6af4
authored
Nov 13, 2012
by
Sebastian Rettenberger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Vectorize updateUnknowns
parent
a313b7d7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
SConstruct
SConstruct
+1
-1
SWE_WavePropagationBlock.cpp
src/SWE_WavePropagationBlock.cpp
+6
-0
No files found.
SConstruct
View file @
c89e6af4
...
...
@@ -184,7 +184,7 @@ elif env['compileMode'] == 'release':
env
.
Append
(
CCFLAGS
=
[
'-O2'
])
# Other compiler flags (for all compilers)
env
.
Append
(
CCFLAGS
=
[
'-fstrict-aliasing'
])
env
.
Append
(
CCFLAGS
=
[
'-fstrict-aliasing'
,
'-fargument-noalias'
])
# Vectorization?
if
env
[
'compiler'
]
==
'intel'
and
env
[
'showVectorization'
]:
...
...
src/SWE_WavePropagationBlock.cpp
View file @
c89e6af4
...
...
@@ -206,6 +206,8 @@ void SWE_WavePropagationBlock::updateUnknowns(float dt) {
#pragma omp parallel for
#endif
for
(
int
i
=
1
;
i
<
nx
+
1
;
i
++
)
{
// Tell the compiler that he can safely ignore all dependencies in this loop
#pragma ivdep
for
(
int
j
=
1
;
j
<
ny
+
1
;
j
++
)
{
h
[
i
][
j
]
-=
dt
/
dx
*
(
hNetUpdatesRight
[
i
-
1
][
j
-
1
]
+
hNetUpdatesLeft
[
i
][
j
-
1
])
+
dt
/
dy
*
(
hNetUpdatesAbove
[
i
-
1
][
j
-
1
]
+
hNetUpdatesBelow
[
i
-
1
][
j
]);
...
...
@@ -218,10 +220,14 @@ void SWE_WavePropagationBlock::updateUnknowns(float dt) {
//TODO: dryTol
if
(
h
[
i
][
j
]
<
0
)
{
#ifndef NDEBUG
// Only print this warning when debug is enabled.
// Otherwise we cannot vectorize this loop
if
(
h
[
i
][
j
]
<
-
0.1
)
{
std
::
cerr
<<
"Warning, negative height: (i,j)=("
<<
i
<<
","
<<
j
<<
")="
<<
h
[
i
][
j
]
<<
std
::
endl
;
std
::
cerr
<<
" b: "
<<
b
[
i
][
j
]
<<
std
::
endl
;
}
#endif
//zero (small) negative depths
h
[
i
][
j
]
=
hu
[
i
][
j
]
=
hv
[
i
][
j
]
=
0.
;
}
...
...
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