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

Function resize_cv_proxy

dnn/src/cuda/resize/forward.cpp:15–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13namespace {
14
15void resize_cv_proxy(
16 _megdnn_tensor_in src, _megdnn_tensor_out dst, InterpolationMode imode,
17 void* workspace, cudaStream_t stream) {
18 using namespace megcv;
19 for (size_t i = 0; i < src.layout.shape[0]; ++i) {
20 if (dst.layout.dtype == dtype::Float32()) {
21 Mat<float> src_mat = TensorND2Mat<float>(src, i);
22 Mat<float> dst_mat = TensorND2Mat<float>(dst, i);
23 resize::resize_cv<float>(
24 src_mat.ptr(), dst_mat.ptr(), src_mat.rows(), src_mat.cols(),
25 dst_mat.rows(), dst_mat.cols(), src_mat.step(), dst_mat.step(),
26 src_mat.channels(), imode, workspace, stream);
27 } else if (dst.layout.dtype == dtype::Uint8()) {
28 Mat<uchar> src_mat = TensorND2Mat<uchar>(src, i);
29 Mat<uchar> dst_mat = TensorND2Mat<uchar>(dst, i);
30 resize::resize_cv<uchar>(
31 src_mat.ptr(), dst_mat.ptr(), src_mat.rows(), src_mat.cols(),
32 dst_mat.rows(), dst_mat.cols(), src_mat.step(), dst_mat.step(),
33 src_mat.channels(), imode, workspace, stream);
34 } else {
35 megdnn_throw("Unsupported datatype of WarpAffine optr.");
36 }
37 }
38}
39
40} // anonymous namespace
41

Callers 1

execMethod · 0.85

Calls 5

ptrMethod · 0.45
rowsMethod · 0.45
colsMethod · 0.45
stepMethod · 0.45
channelsMethod · 0.45

Tested by

no test coverage detected