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
3e0daa67
Commit
3e0daa67
authored
8 months ago
by
Richard Angersbach
Browse files
Options
Downloads
Patches
Plain Diff
Propagate properties of reduction pointer symbols to kernel parameters
parent
c6eedfcd
No related branches found
No related tags found
1 merge request
!438
Reduction Support
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/pystencils/codegen/driver.py
+3
-2
3 additions, 2 deletions
src/pystencils/codegen/driver.py
src/pystencils/jit/cpu_extension_module.py
+5
-2
5 additions, 2 deletions
src/pystencils/jit/cpu_extension_module.py
with
8 additions
and
4 deletions
src/pystencils/codegen/driver.py
+
3
−
2
View file @
3e0daa67
...
...
@@ -5,7 +5,7 @@ from dataclasses import dataclass, replace
from
.target
import
Target
from
.config
import
CreateKernelConfig
,
OpenMpConfig
,
VectorizationConfig
,
AUTO
from
.kernel
import
Kernel
,
GpuKernel
,
GpuThreadsRange
from
.properties
import
PsSymbolProperty
,
FieldShape
,
FieldStride
,
FieldBasePtr
from
.properties
import
PsSymbolProperty
,
FieldShape
,
FieldStride
,
FieldBasePtr
,
ReductionPointerVariable
from
.parameters
import
Parameter
from
..backend.ast.expressions
import
PsSymbolExpr
,
PsMemAcc
,
PsConstantExpr
...
...
@@ -461,7 +461,8 @@ def _get_function_params(
props
:
set
[
PsSymbolProperty
]
=
set
()
for
prop
in
symb
.
properties
:
match
prop
:
# TODO: how to export reduction result (via pointer)?
case
ReductionPointerVariable
():
props
.
add
(
prop
)
case
FieldShape
()
|
FieldStride
():
props
.
add
(
prop
)
case
BufferBasePtr
(
buf
):
...
...
This diff is collapsed.
Click to expand it.
src/pystencils/jit/cpu_extension_module.py
+
5
−
2
View file @
3e0daa67
...
...
@@ -13,7 +13,7 @@ from ..codegen import (
Kernel
,
Parameter
,
)
from
..codegen.properties
import
FieldBasePtr
,
FieldShape
,
FieldStride
from
..codegen.properties
import
FieldBasePtr
,
FieldShape
,
FieldStride
,
ReductionPointerVariable
from
..types
import
(
PsType
,
PsUnsignedIntegerType
,
...
...
@@ -265,7 +265,10 @@ if( !kwargs || !PyDict_Check(kwargs) ) {{
return
self
.
_array_buffers
[
field
]
def
extract_scalar
(
self
,
param
:
Parameter
)
->
str
:
if
param
not
in
self
.
_scalar_extractions
:
if
any
(
isinstance
(
e
,
ReductionPointerVariable
)
for
e
in
param
.
properties
):
# TODO: implement
pass
elif
param
not
in
self
.
_scalar_extractions
:
extract_func
=
self
.
_scalar_extractor
(
param
.
dtype
)
code
=
self
.
TMPL_EXTRACT_SCALAR
.
format
(
name
=
param
.
name
,
...
...
This diff is collapsed.
Click to expand it.
Frederik Hennig
@da15siwa
mentioned in commit
4e688b86
·
5 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
sign in
to comment