提交 3767c435 authored 作者: Frederic Bastien's avatar Frederic Bastien

warn if we call CudaNdarray_dealloc but their is too many ref count to it.

上级 714ca7d7
......@@ -140,10 +140,13 @@ decl_k_elemwise_unary_rowmajor(k_elemwise_unary_rowmajor_exp, unary_exp<float>)
// Satisfying reqs to be Type
/////////////////////////////
//DON'T use directly(if their is other CudaNdarray that point to it, it will cause problem)! use Py_DECREF() instead
static void
CudaNdarray_dealloc(CudaNdarray* self)
{
//std::cerr << "CudaNdarray dealloc " << self << " " << self->devdata << '\n';
if(self->ob_refcnt>1)
printf("WARNING:CudaNdarray_dealloc called when their is still active reference to it.\n");
CudaNdarray_uninit(self);
self->ob_type->tp_free((PyObject*)self);
--_outstanding_mallocs[1];
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论