| 49 | } |
| 50 | |
| 51 | void ArgmaxForwardImpl::exec( |
| 52 | _megdnn_tensor_in src, _megdnn_tensor_out dst, _megdnn_workspace workspace) { |
| 53 | check_exec(src.layout, dst.layout, workspace.size); |
| 54 | size_t A, B, C; |
| 55 | reduce::get_ABC(src.layout, A, B, C, param().axis); |
| 56 | auto stream = hip_stream(handle()); |
| 57 | #define cb(dt) \ |
| 58 | if (src.layout.dtype.enumv() == DTypeTrait<dt>::enumv) { \ |
| 59 | using ctype = typename DTypeTrait<dt>::ctype; \ |
| 60 | exec_impl<ctype, true>( \ |
| 61 | src.ptr<ctype>(), dst.ptr<dt_int32>(), workspace.raw_ptr, A, B, C, \ |
| 62 | stream); \ |
| 63 | return; \ |
| 64 | } |
| 65 | MEGDNN_FOREACH_COMPUTING_DTYPE_FLOAT(cb) |
| 66 | #undef cb |
| 67 | megdnn_throw(ssprintf("Unsupported DType: %s", src.layout.dtype.name())); |
| 68 | } |
| 69 | |
| 70 | size_t ArgminForwardImpl::get_workspace_in_bytes( |
| 71 | const TensorLayout& src, const TensorLayout& dst) { |
nothing calls this directly
no test coverage detected