Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pystencils_autodiff
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
pycodegen
pystencils_autodiff
Commits
16b089f2
Commit
16b089f2
authored
5 years ago
by
Stephan Seitz
Browse files
Options
Downloads
Patches
Plain Diff
Extend DestructuringBindingsForFieldClass to enable arguments per value
parent
ba82e6a3
Branches
textures
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#19205
failed
5 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/pystencils_autodiff/framework_integration/astnodes.py
+6
-1
6 additions, 1 deletion
src/pystencils_autodiff/framework_integration/astnodes.py
with
6 additions
and
1 deletion
src/pystencils_autodiff/framework_integration/astnodes.py
+
6
−
1
View file @
16b089f2
...
@@ -35,6 +35,7 @@ class DestructuringBindingsForFieldClass(Node):
...
@@ -35,6 +35,7 @@ class DestructuringBindingsForFieldClass(Node):
FieldStrideSymbol
:
"
stride[{dim}]
"
FieldStrideSymbol
:
"
stride[{dim}]
"
}
}
CLASS_NAME_TEMPLATE
=
"
PyStencilsField<{dtype}, {ndim}>
"
CLASS_NAME_TEMPLATE
=
"
PyStencilsField<{dtype}, {ndim}>
"
ARGS_AS_REFERENCE
=
True
@property
@property
def
fields_accessed
(
self
)
->
Set
[
'
ResolvedFieldAccess
'
]:
def
fields_accessed
(
self
)
->
Set
[
'
ResolvedFieldAccess
'
]:
...
@@ -70,7 +71,11 @@ class DestructuringBindingsForFieldClass(Node):
...
@@ -70,7 +71,11 @@ class DestructuringBindingsForFieldClass(Node):
undefined_field_symbols
=
self
.
symbols_defined
undefined_field_symbols
=
self
.
symbols_defined
corresponding_field_names
=
{
s
.
field_name
for
s
in
undefined_field_symbols
if
hasattr
(
s
,
'
field_name
'
)}
corresponding_field_names
=
{
s
.
field_name
for
s
in
undefined_field_symbols
if
hasattr
(
s
,
'
field_name
'
)}
corresponding_field_names
|=
{
s
.
field_names
[
0
]
for
s
in
undefined_field_symbols
if
hasattr
(
s
,
'
field_names
'
)}
corresponding_field_names
|=
{
s
.
field_names
[
0
]
for
s
in
undefined_field_symbols
if
hasattr
(
s
,
'
field_names
'
)}
return
{
TypedSymbol
(
f
,
self
.
CLASS_NAME_TEMPLATE
.
format
(
dtype
=
field_map
[
f
].
dtype
,
ndim
=
field_map
[
f
].
ndim
)
+
'
&
'
)
return
{
TypedSymbol
(
f
,
self
.
CLASS_NAME_TEMPLATE
.
format
(
dtype
=
field_map
[
f
].
dtype
,
ndim
=
field_map
[
f
].
ndim
)
+
(
'
&
'
if
self
.
ARGS_AS_REFERENCE
else
''
))
for
f
in
corresponding_field_names
}
|
(
self
.
body
.
undefined_symbols
-
undefined_field_symbols
)
for
f
in
corresponding_field_names
}
|
(
self
.
body
.
undefined_symbols
-
undefined_field_symbols
)
def
subs
(
self
,
subs_dict
)
->
None
:
def
subs
(
self
,
subs_dict
)
->
None
:
...
...
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