Removed TensorInfo from example shader
This commit is contained in:
parent
c62bead6e9
commit
3d9cb4df04
@ -3,11 +3,7 @@ enable f16;
|
||||
@group(0) @binding(0) var<storage, read> A: array<f16>;
|
||||
@group(0) @binding(1) var<storage, read> B: array<f16>;
|
||||
@group(0) @binding(2) var<storage, read_write> C: array<f16>;
|
||||
|
||||
struct TensorInfo {
|
||||
size: u32,
|
||||
};
|
||||
@group(0) @binding(3) var<uniform> info: TensorInfo;
|
||||
@group(0) @binding(3) var<uniform> size: u32;
|
||||
|
||||
@compute @workgroup_size(256)
|
||||
fn main(
|
||||
@ -21,7 +17,7 @@ fn main(
|
||||
var index = global_id.x;
|
||||
|
||||
// 3. Stride through the tensor elements
|
||||
while (index < info.size) {
|
||||
while (index < size) {
|
||||
C[index] = A[index] + B[index];
|
||||
index += total_threads; // Jump forward by the total thread count
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user