MCPcopy Create free account
hub / github.com/FlashSampling/FlashSampling / argsort_desc_kernel

Function argsort_desc_kernel

tests/test_tl_argsort.py:10–16  ·  view source on GitHub ↗
(x_ptr, out_vals_ptr, out_ids_ptr, N: tl.constexpr)

Source from the content-addressed store, hash-verified

8
9@triton.jit
10def argsort_desc_kernel(x_ptr, out_vals_ptr, out_ids_ptr, N: tl.constexpr): # noqa: N803
11 offs = tl.arange(0, N)
12 x = tl.load(x_ptr + offs)
13 ids = offs.to(tl.int32)
14 sorted_x, sorted_ids = argsort(x, ids, descending=True)
15 tl.store(out_vals_ptr + offs, sorted_x)
16 tl.store(out_ids_ptr + offs, sorted_ids)
17
18
19@triton.jit

Callers

nothing calls this directly

Calls 1

argsortFunction · 0.90

Tested by

no test coverage detected