提交 71eccb91 authored 作者: Frederic's avatar Frederic

Added comment.

上级 03b07d02
...@@ -593,6 +593,12 @@ __global__ void k_copy_reshape_rowmajor(unsigned int numEls, ...@@ -593,6 +593,12 @@ __global__ void k_copy_reshape_rowmajor(unsigned int numEls,
z_i[0] = a_i[0]; //copy one lousy float! z_i[0] = a_i[0]; //copy one lousy float!
} }
} }
// Reshape self to the new shape gived by the tuple shape.
//
// If self is c contiguous, it return a view. Otherwise it always do a copy.
// TODO: make it return a view when the strides allow it event if it is not
// c contiguous
PyObject * CudaNdarray_Reshape(CudaNdarray * self, PyObject * shape) PyObject * CudaNdarray_Reshape(CudaNdarray * self, PyObject * shape)
{ {
// check shape tuple // check shape tuple
...@@ -717,6 +723,7 @@ PyObject * CudaNdarray_View(CudaNdarray * self) ...@@ -717,6 +723,7 @@ PyObject * CudaNdarray_View(CudaNdarray * self)
} }
return (PyObject*)rval; return (PyObject*)rval;
} }
PyObject * CudaNdarray_SetStride(CudaNdarray * self, PyObject *args) PyObject * CudaNdarray_SetStride(CudaNdarray * self, PyObject *args)
{ {
int pos, stride; int pos, stride;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论