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