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

Function topk

src/api/c/topk.cpp:27–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25
26template<typename T>
27af_err topk(af_array *v, af_array *i, const af_array in, const int k,
28 const int dim, const af_topk_function order) {
29 auto vals = createEmptyArray<T>(af::dim4());
30 auto idxs = createEmptyArray<unsigned>(af::dim4());
31
32 topk(vals, idxs, getArray<T>(in), k, dim, order);
33
34 *v = getHandle<T>(vals);
35 *i = getHandle<unsigned>(idxs);
36 return AF_SUCCESS;
37}
38} // namespace
39
40af_err af_topk(af_array *values, af_array *indices, const af_array in,

Callers 2

TEST_PFunction · 0.50
TESTFunction · 0.50

Calls 1

dim4Class · 0.50

Tested by

no test coverage detected