| 55 | } // anonymous namespace |
| 56 | |
| 57 | void IndexingRemapForwardImpl::exec( |
| 58 | _megdnn_tensor_in src, _megdnn_tensor_in map, _megdnn_tensor_out dst, |
| 59 | _megdnn_workspace workspace) { |
| 60 | #if !MGE_BUILD_WITHOUT_NAIVE_EXEC |
| 61 | check_exec(src.layout, map.layout, dst.layout, workspace.size); |
| 62 | switch (src.layout.dtype.enumv()) { |
| 63 | #define cb(dt) \ |
| 64 | case DTypeTrait<dt>::enumv: \ |
| 65 | MEGDNN_DISPATCH_CPU_KERN_OPR(forward<DTypeTrait<dt>::ctype>(src, map, dst)); \ |
| 66 | return; |
| 67 | cb(dtype::Float32) cb(dtype::Int32) |
| 68 | #undef cb |
| 69 | |
| 70 | default : megdnn_throw(ssprintf( |
| 71 | "unsupported dtype %s in indexing " |
| 72 | "remap forward naive\n", |
| 73 | src.layout.dtype.name())); |
| 74 | } |
| 75 | #else |
| 76 | __builtin_trap(); |
| 77 | #endif |
| 78 | } |
| 79 | |
| 80 | void IndexingRemapBackwardImpl::exec( |
| 81 | _megdnn_tensor_in diff, _megdnn_tensor_in map, _megdnn_tensor_out grad, |