| 35 | /* =========================== MeshIndexing ============================ */ |
| 36 | template <typename T> |
| 37 | void exec_mesh_indexing( |
| 38 | const TensorND& src_tensor, const MeshIndexing::IndexDesc& desc, |
| 39 | const TensorND& dst_tensor) { |
| 40 | // normal mesh indexing. |
| 41 | auto iter = tensor_iter<T>(dst_tensor).begin(); |
| 42 | size_t ndim = dst_tensor.layout.ndim; |
| 43 | auto ptr = src_tensor.ptr<T>(); |
| 44 | for (size_t dst_idx = 0; dst_idx < dst_tensor.layout.total_nr_elems(); ++dst_idx) { |
| 45 | int index[TensorShape::MAX_NDIM]; |
| 46 | std::copy(iter.idx(), iter.idx() + ndim, index); |
| 47 | size_t src_idx = get_index(src_tensor, dst_tensor, desc, index); |
| 48 | *iter = ptr[src_idx]; |
| 49 | ++iter; |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | void MeshIndexingImpl::exec( |
| 54 | _megdnn_tensor_in src, const IndexDesc& desc, _megdnn_tensor_out dst, |
nothing calls this directly
no test coverage detected