Commit 0ccce01d authored by Nguyen, Thien Minh's avatar Nguyen, Thien Minh
Browse files

Added regex matches for ctrl and adjoint



Signed-off-by: Nguyen, Thien Minh's avatarThien Nguyen <nguyentm@ornl.gov>
parent 6105e4ae
......@@ -200,10 +200,12 @@ class qjit(object):
# Handle nested kernels:
dependency = []
for kernelName in self.__compiled__kernels:
kernelCall = kernelName + '('
# Check that this kernel *calls* a previously-compiled kernel:
# pattern: "<white space> kernel("
if re.search(r"\b" + re.escape(kernelCall), self.src):
# pattern: "<white space> kernel(" OR "kernel.adjoint(" OR "kernel.ctrl("
kernelCall = kernelName + '('
kernelAdjCall = kernelName + '.adjoint('
kernelCtrlCall = kernelName + '.ctrl('
if re.search(r"\b" + re.escape(kernelCall) + '|' + re.escape(kernelAdjCall) + '|' + re.escape(kernelCtrlCall), self.src):
dependency.append(kernelName)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment