Skip to content

Commit

Permalink
[dace] Provide better comment for allocation of temporaries
Browse files Browse the repository at this point in the history
  • Loading branch information
edopao committed Feb 22, 2024
1 parent 51df35d commit febde04
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,14 @@ def add_storage_for_temporaries(
tmp_domain,
tmp_array.shape,
):
# instead of using the actual size `end.value - begin.value` we allocate space for indexing from 0
# in order to avoid using dace array offsets
"""
The temporary field has a dimension range defined by `begin` and `end` values.
Therefore, the actual size is given by the difference `end.value - begin.value`.
Instead of allocating the actual size, we allocate space to enable indexing from 0
because we want to avoid using dace array offsets (which will be deprecated soon).
The result should still be valid, but the stencil will be using only a subset
of the array.
"""
if not (isinstance(begin, SymbolExpr) and begin.value == "0"):
warnings.warn(f"Domain start offset for temporary {tmp_name} is ignored.")
tmp_symbols[str(shape_sym)] = end.value
Expand Down

0 comments on commit febde04

Please sign in to comment.