Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import dace
from dace import data as dace_data
from dace.sdfg import nodes as dace_nodes, propagation as dace_propagation, utils as dace_sdutils
from dace.transformation import dataflow as dace_dataflow
from dace.transformation.auto import auto_optimize as dace_aoptimize
from dace.transformation.passes import analysis as dace_analysis

Expand Down Expand Up @@ -674,6 +675,16 @@ def _gt_auto_process_dataflow_inside_maps(
time, so the compiler will fully unroll them anyway.
"""

# The SDFG might contain tasklets with no input connectors, which simply write
# a constant value into a scalar node. If these tasklets were moved into the map
# scope, they would require an empty memlet edge from MapEntry, for synchronization.
# Empty memlets are not properly handled in code generation, so it is better
# to avoid this pattern. Running `TaskletFusion` at this stage helps to inline
# these constant-write tasklets into compute-tasklets.
sdfg.apply_transformations_repeated(
dace_dataflow.TaskletFusion, validate=False, validate_all=validate_all
)
Comment on lines +684 to +686
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The location is not optimial because it essentially destroy LoopBlooking but since that stencil does not depend on it, it should be fine.


# Constants (tasklets are needed to write them into a variable) should not be
# arguments to a kernel but be present inside the body.
sdfg.apply_transformations_once_everywhere(
Expand Down