Scatter data to a pool according to an index mapping */
| 206 | |
| 207 | /** Scatter data to a pool according to an index mapping */ |
| 208 | void scatter(std::vector<Data> &memory, const std::vector<Index> &mapping) { |
| 209 | if (!mapping.empty()) { |
| 210 | for (Index i = 0; i < count; i++) |
| 211 | memory[mapping[i]] = host_ptr[i]; |
| 212 | } |
| 213 | else { |
| 214 | for (Index i = 0; i < count; i++) |
| 215 | memory[i] = host_ptr[i]; |
| 216 | } |
| 217 | } |
| 218 | |
| 219 | /** Scatter data to a pool by addition, according to an index mapping */ |
| 220 | void scatter_add(std::vector<Data> &memory, const std::vector<Index> &mapping) { |
no outgoing calls
no test coverage detected