Skip to content

Commit

Permalink
Various fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ThrudPrimrose committed Dec 6, 2024
1 parent 15b00cc commit ee8a708
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions dace/codegen/targets/framecode.py
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,7 @@ def generate_code(self,
array = [v for v in sdfg.arrays.values() if v.size_desc_name is not None and v.size_desc_name == size_desc_name]
assert (len(array) == 1)
array = array[0]
print("AA", array, array.shape, sdfg.arrays)
size_str = ",".join(["0" if cpp.sym2cpp(dim).startswith("__dace_defer") else cpp.sym2cpp(dim) for dim in array.shape])
alloc_str = f'{ctypedef} {size_desc_name}[{size_nodedesc.shape[0]}]{{{size_str}}};\n'
callsite_stream.write(alloc_str)
Expand Down
6 changes: 3 additions & 3 deletions dace/sdfg/sdfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -779,13 +779,13 @@ def replace_dict(self,
arr = self.arrays[arr_name] if arr_name in self.arrays else None
if arr is not None:
size_desc_name_before = arr.size_desc_name
if arr.transient and isinstance(arr, dt.Array):
if arr.transient and type(arr) == dt.Array:
arr.size_desc_name = size_desc_name if "__return" not in new_name else None
else:
arr.size_desc_name = None
if arr.size_desc_name is None and size_desc_name_before is not None:
size_ararys_to_rm.add(size_desc_name_before)
for size_arr_name in size_ararys_to_rm:
for size_arr_name in size_ararys_to_rm and size_arr_name in self.arrays:
del self.arrays[size_arr_name]

# Replace inside data descriptors
Expand Down Expand Up @@ -2109,7 +2109,7 @@ def add_datadesc(self, name: str, datadesc: dt.Data, find_new_name=False) -> str
self._add_symbols(datadesc)
if (
datadesc.transient is True and
isinstance(datadesc, dt.Array) and
type(datadesc) == dt.Array and
"__return" not in name and
datadesc.lifetime is not dtypes.AllocationLifetime.External and
datadesc.lifetime is not dtypes.AllocationLifetime.Persistent
Expand Down

0 comments on commit ee8a708

Please sign in to comment.