Removed unused GpuConfig
This commit is contained in:
parent
2c52c202fe
commit
d57968d6df
@ -2,13 +2,6 @@ const std = @import("std");
|
|||||||
const sh = @import("shaders.zig");
|
const sh = @import("shaders.zig");
|
||||||
const c = @import("c.zig").c;
|
const c = @import("c.zig").c;
|
||||||
|
|
||||||
pub const GpuConfig = struct {
|
|
||||||
/// Absolute max footprint of a single Tensor buffer in bytes.
|
|
||||||
max_tensor_buffer_bytes: u64,
|
|
||||||
/// Absolute max slice size readable inside a single compute binding in bytes.
|
|
||||||
max_tensor_binding_bytes: u64,
|
|
||||||
};
|
|
||||||
|
|
||||||
const GpuAllocator = @This();
|
const GpuAllocator = @This();
|
||||||
|
|
||||||
cpu_allocator: std.mem.Allocator,
|
cpu_allocator: std.mem.Allocator,
|
||||||
@ -16,7 +9,6 @@ instance: c.WGPUInstance,
|
|||||||
adapter: c.WGPUAdapter,
|
adapter: c.WGPUAdapter,
|
||||||
device: c.WGPUDevice,
|
device: c.WGPUDevice,
|
||||||
queue: c.WGPUQueue,
|
queue: c.WGPUQueue,
|
||||||
config: GpuConfig,
|
|
||||||
|
|
||||||
tracked_buffers: std.AutoHashMap(c.WGPUBuffer, void),
|
tracked_buffers: std.AutoHashMap(c.WGPUBuffer, void),
|
||||||
|
|
||||||
@ -63,19 +55,12 @@ pub fn init(cpu_allocator: std.mem.Allocator) !GpuAllocator {
|
|||||||
c.wgpuInstanceProcessEvents(instance);
|
c.wgpuInstanceProcessEvents(instance);
|
||||||
const device = ctx.device orelse return error.NoDevice;
|
const device = ctx.device orelse return error.NoDevice;
|
||||||
|
|
||||||
// Package configurations into the struct
|
|
||||||
const config = GpuConfig{
|
|
||||||
.max_tensor_buffer_bytes = supported_limits.maxBufferSize,
|
|
||||||
.max_tensor_binding_bytes = supported_limits.maxStorageBufferBindingSize,
|
|
||||||
};
|
|
||||||
|
|
||||||
return .{
|
return .{
|
||||||
.cpu_allocator = cpu_allocator,
|
.cpu_allocator = cpu_allocator,
|
||||||
.instance = instance,
|
.instance = instance,
|
||||||
.adapter = adapter,
|
.adapter = adapter,
|
||||||
.device = device,
|
.device = device,
|
||||||
.queue = c.wgpuDeviceGetQueue(device),
|
.queue = c.wgpuDeviceGetQueue(device),
|
||||||
.config = config,
|
|
||||||
.tracked_buffers = .init(cpu_allocator),
|
.tracked_buffers = .init(cpu_allocator),
|
||||||
.pipelines = .{
|
.pipelines = .{
|
||||||
.add = try buildPipeline(device, sh.SHADER_ADD),
|
.add = try buildPipeline(device, sh.SHADER_ADD),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user