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
pycodegen
pystencils
Commits
e5861425
Commit
e5861425
authored
6 months ago
by
Richard Angersbach
Browse files
Options
Downloads
Patches
Plain Diff
Minor adaptation on how symbols are given reduction property
parent
3d592ab0
Branches
Branches containing commit
Tags
release/0.4.1
Tags containing commit
1 merge request
!438
Reduction Support
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/pystencils/backend/kernelcreation/context.py
+3
-2
3 additions, 2 deletions
src/pystencils/backend/kernelcreation/context.py
src/pystencils/backend/kernelcreation/freeze.py
+1
-1
1 addition, 1 deletion
src/pystencils/backend/kernelcreation/freeze.py
with
4 additions
and
3 deletions
src/pystencils/backend/kernelcreation/context.py
+
3
−
2
View file @
e5861425
...
@@ -179,13 +179,14 @@ class KernelCreationContext:
...
@@ -179,13 +179,14 @@ class KernelCreationContext:
"""
"""
if
self
.
find_symbol
(
symbol
.
name
)
is
None
:
if
self
.
find_symbol
(
symbol
.
name
)
is
None
:
raise
PsInternalCompilerError
(
raise
PsInternalCompilerError
(
"
add_reduction_to_symbol:
S
ymbol does not exist in the symbol table
"
f
"
add_reduction_to_symbol:
{
s
ymbol
.
name
}
does not exist in the symbol table
"
)
)
if
symbol
not
in
self
.
_symbols_with_reduction
and
not
symbol
.
get_properties
(
ReductionSymbolProperty
):
if
symbol
not
in
self
.
_symbols_with_reduction
and
not
symbol
.
get_properties
(
ReductionSymbolProperty
):
symbol
.
add_property
(
reduction
)
self
.
_symbols_with_reduction
[
symbol
]
=
reduction
self
.
_symbols_with_reduction
[
symbol
]
=
reduction
else
:
else
:
raise
PsInternalCompilerError
(
f
"
add_reduction_to_symbol:
Symbol
{
symbol
.
name
}
already has a reduction property
"
)
raise
PsInternalCompilerError
(
f
"
add_reduction_to_symbol:
{
symbol
.
name
}
already has a reduction property
"
)
def
duplicate_symbol
(
def
duplicate_symbol
(
self
,
symb
:
PsSymbol
,
new_dtype
:
PsType
|
None
=
None
self
,
symb
:
PsSymbol
,
new_dtype
:
PsType
|
None
=
None
...
...
This diff is collapsed.
Click to expand it.
src/pystencils/backend/kernelcreation/freeze.py
+
1
−
1
View file @
e5861425
...
@@ -213,7 +213,7 @@ class FreezeExpressions:
...
@@ -213,7 +213,7 @@ class FreezeExpressions:
case
_
:
case
_
:
raise
FreezeError
(
f
"
Unsupported reduced assignment:
{
expr
.
op
}
.
"
)
raise
FreezeError
(
f
"
Unsupported reduced assignment:
{
expr
.
op
}
.
"
)
lhs
.
symbol
.
add_property
(
ReductionSymbolProperty
(
expr
.
op
,
init_val
))
self
.
_ctx
.
add_reduction_to_symbol
(
lhs
.
symbol
,
ReductionSymbolProperty
(
expr
.
op
,
init_val
))
return
PsAssignment
(
lhs
,
op
(
lhs
.
clone
(),
rhs
))
return
PsAssignment
(
lhs
,
op
(
lhs
.
clone
(),
rhs
))
...
...
This diff is collapsed.
Click to expand it.
Frederik Hennig
@da15siwa
mentioned in commit
4e688b86
·
2 months ago
mentioned in commit
4e688b86
mentioned in commit 4e688b867339c90a6fba3ad12c383d1e59211ed9
Toggle commit list
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