Skip to content

Commit cf67362

Browse files
committed
Initialize TransientBuffers on allocation instead of on top of network execution code
1 parent 45554e2 commit cf67362

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Deeploy/CommonExtensions/CodeTransformationPasses/MemoryAllocation.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ def apply(self,
130130
ctxt._dynamicSize[memoryLevel] += int(buffer.sizeInBytes())
131131

132132
executionBlock.addLeft(buffer.allocTemplate, buffer._bufferRepresentation())
133+
if isinstance(buffer, TransientBuffer):
134+
executionBlock.addLeft(buffer.initTemplate, buffer._bufferRepresentation())
133135

134136
for levels in ctxt._dynamicSize.keys():
135137
if levels not in ctxt._maxDynamicSize:

Deeploy/DeeployTypes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2893,7 +2893,7 @@ def generateInferenceInitializationCode(self) -> str:
28932893
callStack = ''
28942894
for node in self.ctxt.localObjects.values():
28952895
# WIESEP: We don't want to initialize the struct buffers as this should be handled by the ArgumentStructGeneration
2896-
if isinstance(node, StructBuffer):
2896+
if isinstance(node, (StructBuffer, TransientBuffer)):
28972897
continue
28982898

28992899
name = node.name

0 commit comments

Comments
 (0)