提交 8f17b84a 编写于 作者: M Megvii Engine Team

fix(dnn): fix dnn run cd4 on cpu

GitOrigin-RevId: 5eae7496e58077d9f84feaf4283de7fd0c762a9b
上级 81065cf0
......@@ -26,6 +26,27 @@ public:
ATLAS = 13,
CAMBRICON = 12,
};
static std::string handle_type_name(HandleType handle) {
#define INSTANCE_HANDLE(name) \
case HandleType::name: \
return #name
switch (handle) {
INSTANCE_HANDLE(NAIVE);
INSTANCE_HANDLE(FALLBACK);
INSTANCE_HANDLE(X86);
INSTANCE_HANDLE(ARM_COMMON);
INSTANCE_HANDLE(ARMV7);
INSTANCE_HANDLE(AARCH64);
INSTANCE_HANDLE(CUDA);
INSTANCE_HANDLE(ROCM);
INSTANCE_HANDLE(ATLAS);
INSTANCE_HANDLE(CAMBRICON);
default:
return "Unknown";
}
#undef INSTANCE_HANDLE
}
//! Device vendor
enum class HandleVendorType : uint32_t {
......
......@@ -395,9 +395,19 @@ void RelayoutFormat::deduce_format(TensorFormat src, TensorFormat& dst) {
(
handle()->type() != Handle::HandleType::NAIVE &&
handle()->type() != Handle::HandleType::X86)) {
megdnn_throw(
"Dump with Image2DPack4TensorFormat is not available on CUDA compnode, "
"try export CUDA_VISIBLE_DEVICES=\'\'");
if (Handle::HandleType::CUDA == handle()->type()) {
megdnn_throw(
"Dump with Image2DPack4TensorFormat is not available on CUDA "
"compnode, "
"try export CUDA_VISIBLE_DEVICES=\'\'");
} else {
auto handle_number = handle()->type();
megdnn_throw(ssprintf(
"Dump with Image2DPack4TensorFormat is not available on %s "
"compnode, try export %cGB_USE_%cEGDNN_DBG=2 ",
Handle::handle_type_name(handle_number).c_str(), 'M', 'M'));
}
}
#undef CHECK_SRC
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册