| 26 | } // anonymous namespace |
| 27 | |
| 28 | float MaxTensorDiffImpl::exec( |
| 29 | _megdnn_tensor_in src1, _megdnn_tensor_in src2, _megdnn_workspace workspace) { |
| 30 | check_exec(src1.layout, src2.layout, workspace.size); |
| 31 | float result = 0.f; |
| 32 | |
| 33 | auto run = [&]() { |
| 34 | |
| 35 | #define cb(DType) \ |
| 36 | if (src1.layout.dtype == DType()) { \ |
| 37 | using ctype = typename DTypeTrait<DType>::ctype; \ |
| 38 | result = exec_forward<ctype>( \ |
| 39 | src1.ptr<ctype>(), src2.ptr<ctype>(), src1.layout.total_nr_elems()); \ |
| 40 | } |
| 41 | MEGDNN_FOREACH_COMPUTING_DTYPE(cb) |
| 42 | #undef cb |
| 43 | }; |
| 44 | |
| 45 | auto handle = static_cast<HandleImpl*>(this->handle()); |
| 46 | handle->dispatch_kern(run); |
| 47 | handle->megcore_dispatcher()->sync(); |
| 48 | |
| 49 | return result; |
| 50 | } |
| 51 | |
| 52 | // vim: syntax=cpp.doxygen |
nothing calls this directly
no test coverage detected