Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pystencils
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
Package registry
Model registry
Operate
Environments
Terraform modules
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
Sebastian Bindgen
pystencils
Commits
223f12d4
Commit
223f12d4
authored
6 years ago
by
Martin Bauer
Browse files
Options
Downloads
Patches
Plain Diff
Kerncraft-Grandchem CI interface
parent
42c9e289
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pystencils/kerncraft_coupling/kerncraft_interface.py
+16
-2
16 additions, 2 deletions
pystencils/kerncraft_coupling/kerncraft_interface.py
pystencils/sympyextensions.py
+2
-0
2 additions, 0 deletions
pystencils/sympyextensions.py
with
18 additions
and
2 deletions
pystencils/kerncraft_coupling/kerncraft_interface.py
+
16
−
2
View file @
223f12d4
...
@@ -14,6 +14,7 @@ from pystencils.kerncraft_coupling.generate_benchmark import generate_benchmark
...
@@ -14,6 +14,7 @@ from pystencils.kerncraft_coupling.generate_benchmark import generate_benchmark
from
pystencils.astnodes
import
LoopOverCoordinate
,
SympyAssignment
,
ResolvedFieldAccess
,
KernelFunction
from
pystencils.astnodes
import
LoopOverCoordinate
,
SympyAssignment
,
ResolvedFieldAccess
,
KernelFunction
from
pystencils.field
import
get_layout_from_strides
from
pystencils.field
import
get_layout_from_strides
from
pystencils.sympyextensions
import
count_operations_in_ast
from
pystencils.sympyextensions
import
count_operations_in_ast
from
pystencils.transformations
import
filtered_tree_iteration
from
pystencils.utils
import
DotDict
from
pystencils.utils
import
DotDict
import
warnings
import
warnings
...
@@ -25,7 +26,8 @@ class PyStencilsKerncraftKernel(kerncraft.kernel.Kernel):
...
@@ -25,7 +26,8 @@ class PyStencilsKerncraftKernel(kerncraft.kernel.Kernel):
"""
"""
LIKWID_BASE
=
'
/usr/local/likwid
'
LIKWID_BASE
=
'
/usr/local/likwid
'
def
__init__
(
self
,
ast
:
KernelFunction
,
machine
:
Optional
[
MachineModel
]
=
None
,
assumed_layout
=
'
SoA
'
):
def
__init__
(
self
,
ast
:
KernelFunction
,
machine
:
Optional
[
MachineModel
]
=
None
,
assumed_layout
=
'
SoA
'
,
debug_print
=
False
):
"""
Create a kerncraft kernel using a pystencils AST
"""
Create a kerncraft kernel using a pystencils AST
Args:
Args:
...
@@ -41,7 +43,8 @@ class PyStencilsKerncraftKernel(kerncraft.kernel.Kernel):
...
@@ -41,7 +43,8 @@ class PyStencilsKerncraftKernel(kerncraft.kernel.Kernel):
self
.
temporary_dir
=
TemporaryDirectory
()
self
.
temporary_dir
=
TemporaryDirectory
()
# Loops
# Loops
inner_loops
=
[
l
for
l
in
ast
.
atoms
(
LoopOverCoordinate
)
if
l
.
is_innermost_loop
]
inner_loops
=
[
l
for
l
in
filtered_tree_iteration
(
ast
,
LoopOverCoordinate
,
stop_type
=
SympyAssignment
)
if
l
.
is_innermost_loop
]
if
len
(
inner_loops
)
==
0
:
if
len
(
inner_loops
)
==
0
:
raise
ValueError
(
"
No loop found in pystencils AST
"
)
raise
ValueError
(
"
No loop found in pystencils AST
"
)
else
:
else
:
...
@@ -109,6 +112,17 @@ class PyStencilsKerncraftKernel(kerncraft.kernel.Kernel):
...
@@ -109,6 +112,17 @@ class PyStencilsKerncraftKernel(kerncraft.kernel.Kernel):
del
self
.
_flops
[
k
]
del
self
.
_flops
[
k
]
self
.
check
()
self
.
check
()
if
debug_print
:
from
pprint
import
pprint
print
(
"
----------------------------- Loop Stack --------------------------
"
)
pprint
(
self
.
_loop_stack
)
print
(
"
----------------------------- Sources -----------------------------
"
)
pprint
(
self
.
sources
)
print
(
"
----------------------------- Destinations ------------------------
"
)
pprint
(
self
.
destinations
)
print
(
"
----------------------------- FLOPS -------------------------------
"
)
pprint
(
self
.
_flops
)
def
iaca_analysis
(
self
,
micro_architecture
,
asm_block
=
'
auto
'
,
def
iaca_analysis
(
self
,
micro_architecture
,
asm_block
=
'
auto
'
,
pointer_increment
=
'
auto_with_manual_fallback
'
,
verbose
=
False
):
pointer_increment
=
'
auto_with_manual_fallback
'
,
verbose
=
False
):
compiler
,
compiler_args
=
self
.
_machine
.
get_compiler
()
compiler
,
compiler_args
=
self
.
_machine
.
get_compiler
()
...
...
This diff is collapsed.
Click to expand it.
pystencils/sympyextensions.py
+
2
−
0
View file @
223f12d4
...
@@ -497,6 +497,8 @@ def count_operations(term: Union[sp.Expr, List[sp.Expr]],
...
@@ -497,6 +497,8 @@ def count_operations(term: Union[sp.Expr, List[sp.Expr]],
for
child_term
,
condition
in
t
.
args
:
for
child_term
,
condition
in
t
.
args
:
visit
(
child_term
)
visit
(
child_term
)
visit_children
=
False
visit_children
=
False
elif
isinstance
(
t
,
sp
.
Rel
):
pass
else
:
else
:
warnings
.
warn
(
"
Unknown sympy node of type
"
+
str
(
t
.
func
)
+
"
counting will be inaccurate
"
)
warnings
.
warn
(
"
Unknown sympy node of type
"
+
str
(
t
.
func
)
+
"
counting will be inaccurate
"
)
...
...
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