Skip to content

Commit

Permalink
Optimize kernel mode for Hybrid QNN test case
Browse files Browse the repository at this point in the history
  • Loading branch information
bmhowe23 committed Apr 26, 2024
1 parent 3ce8ef2 commit b90b2dc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions python/cudaq/kernel/kernel_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,14 @@ def compile(self):
# variables from the parent frame that we captured
# have not changed. If they have changed, we need to
# recompile with the new values.
for i, s in enumerate(inspect.stack()):
if s.frame == self.parentFrame:
s = inspect.currentframe()
while s:
if s == self.parentFrame:
# We found the parent frame, now
# see if any of the variables we depend
# on have changed.
self.globalScopedVars = {
k: v for k, v in dict(inspect.getmembers(s.frame))
k: v for k, v in dict(inspect.getmembers(s))
['f_locals'].items()
}
if self.dependentCaptures != None:
Expand All @@ -148,6 +149,8 @@ def compile(self):
# Need to recompile
self.module = None
break
break
s = s.f_back

if self.module != None:
return
Expand Down

0 comments on commit b90b2dc

Please sign in to comment.