MCPcopy Create free account
hub / github.com/KomputeProject/kompute / compute_mult

Function compute_mult

python/test/test_array_multiplication.py:20–25  ·  view source on GitHub ↗
(index=("input", "GlobalInvocationId", ps.ivec3),
                                data1=("buffer", 0, ps.Array(ps.f32)),
                                data2=("buffer", 1, ps.Array(ps.f32)),
                                data3=("buffer", 2, ps.Array(ps.f32)))

Source from the content-addressed store, hash-verified

18 # 4. Define the multiplication shader code to run on the GPU
19 @ps.python2shader
20 def compute_mult(index=("input", "GlobalInvocationId", ps.ivec3),
21 data1=("buffer", 0, ps.Array(ps.f32)),
22 data2=("buffer", 1, ps.Array(ps.f32)),
23 data3=("buffer", 2, ps.Array(ps.f32))):
24 i = index.x
25 data3[i] = data1[i] * data2[i]
26
27 (mgr.sequence()
28 .record(kp.OpTensorSyncDevice(params))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected