提交 246b7287 authored 作者: Frederic Bastien's avatar Frederic Bastien

fix a bug in nvcc 3.0

上级 6242157d
...@@ -121,7 +121,8 @@ __global__ void name (unsigned int numEls, \ ...@@ -121,7 +121,8 @@ __global__ void name (unsigned int numEls, \
for (unsigned int _d = 0; _d < nd; ++_d) \ for (unsigned int _d = 0; _d < nd; ++_d) \
{ \ { \
unsigned int d = nd - _d-1; \ unsigned int d = nd - _d-1; \
unsigned int i_d = ii % dim[d]; /* i_d is our position in the d'th dimension */ \ /* i_d used to be unsigned, but their is a bug in nvcc 3.0. making it signed fix the bug.*/\
int i_d = ii % dim[d]; /* i_d is our position in the d'th dimension */ \
ii = ii / dim[d]; \ ii = ii / dim[d]; \
a_i += i_d * a_str[d]; /* increment our a and z pointers by i_d elements */ \ a_i += i_d * a_str[d]; /* increment our a and z pointers by i_d elements */ \
z_i += i_d * z_str[d]; \ z_i += i_d * z_str[d]; \
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论