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

Method exec

dnn/src/cuda/cumsum/opr_impl.cpp:36–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34} // anonymous namespace
35
36void CumsumForwardImpl::exec(
37 _megdnn_tensor_in src, _megdnn_tensor_in dst, _megdnn_workspace workspace) {
38 check_exec(src.layout, dst.layout, workspace.size);
39 size_t A, B, C;
40 reduce::get_ABC(src.layout, A, B, C, param().axis);
41 auto stream = cuda_stream(handle());
42#define cb(DType) \
43 if (src.layout.dtype == DType()) { \
44 using ctype = DTypeTrait<DType>::ctype; \
45 dispatch<ctype, SumOp<ctype>>( \
46 dst.ptr<ctype>(), workspace.ptr<ctype>(), workspace.size, A, B, C, \
47 param().exclusive, param().reverse, src.ptr<ctype>(), stream); \
48 return; \
49 }
50 MEGDNN_FOREACH_COMPUTING_DTYPE(cb)
51#undef cb
52 megdnn_assert_internal(false);
53}
54
55size_t CumsumForwardImpl::get_workspace_in_bytes(
56 const TensorLayout& src, const TensorLayout&) {

Callers

nothing calls this directly

Calls 3

get_ABCFunction · 0.85
cuda_streamFunction · 0.85
paramFunction · 0.50

Tested by

no test coverage detected