提交 b3205b23 authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Merge pull request #776 from nouiz/fix_new_commit

Fix new commit
...@@ -228,7 +228,7 @@ get the code using `Git <http://git-scm.com>`__: ...@@ -228,7 +228,7 @@ get the code using `Git <http://git-scm.com>`__:
git clone git://github.com/Theano/Theano.git git clone git://github.com/Theano/Theano.git
From here, the easiest way to get started is (this request setuptools_ or distribute_ to be installed): From here, the easiest way to get started is (this requires setuptools_ or distribute_ to be installed):
.. code-block:: bash .. code-block:: bash
......
...@@ -42,6 +42,8 @@ def get_lock(lock_dir=None, **kw): ...@@ -42,6 +42,8 @@ def get_lock(lock_dir=None, **kw):
:param kw: Additional arguments to be forwarded to the `lock` function when :param kw: Additional arguments to be forwarded to the `lock` function when
acquiring the lock. acquiring the lock.
:note: We can lock only on 1 directory at a time.
""" """
if lock_dir is None: if lock_dir is None:
lock_dir = os.path.join(config.compiledir, 'lock_dir') lock_dir = os.path.join(config.compiledir, 'lock_dir')
......
...@@ -879,12 +879,14 @@ CudaNdarray_TakeFrom(CudaNdarray * self, PyObject *args){ ...@@ -879,12 +879,14 @@ CudaNdarray_TakeFrom(CudaNdarray * self, PyObject *args){
if (! clipmode){ if (! clipmode){
Py_DECREF(indices_obj); Py_DECREF(indices_obj);
Py_DECREF(out); Py_DECREF(out);
free(dims);
return NULL; return NULL;
} }
if (strcmp(clipmode, "raise") != 0) { if (strcmp(clipmode, "raise") != 0) {
PyErr_SetString(PyExc_NotImplementedError,"CudaNdarray_TakeFrom: only the raise mode is currently supported"); PyErr_SetString(PyExc_NotImplementedError,"CudaNdarray_TakeFrom: only the raise mode is currently supported");
Py_DECREF(indices_obj); Py_DECREF(indices_obj);
Py_DECREF(out); Py_DECREF(out);
free(dims);
return NULL; return NULL;
} }
Py_DECREF(clipmode_obj); Py_DECREF(clipmode_obj);
...@@ -903,6 +905,7 @@ CudaNdarray_TakeFrom(CudaNdarray * self, PyObject *args){ ...@@ -903,6 +905,7 @@ CudaNdarray_TakeFrom(CudaNdarray * self, PyObject *args){
if (!err_var) { // PyErr set by device_malloc if (!err_var) { // PyErr set by device_malloc
Py_DECREF(indices_obj); Py_DECREF(indices_obj);
Py_DECREF(out); Py_DECREF(out);
free(dims);
return NULL; return NULL;
} }
cudaError_t err = cudaMemset((void*)err_var, 0, sizeof(int)); cudaError_t err = cudaMemset((void*)err_var, 0, sizeof(int));
...@@ -912,10 +915,11 @@ CudaNdarray_TakeFrom(CudaNdarray * self, PyObject *args){ ...@@ -912,10 +915,11 @@ CudaNdarray_TakeFrom(CudaNdarray * self, PyObject *args){
cudaGetErrorString(err)); cudaGetErrorString(err));
Py_DECREF(indices_obj); Py_DECREF(indices_obj);
Py_DECREF(out); Py_DECREF(out);
free(dims);
return NULL; return NULL;
} }
} }
free(dims);
dim3 n_blocks(std::min(CudaNdarray_HOST_DIMS(out)[0],65535),1,1); dim3 n_blocks(std::min(CudaNdarray_HOST_DIMS(out)[0],65535),1,1);
switch (self->nd) { switch (self->nd) {
case 1: case 1:
...@@ -997,7 +1001,8 @@ CudaNdarray_TakeFrom(CudaNdarray * self, PyObject *args){ ...@@ -997,7 +1001,8 @@ CudaNdarray_TakeFrom(CudaNdarray * self, PyObject *args){
"CudaNdarray_TakeFrom: only input with 1, 2 or 3" "CudaNdarray_TakeFrom: only input with 1, 2 or 3"
" dimensions are currently supported"); " dimensions are currently supported");
} }
free(dims);
CNDA_THREAD_SYNC; CNDA_THREAD_SYNC;
cudaError_t err = cudaGetLastError(); cudaError_t err = cudaGetLastError();
if (cudaSuccess != err) { if (cudaSuccess != err) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论