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
ddf4e888
Commit
ddf4e888
authored
1 year ago
by
Frederik Hennig
Browse files
Options
Downloads
Patches
Plain Diff
to-do notes and comment cleanup
parent
8c4f5a87
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#61151
failed
1 year ago
Stage: pretest
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/pystencils/nbackend/kernelcreation/iteration_space.py
+2
-0
2 additions, 0 deletions
src/pystencils/nbackend/kernelcreation/iteration_space.py
src/pystencils/nbackend/kernelcreation/kernelcreation.py
+2
-5
2 additions, 5 deletions
src/pystencils/nbackend/kernelcreation/kernelcreation.py
with
4 additions
and
5 deletions
src/pystencils/nbackend/kernelcreation/iteration_space.py
+
2
−
0
View file @
ddf4e888
...
@@ -185,6 +185,8 @@ def create_full_iteration_space(
...
@@ -185,6 +185,8 @@ def create_full_iteration_space(
# - We have no domain fields, but at least one custom field -> determine common field from custom fields
# - We have no domain fields, but at least one custom field -> determine common field from custom fields
# - We have neither domain nor custom fields -> Error
# - We have neither domain nor custom fields -> Error
# TODO: Re-implement as `get_archetype_field`, check not only shape but also layout equality
# The archetype field must encompass all information about the iteration space: shape, extents, and loop order.
from
...transformations
import
get_common_field
from
...transformations
import
get_common_field
if
len
(
domain_field_accesses
)
>
0
:
if
len
(
domain_field_accesses
)
>
0
:
...
...
This diff is collapsed.
Click to expand it.
src/pystencils/nbackend/kernelcreation/kernelcreation.py
+
2
−
5
View file @
ddf4e888
from
...simp
import
AssignmentCollection
from
...simp
import
AssignmentCollection
from
..ast
import
PsBlock
,
PsKernelFunction
from
..ast
import
PsKernelFunction
from
...enums
import
Target
from
...enums
import
Target
from
.context
import
KernelCreationContext
from
.context
import
KernelCreationContext
...
@@ -30,12 +30,11 @@ def create_kernel(assignments: AssignmentCollection, options: KernelCreationOpti
...
@@ -30,12 +30,11 @@ def create_kernel(assignments: AssignmentCollection, options: KernelCreationOpti
ctx
.
set_iteration_space
(
ispace
)
ctx
.
set_iteration_space
(
ispace
)
freeze
=
FreezeExpressions
(
ctx
)
freeze
=
FreezeExpressions
(
ctx
)
kernel_body
:
PsBlock
=
freeze
(
assignments
)
kernel_body
=
freeze
(
assignments
)
typify
=
Typifier
(
ctx
)
typify
=
Typifier
(
ctx
)
kernel_body
=
typify
(
kernel_body
)
kernel_body
=
typify
(
kernel_body
)
# Up to this point, all was target-agnostic, but now the target becomes relevant.
match
options
.
target
:
match
options
.
target
:
case
Target
.
CPU
:
case
Target
.
CPU
:
from
.platform
import
BasicCpu
from
.platform
import
BasicCpu
...
@@ -47,7 +46,6 @@ def create_kernel(assignments: AssignmentCollection, options: KernelCreationOpti
...
@@ -47,7 +46,6 @@ def create_kernel(assignments: AssignmentCollection, options: KernelCreationOpti
# TODO: SYCL platform (?)
# TODO: SYCL platform (?)
raise
NotImplementedError
(
"
Target platform not implemented
"
)
raise
NotImplementedError
(
"
Target platform not implemented
"
)
# 6. Add loops or device indexing
kernel_ast
=
platform
.
apply_iteration_space
(
kernel_body
,
ispace
)
kernel_ast
=
platform
.
apply_iteration_space
(
kernel_body
,
ispace
)
# 7. Apply optimizations
# 7. Apply optimizations
...
@@ -56,7 +54,6 @@ def create_kernel(assignments: AssignmentCollection, options: KernelCreationOpti
...
@@ -56,7 +54,6 @@ def create_kernel(assignments: AssignmentCollection, options: KernelCreationOpti
# - Loop Splitting, Tiling, Blocking
# - Loop Splitting, Tiling, Blocking
kernel_ast
=
platform
.
optimize
(
kernel_ast
)
kernel_ast
=
platform
.
optimize
(
kernel_ast
)
# 8. Create and return kernel function.
function
=
PsKernelFunction
(
kernel_ast
,
options
.
target
,
name
=
options
.
function_name
)
function
=
PsKernelFunction
(
kernel_ast
,
options
.
target
,
name
=
options
.
function_name
)
function
.
add_constraints
(
*
ctx
.
constraints
)
function
.
add_constraints
(
*
ctx
.
constraints
)
...
...
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