提交 53a76526 编写于 作者: M Megvii Engine Team

fix(opencl): fix MGE_WITH_OPENCL_ONLY crash on some

model, eg, use type_cvt.
at load stage, some(StaticInferOpr) naive op->exe will be called
do not check elemwise_multi_type, as ocl do not run quantization
model

GitOrigin-RevId: 510df237428ca76b02f7c776cdec683e52c1a7bc
上级 65a3ac85
......@@ -112,7 +112,6 @@ void reduce_fwd(
}
}
#if !MGE_BUILD_WITHOUT_NAIVE_EXEC
template <>
void reduce_fwd<Mode::SUM>(
const dt_quint8* __restrict, dt_quint8* __restrict, size_t, size_t, size_t) {
......@@ -176,7 +175,6 @@ void reduce_fwd<Mode::PRODUCT>(
"Reduce (PRODUCT) with DEFAULT DataType is not supported "
"on QuantizedS8");
}
#endif
template <Mode mode>
void dispatch_dtype(
......@@ -240,7 +238,6 @@ size_t ReduceForwardImpl::get_workspace_in_bytes(
void ReduceForwardImpl::exec(
_megdnn_tensor_in src, _megdnn_tensor_out dst, _megdnn_workspace workspace) {
#if !MGE_BUILD_WITHOUT_NAIVE_EXEC
using namespace reduce;
check_exec(src.layout, dst.layout, workspace.size);
size_t A, B, C;
......@@ -307,9 +304,6 @@ void ReduceForwardImpl::exec(
megdnn_assert_internal(false);
}
#undef CASE
#else
__builtin_trap();
#endif
}
} // namespace naive
......
......@@ -78,7 +78,6 @@ void on_dest_ctype(HandleImpl* handle, const TensorND& dest, const TensorND& src
} // anonymous namespace
void TypeCvtImpl::exec(_megdnn_tensor_in src, _megdnn_tensor_out dst) {
#if !MGE_BUILD_WITHOUT_NAIVE_EXEC
check_exec(src.layout, dst.layout);
// exec
......@@ -96,9 +95,6 @@ void TypeCvtImpl::exec(_megdnn_tensor_in src, _megdnn_tensor_out dst) {
#undef cb
default : megdnn_throw("bad dtype");
}
#else
__builtin_trap();
#endif
}
// vim: syntax=cpp.doxygen
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册