提交 1c3d1f86 编写于 作者: M Megvii Engine Team

fix(dnn): fix Image2DPack4TensorFormat check

GitOrigin-RevId: b9a8ae4e1ab4bb8ca978e3664e39b509250474fd
上级 7886ff9a
......@@ -306,6 +306,15 @@ void RelayoutFormat::deduce_format(TensorFormat src, TensorFormat& dst) {
megdnn_throw("Invalid relayout format mode");
break;
}
if (!dst.is_default() &&
(
handle()->type() != Handle::HandleType::NAIVE)) {
megdnn_throw(
"Only naive and opencl handle support "
"Image2DPack4TensorFormat, try to export MGB_USE_MEGDNN_DBG=2 "
"to enable naive handle");
}
#undef CHECK_SRC
}
......
......@@ -107,11 +107,7 @@ HandleImpl::HandleImpl(megcoreComputingHandle_t computing_handle,
m_dispatcher{megcoreGetCPUDispatcher(computing_handle)} {}
size_t HandleImpl::image2d_pitch_alignment() const {
if (type() == Handle::HandleType::NAIVE) {
// only naive CPU handle supports this format
return g_image2d_pitch_alignment;
}
megdnn_throw("Image2DTensorFormat is not supported on this handle");
return g_image2d_pitch_alignment;
}
size_t HandleImpl::exchange_image2d_pitch_alignment(size_t alignment) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册