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

Merge pull request #667 from nouiz/cuda_win

Don't use "int x[y];" as windows compiler doesn't support it.
...@@ -1023,8 +1023,8 @@ CudaNdarray_inplace_elemwise(PyObject* py_self, PyObject * py_other, operator_t ...@@ -1023,8 +1023,8 @@ CudaNdarray_inplace_elemwise(PyObject* py_self, PyObject * py_other, operator_t
} }
//broadcast to the same number of dimensions. //broadcast to the same number of dimensions.
int other_dims[self->nd]; int* other_dims = (int*) alloca(self->nd * sizeof(int));
int other_strides[self->nd]; int* other_strides = (int*) alloca(self->nd * sizeof(int));
int added_dims = self->nd - other->nd; int added_dims = self->nd - other->nd;
// Add the added broadcasted dimensions // Add the added broadcasted dimensions
for (int i = 0; i< added_dims; ++i) for (int i = 0; i< added_dims; ++i)
...@@ -2808,7 +2808,7 @@ int CudaNdarray_CopyFromCudaNdarray(CudaNdarray * self, ...@@ -2808,7 +2808,7 @@ int CudaNdarray_CopyFromCudaNdarray(CudaNdarray * self,
{ {
new_other = (CudaNdarray *) CudaNdarray_View(other); new_other = (CudaNdarray *) CudaNdarray_View(other);
int added_dims = self->nd - other->nd; int added_dims = self->nd - other->nd;
int pattern[self->nd]; int* pattern = (int*) alloca(self->nd * sizeof(int));
for(int i = 0; i < added_dims; i++) for(int i = 0; i < added_dims; i++)
pattern[i] = -1; pattern[i] = -1;
for(int i = 0; i < other->nd; i++) for(int i = 0; i < other->nd; i++)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论