From db72a7d49663bb38c7f5945b42e860b2aa8e1e59 Mon Sep 17 00:00:00 2001 From: Steven Robertson Date: Mon, 6 Sep 2010 16:50:54 -0400 Subject: [PATCH] Allow register local name rebinding --- cuburnlib/ptx.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cuburnlib/ptx.py b/cuburnlib/ptx.py index eb90e57..98ed379 100644 --- a/cuburnlib/ptx.py +++ b/cuburnlib/ptx.py @@ -333,8 +333,9 @@ class _CallChain(object): self.__chain = [] def __call__(self, *args, **kwargs): assert(self.__chain) - self._call(self.__chain, *args, **kwargs) + r = self._call(self.__chain, *args, **kwargs) self.__chain = [] + return r def __getattr__(self, name): if name == 'global_': name = 'global' @@ -371,6 +372,9 @@ class _RegFactory(_CallChain): regs = map(lambda n: Reg(type, n), names) self.block.code(op='.reg .' + type, vars=_softjoin(names, ',')) [self.block.inject(r.name, r) for r in regs] + if len(regs) == 1: + return regs[0] + return regs class Op(_CallChain): """