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