Skip to content
Snippets Groups Projects
Commit ddf4e888 authored by Frederik Hennig's avatar Frederik Hennig
Browse files

to-do notes and comment cleanup

parent 8c4f5a87
No related merge requests found
Pipeline #61151 failed with stages
in 6 minutes and 14 seconds
...@@ -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:
......
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)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment