Get a the function with the given name. If the function is already present in `currentModule`, just return it. Otherwise, determine if `target` is a builder or a decorator and merge its module into `currentModule`. Once merged, return the function (from the c
(self, astName, currentModule, target)
| 598 | return QuakeValue(value, self) |
| 599 | |
| 600 | def __cloneOrGetFunction(self, astName, currentModule, target): |
| 601 | """ |
| 602 | Get a the function with the given name. |
| 603 | If the function is already present in `currentModule`, just return it. |
| 604 | Otherwise, determine if `target` is a builder or a decorator and merge |
| 605 | its module into `currentModule`. Once merged, return the function (from |
| 606 | the current module!) and the current module. |
| 607 | """ |
| 608 | thisSymbolTable = SymbolTable(currentModule.operation) |
| 609 | if astName in thisSymbolTable: |
| 610 | return thisSymbolTable[astName], currentModule |
| 611 | if isa_kernel_decorator(target): |
| 612 | otherModule = target.qkeModule |
| 613 | fulluniq = nvqppPrefix + target.uniqName |
| 614 | cudaq_runtime.updateModule(fulluniq, currentModule, otherModule) |
| 615 | fn = recover_func_op(currentModule, fulluniq) |
| 616 | assert fn and "function may not disappear from module" |
| 617 | return fn, currentModule |
| 618 | otherModule = target.module |
| 619 | cudaq_runtime.updateModule(target.funcName, currentModule, otherModule) |
| 620 | fn = recover_func_op(currentModule, target.funcName) |
| 621 | assert fn and "function may not disappear from module" |
| 622 | return fn, currentModule |
| 623 | |
| 624 | def __addAllCalledFunctionsRecursively(self, otherFunc, currentModule, |
| 625 | otherModule): |
no test coverage detected