提交 5ce08bc8 authored 作者: Boris Fomitchev's avatar Boris Fomitchev 提交者: notoraptor

Fixed caching for fallback, warnings

上级 cb891e83
...@@ -197,8 +197,8 @@ static std::string dnn_conv_shape(cudnnTensorDescriptor_t inputDesc, PyGpuArrayO ...@@ -197,8 +197,8 @@ static std::string dnn_conv_shape(cudnnTensorDescriptor_t inputDesc, PyGpuArrayO
(PyGpuArray_DIMS(output)[1] / groups != expected_output_dims[1]) || (PyGpuArray_DIMS(output)[1] / groups != expected_output_dims[1]) ||
(PyGpuArray_DIMS(output)[2] != expected_output_dims[2]) || (PyGpuArray_DIMS(output)[2] != expected_output_dims[2]) ||
(PyGpuArray_DIMS(output)[3] != expected_output_dims[3])) { (PyGpuArray_DIMS(output)[3] != expected_output_dims[3])) {
PyErr_Format(PyExc_ValueError, "impossible convolution output dim: expected %ldx%ldx%ldx%ld" PyErr_Format(PyExc_ValueError, "impossible convolution output dim: expected %dx%dx%dx%d"
" but received gradient with shape %dx%dx% dx%d", " but received gradient with shape %ldx%ldx%ldx%ld",
expected_output_dims[0], expected_output_dims[1] / groups, expected_output_dims[0], expected_output_dims[1] / groups,
expected_output_dims[2], expected_output_dims[3], expected_output_dims[2], expected_output_dims[3],
PyGpuArray_DIMS(output)[0], PyGpuArray_DIMS(output)[1], PyGpuArray_DIMS(output)[0], PyGpuArray_DIMS(output)[1],
...@@ -211,7 +211,7 @@ static std::string dnn_conv_shape(cudnnTensorDescriptor_t inputDesc, PyGpuArrayO ...@@ -211,7 +211,7 @@ static std::string dnn_conv_shape(cudnnTensorDescriptor_t inputDesc, PyGpuArrayO
(PyGpuArray_DIMS(output)[2] != expected_output_dims[2]) || (PyGpuArray_DIMS(output)[2] != expected_output_dims[2]) ||
(PyGpuArray_DIMS(output)[3] != expected_output_dims[3]) || (PyGpuArray_DIMS(output)[3] != expected_output_dims[3]) ||
(PyGpuArray_DIMS(output)[4] != expected_output_dims[4])) { (PyGpuArray_DIMS(output)[4] != expected_output_dims[4])) {
PyErr_Format(PyExc_ValueError, "impossible convolution output dim: expected %ldx%ldx%ldx%ldx%ld" PyErr_Format(PyExc_ValueError, "impossible convolution output dim: expected %dx%dx%dx%dx%d"
" but received gradient with shape %ldx%ldx%ldx%ldx%ld", " but received gradient with shape %ldx%ldx%ldx%ldx%ld",
expected_output_dims[0], expected_output_dims[1], expected_output_dims[0], expected_output_dims[1],
expected_output_dims[2], expected_output_dims[3], expected_output_dims[2], expected_output_dims[3],
......
...@@ -231,8 +231,9 @@ APPLY_SPECIFIC(conv_fwd)(PyGpuArrayObject *input, PyGpuArrayObject *kerns, ...@@ -231,8 +231,9 @@ APPLY_SPECIFIC(conv_fwd)(PyGpuArrayObject *input, PyGpuArrayObject *kerns,
cuda_exit(c->ctx); cuda_exit(c->ctx);
return 1; return 1;
} }
// save worksize for next time/cache // save for next time/cache
prev_algo.wsSize = worksize; prev_algo.wsSize = worksize;
prev_algo.algo = algo;
// Add to the cache, even if this node use *_once algo // Add to the cache, even if this node use *_once algo
// (in case the user specify the algo per layer and not globally). // (in case the user specify the algo per layer and not globally).
......
...@@ -247,8 +247,9 @@ APPLY_SPECIFIC(conv_gi)(PyGpuArrayObject *kerns, PyGpuArrayObject *output, ...@@ -247,8 +247,9 @@ APPLY_SPECIFIC(conv_gi)(PyGpuArrayObject *kerns, PyGpuArrayObject *output,
cuda_exit(c->ctx); cuda_exit(c->ctx);
return 1; return 1;
} }
// save worksize for next time/cache // save for next time/cache
prev_algo.wsSize = worksize; prev_algo.wsSize = worksize;
prev_algo.algo = algo;
// Add to the cache // Add to the cache
if (params->choose_algo) if (params->choose_algo)
......
...@@ -219,8 +219,9 @@ APPLY_SPECIFIC(conv_gw)(PyGpuArrayObject *input, PyGpuArrayObject *output, ...@@ -219,8 +219,9 @@ APPLY_SPECIFIC(conv_gw)(PyGpuArrayObject *input, PyGpuArrayObject *output,
} }
} }
// save worksize for next time/cache // save for next time/cache
prev_algo.wsSize = worksize; prev_algo.wsSize = worksize;
prev_algo.algo = algo;
// Add to the cache // Add to the cache
if (params->choose_algo) if (params->choose_algo)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论