提交 5a1e170b authored 作者: Frédéric Bastien's avatar Frédéric Bastien

Merge pull request #2898 from abergeron/fix_advsub

Fix crash with GpuGemm.
...@@ -146,7 +146,6 @@ class GpuGemm(BlasOp, Gemm): ...@@ -146,7 +146,6 @@ class GpuGemm(BlasOp, Gemm):
""" % vars """ % vars
else: else:
code = """ code = """
Py_XDECREF(%(out)s);
%(out)s = gpublas_try_copy(%(out)s, %(C)s); %(out)s = gpublas_try_copy(%(out)s, %(C)s);
if (%(out)s == NULL) { if (%(out)s == NULL) {
%(fail)s %(fail)s
...@@ -168,7 +167,7 @@ class GpuGemm(BlasOp, Gemm): ...@@ -168,7 +167,7 @@ class GpuGemm(BlasOp, Gemm):
return code return code
def c_code_cache_version(self): def c_code_cache_version(self):
return (3,) return (4,)
gpugemm_no_inplace = GpuGemm(inplace=False) gpugemm_no_inplace = GpuGemm(inplace=False)
......
...@@ -1115,15 +1115,16 @@ class Scan(PureOp): ...@@ -1115,15 +1115,16 @@ class Scan(PureOp):
# this is a new vm-provided function or c linker # this is a new vm-provided function or c linker
# they need this because the exception manipulation # they need this because the exception manipulation
# done by raise_with_op is not implemented in C. # done by raise_with_op is not implemented in C.
if hasattr(self.fn, 'thunks'): if hasattr(fn, 'thunks'):
# For the CVM # For the CVM
gof.link.raise_with_op(self.fn.nodes[self.fn.position_of_error], gof.link.raise_with_op(fn.nodes[fn.position_of_error],
self.fn.thunks[self.fn.position_of_error]) fn.thunks[fn.position_of_error])
else: else:
# For the c linker # For the c linker
# We don't have access from python to all the temps values # We don't have access from python to all the
# So for now, we just don't print the extra shapes/strides info # temps values So for now, we just don't print
gof.vm.raise_with_op(self.fn.nodes[self.fn.position_of_error]) # the extra shapes/strides info
gof.vm.raise_with_op(fn.nodes[fn.position_of_error])
else: else:
# old-style linkers raise their own exceptions # old-style linkers raise their own exceptions
raise raise
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论