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

Method exec

dnn/src/naive/tensor_remap/opr_impl.cpp:57–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55} // anonymous namespace
56
57void IndexingRemapForwardImpl::exec(
58 _megdnn_tensor_in src, _megdnn_tensor_in map, _megdnn_tensor_out dst,
59 _megdnn_workspace workspace) {
60#if !MGE_BUILD_WITHOUT_NAIVE_EXEC
61 check_exec(src.layout, map.layout, dst.layout, workspace.size);
62 switch (src.layout.dtype.enumv()) {
63#define cb(dt) \
64 case DTypeTrait<dt>::enumv: \
65 MEGDNN_DISPATCH_CPU_KERN_OPR(forward<DTypeTrait<dt>::ctype>(src, map, dst)); \
66 return;
67 cb(dtype::Float32) cb(dtype::Int32)
68#undef cb
69
70 default : megdnn_throw(ssprintf(
71 "unsupported dtype %s in indexing "
72 "remap forward naive\n",
73 src.layout.dtype.name()));
74 }
75#else
76 __builtin_trap();
77#endif
78}
79
80void IndexingRemapBackwardImpl::exec(
81 _megdnn_tensor_in diff, _megdnn_tensor_in map, _megdnn_tensor_out grad,

Callers

nothing calls this directly

Calls 3

cbFunction · 0.50
enumvMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected