提交 226c0774 authored 作者: Frédéric Bastien's avatar Frédéric Bastien

Merge pull request #1438 from XterNalz/master

fix for variable size array problem in Windows compiler
...@@ -2523,7 +2523,7 @@ CudaNdarray_set_strides(CudaNdarray *self, PyObject *value, void *closure) ...@@ -2523,7 +2523,7 @@ CudaNdarray_set_strides(CudaNdarray *self, PyObject *value, void *closure)
"The new strides need to be encoded in a tuple or list"); "The new strides need to be encoded in a tuple or list");
return -1; return -1;
} }
npy_intp newstrides[CudaNdarray_NDIM(self)]; npy_intp* newstrides = (npy_intp*) alloca(CudaNdarray_NDIM(self) * sizeof(npy_intp));
if (PyTuple_Check(value)){ if (PyTuple_Check(value)){
for(int i=0; i < CudaNdarray_NDIM(self); i++){ for(int i=0; i < CudaNdarray_NDIM(self); i++){
newstrides[i] = PyInt_AsLong(PyTuple_GetItem(value, Py_ssize_t(i))); newstrides[i] = PyInt_AsLong(PyTuple_GetItem(value, Py_ssize_t(i)));
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论