| 9 | |
| 10 | #if !MEGDNN_NO_THREAD |
| 11 | TEST(DISPATCHER, WARP_PERSPECTIVE) { |
| 12 | std::shared_ptr<MegcoreCPUDispatcher> dispatcher = |
| 13 | std::make_shared<NullDispatcher>(); |
| 14 | auto handle = create_cpu_handle_with_dispatcher(0, dispatcher); |
| 15 | |
| 16 | auto opr = handle->create_operator<WarpPerspective>(); |
| 17 | auto src_layout = TensorLayout({2, 3, 10, 10}, dtype::Float32()), |
| 18 | mat_layout = TensorLayout({2, 3, 3}, dtype::Float32()), |
| 19 | dst_layout = TensorLayout({2, 3, 10, 10}, dtype::Float32()); |
| 20 | TensorND src(nullptr, src_layout), mat(nullptr, mat_layout), |
| 21 | dst(nullptr, dst_layout); |
| 22 | opr->param().imode = param::WarpPerspective::InterpolationMode::LINEAR; |
| 23 | auto wsize = opr->get_workspace_in_bytes(src_layout, mat_layout, dst_layout); |
| 24 | Workspace workspace(nullptr, wsize); |
| 25 | |
| 26 | opr->exec(src, mat, dst, workspace); |
| 27 | } |
| 28 | #endif |
| 29 | |
| 30 | } // namespace test |
nothing calls this directly
no test coverage detected