MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / indexForTopK

Function indexForTopK

src/backend/oneapi/topk.cpp:33–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31namespace arrayfire {
32namespace oneapi {
33vector<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
47template<typename T>
48void topk(Array<T>& vals, Array<unsigned>& idxs, const Array<T>& in,

Callers 1

topkFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected