提交 544f5e7f authored 作者: Josh Bleecher Snyder's avatar Josh Bleecher Snyder

compatibility with current release of pycuda (0.94.2)

上级 3a4474c8
...@@ -66,7 +66,8 @@ def test_pycuda_memory_to_theano(): ...@@ -66,7 +66,8 @@ def test_pycuda_memory_to_theano():
print 'strides', strides print 'strides', strides
assert cuda_rand._strides == strides, (cuda_rand._strides, strides) assert cuda_rand._strides == strides, (cuda_rand._strides, strides)
z = cuda_ndarray.from_gpu_pointer(y.ptr, y.shape, strides, y) y_ptr = int(y.gpudata) # in pycuda trunk, y.ptr also works, which is a little cleaner
z = cuda_ndarray.from_gpu_pointer(y_ptr, y.shape, strides, y)
print "gpuarray ref count after creating a CudaNdarray", sys.getrefcount(y) print "gpuarray ref count after creating a CudaNdarray", sys.getrefcount(y)
assert sys.getrefcount(y)==3 assert sys.getrefcount(y)==3
assert (numpy.asarray(z) == 0).all() assert (numpy.asarray(z) == 0).all()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论