MCPcopy Index your code
hub / github.com/tinygrad/tinygrad / custom_sum

Function custom_sum

test/backend/test_custom_kernel.py:44–48  ·  view source on GitHub ↗
(B:UOp, A:UOp)

Source from the content-addressed store, hash-verified

42 return prog.sink(arg=KernelInfo(name=f"custom_gemm_{C.shape[0]}_{C.shape[1]}_{A.shape[1]}", opts_to_apply=()))
43
44def custom_sum(B:UOp, A:UOp) -> UOp:
45 i = UOp.range(A.shape[0], 0, axis_type=AxisType.REDUCE)
46 B = B[0].set(0.0)
47 B = B[0].set(B.after(i)[0] + A[i], end=i)
48 return B.sink(arg=KernelInfo(name=f"custom_sum_{A.shape[0]}", opts_to_apply=()))
49
50def flip_contract_kernel(dest:UOp, src:UOp):
51 i = UOp.range(dest.shape[0], 0)

Callers

nothing calls this directly

Calls 5

KernelInfoClass · 0.90
rangeMethod · 0.45
setMethod · 0.45
afterMethod · 0.45
sinkMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…