提交 a123a224 authored 作者: Pierre Luc Carrier's avatar Pierre Luc Carrier

Replace cast to int by cast to size_t

上级 ae8ce3c6
......@@ -510,10 +510,10 @@ class GpuSoftmax (Op):
}
}
{
int n_blocks = std::min((int)PyGpuArray_DIMS(%(x)s)[0],
32 * 1024);
int n_blocks = std::min(PyGpuArray_DIMS(%(x)s)[0],
(size_t)(32 * 1024));
//TODO, detect the maximum number of thread per block.
int n_threads = std::min((int)PyGpuArray_DIMS(%(x)s)[1], 512);
int n_threads = std::min(PyGpuArray_DIMS(%(x)s)[1], (size_t)512);
int n_shared_bytes = PyGpuArray_DIMS(%(x)s)[1] *
2 * sizeof(npy_%(dtype_x)s);
......@@ -716,9 +716,9 @@ class GpuSoftmaxWithBias (Op):
}
}
{
int n_blocks = std::min((int)PyGpuArray_DIMS(%(x)s)[0], 32*1024);
int n_blocks = std::min(PyGpuArray_DIMS(%(x)s)[0], (size_t)(32*1024));
//TODO, detect the maximum number of thread per block.
int n_threads = std::min((int)PyGpuArray_DIMS(%(x)s)[1], 512);
int n_threads = std::min(PyGpuArray_DIMS(%(x)s)[1], (size_t)512);
int n_shared_bytes = PyGpuArray_DIMS(%(x)s)[1] *
2 * sizeof(npy_%(dtype_x)s);
if (PyGpuArray_DIMS(%(x)s)[0] > 0)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论