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

Method exec

dnn/src/cuda/repeat/opr_impl.cpp:12–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10namespace cuda {
11
12void RepeatForwardImpl::exec(
13 _megdnn_tensor_in src, _megdnn_tensor_out dst, _megdnn_workspace workspace) {
14 check_exec(src.layout, dst.layout, workspace.size);
15 auto stream = cuda_stream(this->handle());
16 TensorShape sshape, dshape, tshape;
17 simplify_shape(src.layout, dst.layout, param().times, sshape, dshape, tshape);
18#define cb(DType) \
19 if (src.layout.dtype.enumv() == DTypeTrait<DType>::enumv) { \
20 using ctype = typename DTypeTrait<DType>::ctype; \
21 repeat::forward_proxy<ctype>( \
22 src.ptr<ctype>(), dst.ptr<ctype>(), sshape.ndim, sshape.shape, \
23 dshape.shape, tshape.shape, stream); \
24 }
25 MEGDNN_FOREACH_COMPUTING_DTYPE(cb)
26#undef cb
27}
28
29RepeatBackwardImpl::RepeatBackwardImpl(Handle* handle)
30 : RepeatBackward(handle), m_opr(handle->create_operator<Reduce>()) {

Callers 1

exec_internalMethod · 0.45

Calls 3

cuda_streamFunction · 0.85
paramFunction · 0.50
handleMethod · 0.45

Tested by

no test coverage detected