@@ -129,12 +129,15 @@ def getTargetMemoryLevelMapping(self) -> TargetMemoryLevelMapping:
129129 return TargetMemoryLevelMapping (self .graph , self .Platform , self .ctxt )
130130
131131 def bind (self ):
132+ log .info ("- Perform Memory Level Annotation" )
133+ # LMACAN: Annotate before bind because during binding (specifically alignToContext) templates
134+ # may expect the memoryLevel annotation already.
135+ self .ctxt , self .graph = self .memoryLevelAnnotationOptimizer .optimize (self .ctxt , self .graph )
132136
133137 ret = super ().bind ()
134138 if not ret :
135139 return False
136140
137- log .info ("- Perform Memory Level Annotation" )
138141 # SCHEREMO: There might be hoisting; reassign memoryLevel preferences
139142 self .ctxt , self .graph = self .memoryLevelAnnotationOptimizer .optimize (self .ctxt , self .graph )
140143
@@ -170,12 +173,15 @@ def getTargetMemoryLevelMapping(self) -> TargetMemoryLevelMapping:
170173 return TargetMemoryLevelMapping (self .graph , self .Platform , self .ctxt )
171174
172175 def bind (self ):
176+ log .info ("- Perform Memory Level Annotation" )
177+ # LMACAN: Annotate before bind because during binding (specifically alignToContext) templates
178+ # may expect the memoryLevel annotation already.
179+ self .ctxt , self .graph = self .memoryLevelAnnotationOptimizer .optimize (self .ctxt , self .graph )
173180
174181 ret = super ().bind ()
175182 if not ret :
176183 return False
177184
178- log .info ("- Perform Memory Level Annotation" )
179185 # SCHEREMO: There might be hoisting; reassign memoryLevel preferences
180186 self .ctxt , self .graph = self .memoryLevelAnnotationOptimizer .optimize (self .ctxt , self .graph )
181187
@@ -202,12 +208,15 @@ def getTargetMemoryLevelMapping(self) -> TargetMemoryLevelMapping:
202208 return TargetMemoryLevelMapping (self .graph , self .Platform , self .ctxt )
203209
204210 def bind (self ):
211+ log .info ("- Perform Memory Level Annotation" )
212+ # LMACAN: Annotate before bind because during binding (specifically alignToContext) templates
213+ # may expect the memoryLevel annotation already.
214+ self .ctxt , self .graph = self .memoryLevelAnnotationOptimizer .optimize (self .ctxt , self .graph )
205215
206216 ret = super ().bind ()
207217 if not ret :
208218 return False
209219
210- log .info ("- Perform Memory Level Annotation" )
211220 # SCHEREMO: There might be hoisting; reassign memoryLevel preferences
212221 self .ctxt , self .graph = self .memoryLevelAnnotationOptimizer .optimize (self .ctxt , self .graph )
213222
0 commit comments