提交 e480eadb authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Re-enable C code for GpuAlloc

This also fixes the failure in `theano/sandbox/cuda/tests/test_memory.py`, which was due (somehow) to the use of perform rather than C code.
上级 73a6651f
...@@ -3370,7 +3370,7 @@ class GpuAlloc(GpuAllocEmpty): ...@@ -3370,7 +3370,7 @@ class GpuAlloc(GpuAllocEmpty):
# the super class (GpuAllocEmpty) allocates memory, we fill it # the super class (GpuAllocEmpty) allocates memory, we fill it
value = inputs[0] value = inputs[0]
shps = inputs[1:] shps = inputs[1:]
str = super(GpuAllocEmpty, self).c_code(node, name, shps, out_, sub) str = super(GpuAlloc, self).c_code(node, name, shps, out_, sub)
out, = out_ out, = out_
fail = sub['fail'] fail = sub['fail']
memset_0 = int(self.memset_0) memset_0 = int(self.memset_0)
...@@ -3405,7 +3405,8 @@ class GpuAlloc(GpuAllocEmpty): ...@@ -3405,7 +3405,8 @@ class GpuAlloc(GpuAllocEmpty):
return [node.inputs[1:]] return [node.inputs[1:]]
def c_code_cache_version(self): def c_code_cache_version(self):
return (10,) parent_version = super(GpuAlloc, self).c_code_cache_version()
return (parent_version, 10)
def do_constant_folding(self, node): def do_constant_folding(self, node):
for client in node.outputs[0].clients: for client in node.outputs[0].clients:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论