提交 c5e4c593 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Avoid zero-sized arrays which MSVC doesn't like.

上级 8e6742b6
...@@ -397,7 +397,8 @@ class mrg_uniform(mrg_uniform_base): ...@@ -397,7 +397,8 @@ class mrg_uniform(mrg_uniform_base):
NORM = '4.656612873077392578125e-10' NORM = '4.656612873077392578125e-10'
return """ return """
//////// <code generated by mrg_uniform> //////// <code generated by mrg_uniform>
npy_int64 odims[%(ndim)s]; // The +1 is to avoid odims[0] which fails on windows
npy_int64 odims[%(ndim)s+1];
npy_int64 n_elements = 1; npy_int64 n_elements = 1;
int n_streams = 0; int n_streams = 0;
int must_alloc_sample = ((NULL == %(o_sample)s) int must_alloc_sample = ((NULL == %(o_sample)s)
...@@ -668,7 +669,8 @@ class GPU_mrg_uniform(mrg_uniform_base, GpuOp): ...@@ -668,7 +669,8 @@ class GPU_mrg_uniform(mrg_uniform_base, GpuOp):
return """ return """
//////// <code generated by mrg_uniform> //////// <code generated by mrg_uniform>
npy_int64 M1 = 2147483647; //2^31 - 1 npy_int64 M1 = 2147483647; //2^31 - 1
npy_int64 odims[%(ndim)s]; // The +1 is to avoid odims[0] which fails on windows
npy_int64 odims[%(ndim)s+1];
npy_int64 n_elements = 1; npy_int64 n_elements = 1;
int n_streams, n_streams_used_in_this_call; int n_streams, n_streams_used_in_this_call;
int must_alloc_sample = ((NULL == %(o_sample)s) int must_alloc_sample = ((NULL == %(o_sample)s)
...@@ -932,7 +934,8 @@ class GPUA_mrg_uniform(GpuKernelBase, mrg_uniform_base): ...@@ -932,7 +934,8 @@ class GPUA_mrg_uniform(GpuKernelBase, mrg_uniform_base):
return """ return """
npy_int64 M1 = 2147483647; //2^31 - 1 npy_int64 M1 = 2147483647; //2^31 - 1
size_t odims[%(ndim)s]; // The +1 is to avoid odims[0] which fails on windows
size_t odims[%(ndim)s+1];
size_t n_elements = 1; size_t n_elements = 1;
unsigned int n_streams; unsigned int n_streams;
int must_alloc_sample = ((NULL == %(o_sample)s) int must_alloc_sample = ((NULL == %(o_sample)s)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论