(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)))
| 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)) |
nothing calls this directly
no outgoing calls
no test coverage detected