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
05aa005a
Commit
05aa005a
authored
5 years ago
by
Stephan Seitz
Browse files
Options
Downloads
Patches
Plain Diff
Add `use_auto_for_assignments` as a kernel parameter
parent
69c29833
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/astnodes.py
+1
-1
1 addition, 1 deletion
pystencils/astnodes.py
pystencils/kernelcreation.py
+8
-4
8 additions, 4 deletions
pystencils/kernelcreation.py
with
9 additions
and
5 deletions
pystencils/astnodes.py
+
1
−
1
View file @
05aa005a
...
...
@@ -518,7 +518,7 @@ class LoopOverCoordinate(Node):
class
SympyAssignment
(
Node
):
def
__init__
(
self
,
lhs_symbol
,
rhs_expr
,
is_const
=
True
,
use_auto
=
Tru
e
):
def
__init__
(
self
,
lhs_symbol
,
rhs_expr
,
is_const
=
True
,
use_auto
=
Fals
e
):
super
(
SympyAssignment
,
self
).
__init__
(
parent
=
None
)
self
.
_lhs_symbol
=
lhs_symbol
self
.
rhs
=
sp
.
sympify
(
rhs_expr
)
...
...
This diff is collapsed.
Click to expand it.
pystencils/kernelcreation.py
+
8
−
4
View file @
05aa005a
...
...
@@ -26,7 +26,8 @@ def create_kernel(assignments,
gpu_indexing
=
'
block
'
,
gpu_indexing_params
=
MappingProxyType
({}),
use_textures_for_interpolation
=
True
,
cpu_prepend_optimizations
=
[]):
cpu_prepend_optimizations
=
[],
use_auto_for_assignments
=
False
):
"""
Creates abstract syntax tree (AST) of kernel, using a list of update equations.
...
...
@@ -102,12 +103,10 @@ def create_kernel(assignments,
vectorize
(
ast
,
**
cpu_vectorize_info
)
else
:
raise
ValueError
(
"
Invalid value for cpu_vectorize_info
"
)
return
ast
elif
target
==
'
llvm
'
:
from
pystencils.llvm
import
create_kernel
ast
=
create_kernel
(
assignments
,
type_info
=
data_type
,
split_groups
=
split_groups
,
iteration_slice
=
iteration_slice
,
ghost_layers
=
ghost_layers
)
return
ast
elif
target
==
'
gpu
'
:
from
pystencils.gpucuda
import
create_cuda_kernel
ast
=
create_cuda_kernel
(
assignments
,
type_info
=
data_type
,
...
...
@@ -115,10 +114,15 @@ def create_kernel(assignments,
iteration_slice
=
iteration_slice
,
ghost_layers
=
ghost_layers
,
skip_independence_check
=
skip_independence_check
,
use_textures_for_interpolation
=
use_textures_for_interpolation
)
return
ast
else
:
raise
ValueError
(
"
Unknown target %s. Has to be one of
'
cpu
'
,
'
gpu
'
or
'
llvm
'
"
%
(
target
,))
if
use_auto_for_assignments
:
for
a
in
ast
.
atoms
(
SympyAssignment
):
a
.
use_auto
=
True
return
ast
def
create_indexed_kernel
(
assignments
,
index_fields
,
...
...
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