提交 c4bdd82d authored 作者: Frederic's avatar Frederic

fix failing test with newer pycuda.

上级 33da7e20
...@@ -78,7 +78,10 @@ __global__ void multiply_them(float *dest, float *a, float *b) ...@@ -78,7 +78,10 @@ __global__ void multiply_them(float *dest, float *a, float *b)
def test_pycuda_memory_to_theano(): def test_pycuda_memory_to_theano():
#Test that we can use the GpuArray memory space in pycuda in a CudaNdarray #Test that we can use the GpuArray memory space in pycuda in a CudaNdarray
y = pycuda.gpuarray.zeros((3, 4, 5), 'float32') y = pycuda.gpuarray.zeros((3, 4, 5), 'float32')
print numpy.asarray(y) print sys.getrefcount(y)
# This increase the ref count with never pycuda. Do pycuda also
# cache ndarray?
# print y.get()
print "gpuarray ref count before creating a CudaNdarray", print "gpuarray ref count before creating a CudaNdarray",
print sys.getrefcount(y) print sys.getrefcount(y)
assert sys.getrefcount(y) == 2 assert sys.getrefcount(y) == 2
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论