Skip to content

Commit

Permalink
Code generation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tbennun committed Jan 24, 2025
1 parent bfa15f4 commit 9cf093e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dace/codegen/targets/cpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def emit_memlet_reference(dispatcher: 'TargetDispatcher',
typedef = conntype.ctype
offset = cpp_offset_expr(desc, memlet.subset)
offset_expr = '[' + offset + ']'
is_scalar = not isinstance(conntype, dtypes.pointer)
is_scalar = not isinstance(conntype, dtypes.pointer) and not fpga.is_fpga_array(desc)
ptrname = ptr(memlet.data, desc, sdfg, dispatcher.frame)
ref = ''

Expand Down
5 changes: 3 additions & 2 deletions dace/codegen/targets/cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def generate_node(self,

def allocate_view(self, sdfg: SDFG, cfg: ControlFlowRegion, dfg: SDFGState, state_id: int, node: nodes.AccessNode,
global_stream: CodeIOStream, declaration_stream: CodeIOStream,
allocation_stream: CodeIOStream) -> None:
allocation_stream: CodeIOStream, decouple_array_interfaces: bool = False) -> None:
"""
Allocates (creates pointer and refers to original) a view of an
existing array, scalar, or view.
Expand Down Expand Up @@ -233,7 +233,8 @@ def allocate_view(self, sdfg: SDFG, cfg: ControlFlowRegion, dfg: SDFGState, stat
name,
dtypes.pointer(nodedesc.dtype),
ancestor=0,
is_write=is_write)
is_write=is_write,
decouple_array_interfaces=decouple_array_interfaces)

# Test for views of container arrays and structs
if isinstance(sdfg.arrays[viewed_dnode.data], (data.Structure, data.ContainerArray, data.ContainerView)):
Expand Down
2 changes: 1 addition & 1 deletion dace/codegen/targets/xilinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -1216,7 +1216,7 @@ def allocate_view(self, sdfg: dace.SDFG, cfg: ControlFlowRegion, dfg: dace.SDFGS
node: dace.nodes.AccessNode, global_stream: CodeIOStream, declaration_stream: CodeIOStream,
allocation_stream: CodeIOStream) -> None:
return self._cpu_codegen.allocate_view(sdfg, cfg, dfg, state_id, node, global_stream, declaration_stream,
allocation_stream)
allocation_stream, decouple_array_interfaces=self._decouple_array_interfaces)

def generate_nsdfg_arguments(self, sdfg, cfg, dfg, state, node):
# Connectors that are both input and output share the same name, unless
Expand Down
2 changes: 1 addition & 1 deletion tests/fpga/kernel_detection_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def kernels_inside_component_2(x: dace.float32[8], y: dace.float32[8], v: dace.f
return sdfg


@fpga_test()
@fpga_test(assert_ii_1=False)
def test_kernels_lns_inside_component():
"""
Tests for kernels detection inside a single connected component where we
Expand Down

0 comments on commit 9cf093e

Please sign in to comment.