提交 5af52746 编写于 作者: M Megvii Engine Team

fix(mgb): fix bug caused by conv filter size is too big

GitOrigin-RevId: 7fe3a9fcf12e61e8d4a23d5052b953b907c3ef4a
上级 b0ba6d32
...@@ -20,6 +20,12 @@ using namespace convolution; ...@@ -20,6 +20,12 @@ using namespace convolution;
bool ConvolutionBackwardDataImpl::AlgoChanwise::is_available( bool ConvolutionBackwardDataImpl::AlgoChanwise::is_available(
const SizeArgs& args) const { const SizeArgs& args) const {
auto kparam = chanwise::Param::from_fwd_args(args.as_fwd_args());
auto&& device_prop = cuda::current_device_prop();
if (device_prop.sharedMemPerBlock <
kparam.chl_mul * kparam.flt_h * kparam.flt_w * args.diff_layout->dtype.size()) {
return false;
}
if (!args.grad_layout->is_contiguous() || !args.diff_layout->is_contiguous()) { if (!args.grad_layout->is_contiguous() || !args.diff_layout->is_contiguous()) {
return false; return false;
} }
......
...@@ -28,7 +28,13 @@ ...@@ -28,7 +28,13 @@
do { \ do { \
cudaError_t _err = (_x); \ cudaError_t _err = (_x); \
if (_err != cudaSuccess) { \ if (_err != cudaSuccess) { \
::megdnn::cuda::__throw_cuda_error__(_err, #_x); \ std::string x = std::string(#_x); \
char line[10]; \
sprintf(line, "%d", __LINE__); \
::megdnn::cuda::__throw_cuda_error__( \
_err, (x + " error file:" + std::string(__FILE__) + ":" + \
std::string(line)) \
.c_str()); \
} \ } \
} while (0) } while (0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册