Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pystencils_walberla
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stephan Seitz
pystencils_walberla
Commits
7373aa55
Commit
7373aa55
authored
6 years ago
by
Martin Bauer
Browse files
Options
Downloads
Patches
Plain Diff
pystencils_walberla: same interface for overlap & non-overlap sweeps
parent
5c4fd515
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pystencils_walberla/templates/SweepInnerOuter.tmpl.cpp
+18
-0
18 additions, 0 deletions
pystencils_walberla/templates/SweepInnerOuter.tmpl.cpp
pystencils_walberla/templates/SweepInnerOuter.tmpl.h
+24
-1
24 additions, 1 deletion
pystencils_walberla/templates/SweepInnerOuter.tmpl.h
with
42 additions
and
1 deletion
pystencils_walberla/templates/SweepInnerOuter.tmpl.cpp
+
18
−
0
View file @
7373aa55
...
...
@@ -53,6 +53,24 @@ void {{class_name}}::operator() ( IBlock * block{%if target is equalto 'gpu'%} ,
}
void
{{
class_name
}}
::
runOnCellInterval
(
const
shared_ptr
<
StructuredBlockStorage
>
&
blocks
,
const
CellInterval
&
globalCellInterval
,
cell_idx_t
ghostLayers
,
IBlock
*
block
{
%
if
target
is
equalto
'
gpu
'
%
}
,
cudaStream_t
stream
{
%
endif
%
}
)
{
CellInterval
ci
=
globalCellInterval
;
CellInterval
blockBB
=
blocks
->
getBlockCellBB
(
*
block
);
blockBB
.
expand
(
ghostLayers
);
ci
.
intersect
(
blockBB
);
blocks
->
transformGlobalToBlockLocalCellInterval
(
ci
,
*
block
);
if
(
ci
.
empty
()
)
return
;
{{
kernel
|
generate_block_data_to_field_extraction
|
indent
(
4
)}}
{{
kernel
|
generate_call
(
stream
=
'
stream
'
,
cell_interval
=
'
ci
'
)
|
indent
(
4
)}}
{{
kernel
|
generate_swaps
|
indent
(
4
)}}
}
void
{{
class_name
}}
::
inner
(
IBlock
*
block
{
%
if
target
is
equalto
'
gpu
'
%
}
,
cudaStream_t
stream
{
%
endif
%
}
)
{
...
...
This diff is collapsed.
Click to expand it.
pystencils_walberla/templates/SweepInnerOuter.tmpl.h
+
24
−
1
View file @
7373aa55
...
...
@@ -17,6 +17,7 @@
//! \\author pystencils
//======================================================================================================================
#pragma once
#include
"core/DataTypes.h"
{
%
if
target
is
equalto
'
cpu
'
-%
}
...
...
@@ -28,7 +29,7 @@
#include
"field/SwapableCompare.h"
#include
"domain_decomposition/BlockDataID.h"
#include
"domain_decomposition/IBlock.h"
#include
"domain_decomposition/StructuredBlockStorage.h"
#include
<set>
#ifdef __GNUC__
...
...
@@ -60,6 +61,28 @@ public:
void
operator
()
(
IBlock
*
block
{
%
if
target
is
equalto
'
gpu
'
%
}
,
cudaStream_t
stream
=
0
{
%
endif
%
}
);
void
runOnCellInterval
(
const
shared_ptr
<
StructuredBlockStorage
>
&
blocks
,
const
CellInterval
&
globalCellInterval
,
cell_idx_t
ghostLayers
,
IBlock
*
block
{
%
if
target
is
equalto
'
gpu
'
%
}
,
cudaStream_t
stream
=
0
{
%
endif
%
});
static
std
::
function
<
void
(
IBlock
*
)
>
getSweep
(
const
shared_ptr
<
{{
class_name
}}
>
&
kernel
)
{
return
[
kernel
](
IBlock
*
b
)
{
(
*
kernel
)(
b
);
};
}
static
std
::
function
<
void
(
IBlock
*
{
%
if
target
is
equalto
'
gpu
'
%
}
,
cudaStream_t
{
%
endif
%
})
>
getSweepOnCellInterval
(
const
shared_ptr
<
{{
class_name
}}
>
&
kernel
,
const
shared_ptr
<
StructuredBlockStorage
>
&
blocks
,
const
CellInterval
&
globalCellInterval
,
cell_idx_t
ghostLayers
=
1
)
{
return
[
kernel
,
blocks
,
globalCellInterval
,
ghostLayers
]
(
IBlock
*
b
{
%
if
target
is
equalto
'
gpu
'
%
}
,
cudaStream_t
stream
=
0
{
%
endif
%
})
{
kernel
->
runOnCellInterval
(
blocks
,
globalCellInterval
,
ghostLayers
,
b
{
%
if
target
is
equalto
'
gpu
'
%
},
stream
{
%
endif
%
});
};
}
void
inner
(
IBlock
*
block
{
%
if
target
is
equalto
'
gpu
'
%
}
,
cudaStream_t
stream
=
0
{
%
endif
%
}
);
void
outer
(
IBlock
*
block
{
%
if
target
is
equalto
'
gpu
'
%
}
,
cudaStream_t
stream
=
0
{
%
endif
%
}
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment