MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / exec

Method exec

dnn/src/fallback/concat/opr_impl.cpp:34–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32namespace fallback {
33
34void ConcatImpl::exec(
35 _megdnn_in const TensorNDArray& srcs, _megdnn_tensor_out dst,
36 _megdnn_workspace workspace) {
37 auto srcs_layout = apply_vector<TensorLayout>(m_get_layout, srcs);
38 auto srcs_shape = apply_vector<TensorShape>(m_get_shape, srcs_layout);
39 check_exec(srcs_layout, dst.layout, workspace.size);
40 size_t* Bv = reinterpret_cast<size_t*>(workspace.raw_ptr);
41 size_t A, B, C;
42 get_ABC(srcs_shape, A, Bv, C);
43 B = std::accumulate(Bv, Bv + srcs.size(), 0u);
44 switch (srcs[0].layout.dtype.enumv()) {
45#define parser(_dt) \
46 case DTypeTrait<_dt>::enumv: { \
47 using ctype = typename DTypeTrait<_dt>::ctype; \
48 MEGDNN_DISPATCH_CPU_KERN_OPR( \
49 concat::exec_generic<ctype>(srcs, dst, A, B, C, Bv)); \
50 break; \
51 };
52 MEGDNN_FOREACH_COMPUTING_DTYPE(parser)
53 default: {
54 naive::ConcatForwardImpl::exec(srcs, dst, workspace);
55 }
56#undef parser
57 }
58}
59} // namespace fallback
60} // namespace megdnn
61

Callers

nothing calls this directly

Calls 4

get_ABCFunction · 0.85
execFunction · 0.50
sizeMethod · 0.45
enumvMethod · 0.45

Tested by

no test coverage detected