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
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pycodegen
pystencils
Commits
3c74d1c3
Commit
3c74d1c3
authored
Nov 28, 2016
by
Martin Bauer
Browse files
Options
Downloads
Patches
Plain Diff
Bugfixes in benchmark & boundary handling convenience class
parent
4c924c8e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
ast.py
+0
-1
0 additions, 1 deletion
ast.py
cpu/cpujit.py
+8
-0
8 additions, 0 deletions
cpu/cpujit.py
slicing.py
+35
-0
35 additions, 0 deletions
slicing.py
with
43 additions
and
1 deletion
ast.py
+
0
−
1
View file @
3c74d1c3
...
...
@@ -80,7 +80,6 @@ class KernelFunction(Node):
# these variables are assumed to be global, so no automatic parameter is generated for them
self
.
globalVariables
=
set
()
@property
def
symbolsDefined
(
self
):
return
set
()
...
...
This diff is collapsed.
Click to expand it.
cpu/cpujit.py
+
8
−
0
View file @
3c74d1c3
...
...
@@ -19,6 +19,14 @@ CONFIG_INTEL = {
'
LM_PROJECT
'
:
'
iwia
'
,
}
}
CONFIG_INTEL_SUPERMUC
=
{
'
compiler
'
:
'
/lrz/sys/intel/studio2017_u1/compilers_and_libraries_2017.1.132/linux/bin/intel64/icpc
'
,
'
flags
'
:
'
-Ofast -DNDEBUG -fPIC -shared -march=native -fopenmp -Wl,
'
'
-rpath=/lrz/sys/intel/studio2016_u4/compilers_and_libraries_2016.4.258/linux/mkl/lib/intel64
'
,
'
env
'
:
{
'
INTEL_LICENSE_FILE
'
:
'
/lrz/sys/intel/licenses
'
,
}
}
CONFIG_CLANG
=
{
'
compiler
'
:
'
clang++
'
,
'
flags
'
:
'
-Ofast -DNDEBUG -fPIC -shared -march=native -fopenmp
'
,
...
...
This diff is collapsed.
Click to expand it.
slicing.py
+
35
−
0
View file @
3c74d1c3
import
sympy
as
sp
class
SliceMaker
(
object
):
def
__getitem__
(
self
,
item
):
return
item
...
...
@@ -43,3 +44,37 @@ def normalizeSlice(slices, sizes):
result
.
append
(
slice
(
newStart
,
newStop
,
s
.
step
if
s
.
step
is
not
None
else
1
))
return
tuple
(
result
)
def
sliceFromDirection
(
directionName
,
dim
,
normalOffset
=
0
,
tangentialOffset
=
0
):
"""
Create a slice from a direction named by compass scheme:
i.e.
'
N
'
for north returns same as makeSlice[:, -1]
the naming is:
- x: W, E (west, east)
- y: S, N (south, north)
- z: B, T (bottom, top)
Also combinations are allowed like north-east
'
NE
'
:param directionName: name of direction as explained above
:param dim: dimension of the returned slice (should be 2 or 3)
:param normalOffset: the offset in
'
normal
'
direction: e.g. sliceFromDirection(
'
N
'
,2, normalOffset=2)
would return makeSlice[:, -3]
:param tangentialOffset: offset in the other directions: e.g. sliceFromDirection(
'
N
'
,2, tangentialOffset=2)
would return makeSlice[2:-2, -1]
"""
if
tangentialOffset
==
0
:
result
=
[
slice
(
None
,
None
,
None
)]
*
dim
else
:
result
=
[
slice
(
tangentialOffset
,
-
tangentialOffset
,
None
)]
*
dim
normalSliceHigh
,
normalSliceLow
=
-
1
-
normalOffset
,
normalOffset
for
dimIdx
,
(
lowName
,
highName
)
in
enumerate
([(
'
W
'
,
'
E
'
),
(
'
S
'
,
'
N
'
),
(
'
B
'
,
'
T
'
)]):
if
lowName
in
directionName
:
assert
highName
not
in
directionName
,
"
Invalid direction name
"
result
[
dimIdx
]
=
normalSliceLow
if
highName
in
directionName
:
assert
lowName
not
in
directionName
,
"
Invalid direction name
"
result
[
dimIdx
]
=
normalSliceHigh
return
tuple
(
result
)
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
sign in
to comment