| 31 | namespace arrayfire { |
| 32 | namespace oneapi { |
| 33 | vector<af_index_t> indexForTopK(const int k) { |
| 34 | af_index_t idx; |
| 35 | idx.idx.seq = af_seq{0.0, static_cast<double>(k) - 1.0, 1.0}; |
| 36 | idx.isSeq = true; |
| 37 | idx.isBatch = false; |
| 38 | |
| 39 | af_index_t sp; |
| 40 | sp.idx.seq = af_span; |
| 41 | sp.isSeq = true; |
| 42 | sp.isBatch = false; |
| 43 | |
| 44 | return vector<af_index_t>({idx, sp, sp, sp}); |
| 45 | } |
| 46 | |
| 47 | template<typename T> |
| 48 | void topk(Array<T>& vals, Array<unsigned>& idxs, const Array<T>& in, |