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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Markus Holzer
pystencils
Commits
0e31ad58
Commit
0e31ad58
authored
3 years ago
by
Markus Holzer
Browse files
Options
Downloads
Patches
Plain Diff
Fix doc test
parent
50079b19
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pystencils/kernelcreation.py
+12
-5
12 additions, 5 deletions
pystencils/kernelcreation.py
pystencils/typing/__init__.py
+0
-1
0 additions, 1 deletion
pystencils/typing/__init__.py
with
12 additions
and
6 deletions
pystencils/kernelcreation.py
+
12
−
5
View file @
0e31ad58
...
@@ -88,6 +88,9 @@ def create_domain_kernel(assignments: NodeCollection, *, config: CreateKernelCon
...
@@ -88,6 +88,9 @@ def create_domain_kernel(assignments: NodeCollection, *, config: CreateKernelCon
"""
"""
Creates abstract syntax tree (AST) of kernel, using a list of update equations.
Creates abstract syntax tree (AST) of kernel, using a list of update equations.
Note that `create_domain_kernel` is a lower level function which shoul be accessed by not providing `index_fields`
to create_kernel
Args:
Args:
assignments: can be a single assignment, sequence of assignments or an `AssignmentCollection`
assignments: can be a single assignment, sequence of assignments or an `AssignmentCollection`
config: CreateKernelConfig which includes the needed configuration
config: CreateKernelConfig which includes the needed configuration
...
@@ -181,6 +184,9 @@ def create_indexed_kernel(assignments: NodeCollection, *, config: CreateKernelCo
...
@@ -181,6 +184,9 @@ def create_indexed_kernel(assignments: NodeCollection, *, config: CreateKernelCo
'
coordinate_names
'
parameter. The struct can have also other fields that can be read and written in the kernel, for
'
coordinate_names
'
parameter. The struct can have also other fields that can be read and written in the kernel, for
example boundary parameters.
example boundary parameters.
Note that `create_indexed_kernel` is a lower level function which shoul be accessed by providing `index_fields`
to create_kernel
Args:
Args:
assignments: can be a single assignment, sequence of assignments or an `AssignmentCollection`
assignments: can be a single assignment, sequence of assignments or an `AssignmentCollection`
config: CreateKernelConfig which includes the needed configuration
config: CreateKernelConfig which includes the needed configuration
...
@@ -209,11 +215,12 @@ def create_indexed_kernel(assignments: NodeCollection, *, config: CreateKernelCo
...
@@ -209,11 +215,12 @@ def create_indexed_kernel(assignments: NodeCollection, *, config: CreateKernelCo
>>>
d_arr
=
np
.
zeros
([
5
,
5
])
>>>
d_arr
=
np
.
zeros
([
5
,
5
])
>>>
kernel
(
s
=
np
.
ones
([
5
,
5
]),
d
=
d_arr
,
idx
=
index_arr
)
>>>
kernel
(
s
=
np
.
ones
([
5
,
5
]),
d
=
d_arr
,
idx
=
index_arr
)
>>>
d_arr
>>>
d_arr
array
([[
0.
,
0.
,
0.
,
0.
,
0.
],
array
([[
0.
,
0.
,
0.
,
0.
,
0.
],
[
0.
,
4.1
,
0.
,
0.
,
0.
],
[
0.
,
4.1
,
0.
,
0.
,
0.
],
[
0.
,
0.
,
4.2
,
0.
,
0.
],
[
0.
,
0.
,
4.2
,
0.
,
0.
],
[
0.
,
0.
,
0.
,
4.3
,
0.
],
[
0.
,
0.
,
0.
,
4.3
,
0.
],
[
0.
,
0.
,
0.
,
0.
,
0.
]])
[
0.
,
0.
,
0.
,
0.
,
0.
]])
"""
"""
# --- eval
# --- eval
assignments
.
evaluate_terms
()
assignments
.
evaluate_terms
()
...
...
This diff is collapsed.
Click to expand it.
pystencils/typing/__init__.py
+
0
−
1
View file @
0e31ad58
from
pystencils.typing.cast_functions
import
(
CastFunc
,
BooleanCastFunc
,
VectorMemoryAccess
,
ReinterpretCastFunc
,
from
pystencils.typing.cast_functions
import
(
CastFunc
,
BooleanCastFunc
,
VectorMemoryAccess
,
ReinterpretCastFunc
,
PointerArithmeticFunc
)
PointerArithmeticFunc
)
from
pystencils.typing.types
import
(
is_supported_type
,
numpy_name_to_c
,
AbstractType
,
BasicType
,
VectorType
,
from
pystencils.typing.types
import
(
is_supported_type
,
numpy_name_to_c
,
AbstractType
,
BasicType
,
VectorType
,
...
...
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