Skip to content

Commit

Permalink
Build on top of the GPU codegen hack
Browse files Browse the repository at this point in the history
  • Loading branch information
ThrudPrimrose committed Dec 11, 2024
1 parent 2408ad0 commit 62bc08c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dace/codegen/targets/cuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -1502,8 +1502,8 @@ def generate_scope(self, sdfg: SDFG, cfg: ControlFlowRegion, dfg_scope: StateSub
const_params = _get_const_params(dfg_scope)
# make dynamic map inputs constant
# TODO move this into _get_const_params(dfg_scope)
# Do not add src as const if the size is being red (src_conn is _read_size)
const_params |= set((str(e.src)) for e in dace.sdfg.dynamic_map_inputs(state, scope_entry) if e.src_conn is None or (e.src_conn is not None and e.src_conn == "_read_size"))
# Do not add src as const if the size is being read (src_conn is _read_size)
const_params |= set((str(e.src)) for e in dace.sdfg.dynamic_map_inputs(state, scope_entry) if e.src_conn is None or not (e.src_conn is not None and e.src_conn == "_read_size"))

# Store init/exit code streams
old_entry_stream = self.scope_entry_stream
Expand Down
3 changes: 1 addition & 2 deletions dace/codegen/targets/framecode.py
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,6 @@ def generate_code(self,
# Only allocate arrays that really require deferred allocation (symbol has __dace_defer)
# Reshaping these arrays are not allowed
size_arrays = sdfg.size_arrays()
callsite_stream.write(f'//Declare size arrays\n', sdfg)
for size_desc_name in size_arrays:
size_nodedesc = sdfg.arrays[size_desc_name]
assert ("__return" not in size_desc_name)
Expand All @@ -979,7 +978,7 @@ def generate_code(self,
assert len(size_nodedesc.shape) == 1
alloc_str = f'{ctypedef} {size_desc_name}[{size_nodedesc.shape[0]}]{{{size_str}}};\n'
callsite_stream.write(alloc_str)
self.dispatcher.defined_vars.add(size_desc_name, disp.DefinedType.Pointer, ctypedef)
self.dispatcher.defined_vars.add(size_desc_name, disp.DefinedType.Pointer, ctypedef, allow_shadowing=True)

#######################################################################
# Generate actual program body
Expand Down

0 comments on commit 62bc08c

Please sign in to comment.