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

Method exec

dnn/src/armv7/rotate/opr_impl.cpp:270–289  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268namespace armv7 {
269
270void RotateImpl::exec(
271 _megdnn_tensor_in src, _megdnn_tensor_in dst, _megdnn_workspace workspace) {
272 using namespace megcv;
273 check_exec(src.layout, dst.layout, workspace.size);
274
275 //! rotate only support data type is uchar and the channel size is 1
276 if (dst.layout.dtype != dtype::Uint8() || src.layout.shape[3] != 1) {
277 return fallback::RotateImpl::exec(src, dst, workspace);
278 }
279
280 auto clockwise = param().clockwise;
281
282 MEGDNN_DISPATCH_CPU_KERN_OPR({
283 for (size_t i = 0; i < src.layout.shape[0]; ++i) {
284 Mat<uchar> src_mat = TensorND2Mat<uchar>(src, i);
285 Mat<uchar> dst_mat = TensorND2Mat<uchar>(dst, i);
286 rotate(src_mat, dst_mat, clockwise);
287 }
288 });
289}
290
291} // namespace armv7
292} // namespace megdnn

Callers

nothing calls this directly

Calls 3

rotateFunction · 0.70
execFunction · 0.50
paramFunction · 0.50

Tested by

no test coverage detected