| 32 | namespace cpu { |
| 33 | template<typename T> |
| 34 | void assign(Array<T>& out, const af_index_t idxrs[], const Array<T>& rhs) { |
| 35 | vector<bool> isSeq(4); |
| 36 | vector<af_seq> seqs(4, af_span); |
| 37 | // create seq vector to retrieve output dimensions, offsets & offsets |
| 38 | for (dim_t x = 0; x < 4; ++x) { |
| 39 | if (idxrs[x].isSeq) { seqs[x] = idxrs[x].idx.seq; } |
| 40 | isSeq[x] = idxrs[x].isSeq; |
| 41 | } |
| 42 | |
| 43 | vector<Array<uint>> idxArrs(4, createEmptyArray<uint>(dim4())); |
| 44 | // look through indexs to read af_array indexs |
| 45 | for (dim_t x = 0; x < 4; ++x) { |
| 46 | if (!isSeq[x]) { |
| 47 | idxArrs[x] = castArray<uint>(idxrs[x].idx.arr); |
| 48 | idxArrs[x].eval(); |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | vector<CParam<uint>> idxParams(idxArrs.begin(), idxArrs.end()); |
| 53 | getQueue().enqueue(kernel::assign<T>, out, out.getDataDims(), rhs, |
| 54 | move(isSeq), move(seqs), move(idxParams)); |
| 55 | } |
| 56 | |
| 57 | #define INSTANTIATE(T) \ |
| 58 | template void assign<T>(Array<T> & out, const af_index_t idxrs[], \ |
nothing calls this directly
no test coverage detected