| 101 | } |
| 102 | |
| 103 | void ClScatter::run(ITensorPack &tensors) |
| 104 | { |
| 105 | // Get tensors. |
| 106 | auto src = tensors.get_const_tensor(ACL_SRC_0); |
| 107 | auto updates = tensors.get_const_tensor(ACL_SRC_1); |
| 108 | auto indices = tensors.get_const_tensor(ACL_SRC_2); |
| 109 | auto dst = tensors.get_tensor(ACL_DST); |
| 110 | |
| 111 | if (_fill_zero) |
| 112 | { |
| 113 | // Fill destination tensor with 0 values if zero init. |
| 114 | ITensorPack fill_pack{{ACL_SRC, dst}}; |
| 115 | CLScheduler::get().enqueue_op(*_fill_kernel, fill_pack, false); |
| 116 | } |
| 117 | |
| 118 | if (_run_copy) |
| 119 | { |
| 120 | // copy src to dst before scatter op. |
| 121 | ITensorPack copy_pack{{ACL_SRC, src}, {ACL_DST, dst}}; |
| 122 | CLScheduler::get().enqueue_op(*_copy_kernel, copy_pack, false); |
| 123 | } |
| 124 | |
| 125 | ITensorPack scatter_pack{{ACL_SRC_0, updates}, {ACL_SRC_1, indices}, {ACL_DST, dst}}; |
| 126 | CLScheduler::get().enqueue_op(*_scatter_kernel, scatter_pack, false); |
| 127 | } |
| 128 | |
| 129 | } // namespace opencl |
| 130 | } // namespace arm_compute |
nothing calls this directly
no test coverage detected