Skip to content

Commit

Permalink
Another fix attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
ThrudPrimrose committed Dec 2, 2024
1 parent 5e717bf commit ca5b4ae
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions dace/codegen/targets/framecode.py
Original file line number Diff line number Diff line change
Expand Up @@ -896,10 +896,7 @@ def generate_code(self,
# Allocate outer-level transients
self.allocate_arrays_in_scope(sdfg, sdfg, sdfg, global_stream, callsite_stream)

for s in sdfg.free_symbols:
assert isinstance(s, str)
#outside_symbols = sdfg.free_symbols if is_top_level else set()
#outside_symbols = set()
outside_symbols = copy.deepcopy(sdfg.free_symbols) if is_top_level else set()

# Define constants as top-level-allocated
for cname, (ctype, _) in sdfg.constants_prop.items():
Expand Down Expand Up @@ -952,15 +949,16 @@ def generate_code(self,
# as part of the function's arguments
if not is_top_level and isvarName in sdfg.parent_nsdfg_node.symbol_mapping:
continue
isvar = data.Scalar(isvarType)
if (schedule in (dtypes.ScheduleType.FPGA_Device, dtypes.ScheduleType.FPGA_Multi_Pumped)
and config.Config.get('compiler', 'fpga', 'vendor').lower() == 'intel_fpga'):
# Emit OpenCL type
callsite_stream.write(f'{isvarType.ocltype} {isvarName};\n', sdfg)
self.dispatcher.defined_vars.add(isvarName, disp.DefinedType.Scalar, isvarType.ctype)
else:
assert isinstance(isvarName, str)
callsite_stream.write('%s;\n' % (isvar.as_arg(with_types=True, name=isvarName)), sdfg)
self.dispatcher.defined_vars.add(isvarName, disp.DefinedType.Scalar, isvarType.ctype)
if isvarName not in outside_symbols:
callsite_stream.write(f'{isvarType.ctype} {isvarName};\n', sdfg)
self.dispatcher.defined_vars.add(isvarName, disp.DefinedType.Scalar, isvarType.ctype)
callsite_stream.write('\n', sdfg)

#######################################################################
Expand Down

0 comments on commit ca5b4ae

Please sign in to comment.