Removed waiting for each run and moved it in bench directly
This commit is contained in:
parent
f56dfe7ecc
commit
38538fcd80
@ -185,7 +185,6 @@ fn submitPass(
|
|||||||
defer c.wgpuCommandEncoderRelease(enc);
|
defer c.wgpuCommandEncoderRelease(enc);
|
||||||
defer c.wgpuCommandBufferRelease(cmd);
|
defer c.wgpuCommandBufferRelease(cmd);
|
||||||
c.wgpuQueueSubmit(gloc.device.queue, 1, &cmd);
|
c.wgpuQueueSubmit(gloc.device.queue, 1, &cmd);
|
||||||
_ = c.wgpuDevicePoll(gloc.device.device, 1, null); // Wait for it to be done
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn ceilDiv(n: usize, d: usize) usize {
|
fn ceilDiv(n: usize, d: usize) usize {
|
||||||
|
|||||||
@ -4,6 +4,8 @@ const GpuAllocator = @import("GpuAllocator.zig");
|
|||||||
const GpuPipeline = @import("GpuPipeline.zig");
|
const GpuPipeline = @import("GpuPipeline.zig");
|
||||||
const Vec = @import("Vec.zig");
|
const Vec = @import("Vec.zig");
|
||||||
|
|
||||||
|
const c = @import("c.zig").c;
|
||||||
|
|
||||||
pub fn main(init: std.process.Init) !void {
|
pub fn main(init: std.process.Init) !void {
|
||||||
const device = try GpuDevice.init();
|
const device = try GpuDevice.init();
|
||||||
defer device.deinit();
|
defer device.deinit();
|
||||||
@ -33,10 +35,10 @@ pub fn main(init: std.process.Init) !void {
|
|||||||
const sizes = [_]usize{
|
const sizes = [_]usize{
|
||||||
1,
|
1,
|
||||||
1024,
|
1024,
|
||||||
4096,
|
4 * 1024,
|
||||||
16384,
|
4 * 4 * 1024,
|
||||||
65536,
|
4 * 4 * 4 * 1024,
|
||||||
262144,
|
4 * 4 * 4 * 4 * 1024,
|
||||||
1024 * 1024,
|
1024 * 1024,
|
||||||
4 * 1024 * 1024,
|
4 * 1024 * 1024,
|
||||||
4 * 4 * 1024 * 1024,
|
4 * 4 * 1024 * 1024,
|
||||||
@ -89,6 +91,8 @@ pub fn main(init: std.process.Init) !void {
|
|||||||
const sum = try a.run(&gloc, b, add_pip);
|
const sum = try a.run(&gloc, b, add_pip);
|
||||||
defer sum.deinit();
|
defer sum.deinit();
|
||||||
|
|
||||||
|
_ = c.wgpuDevicePoll(device.device, 1, null);
|
||||||
|
|
||||||
const compute_duration = compute_start.durationTo(std.Io.Clock.awake.now(init.io));
|
const compute_duration = compute_start.durationTo(std.Io.Clock.awake.now(init.io));
|
||||||
const compute_ns = @as(u64, @intCast(compute_duration.toNanoseconds()));
|
const compute_ns = @as(u64, @intCast(compute_duration.toNanoseconds()));
|
||||||
if (compute_ns < min_compute_ns) min_compute_ns = compute_ns;
|
if (compute_ns < min_compute_ns) min_compute_ns = compute_ns;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user