提交 f4d62299 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Remove the assert in PyGpuArray_DEV_DATA since it might cost a bit too much to…

Remove the assert in PyGpuArray_DEV_DATA since it might cost a bit too much to verify that condition everytime.
上级 8c8b01f4
...@@ -44,14 +44,13 @@ static PyGpuArrayObject *theano_try_copy(PyGpuArrayObject *out, ...@@ -44,14 +44,13 @@ static PyGpuArrayObject *theano_try_copy(PyGpuArrayObject *out,
return out; return out;
} }
/* This is guaranteed to work and return the raw CUDA/OpenCL object on
* all recent (as of June 2015) version of libgpuarray. This is also
* promised to keep working in future versions. */
static inline void *PyGpuArray_DEV_DATA(PyGpuArrayObject *a) { static inline void *PyGpuArray_DEV_DATA(PyGpuArrayObject *a) {
/* This is guaranteed to work and return the raw CUDA/OpenCL object on
* all recent (as of June 2015) version of libgpuarray. This is also
* promised to keep working in future versions. */
char * p = *((char **)a->ga.data); char * p = *((char **)a->ga.data);
assert((a->ga.offset % gpuarray_get_elsize(a->ga.typecode)) == 0);
/* This only works on cuda */ /* This only works on cuda since we have a real pointer. */
return (void *)(p + a->ga.offset); return (void *)(p + a->ga.offset);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论