fixing linter errors
Test / build_and_test (push) Successful in 5m28s
Build / build (push) Successful in 7m26s

This commit is contained in:
2026-07-15 15:39:16 +02:00
parent 1640013546
commit 2375abf688
116 changed files with 563 additions and 354 deletions
-1
View File
@@ -3,7 +3,6 @@ const vk = @import("vulkan");
const base = @import("base");
const VkError = base.VkError;
const Device = base.Device;
const Self = @This();
pub const Interface = base.BinarySemaphore;
-2
View File
@@ -2,10 +2,8 @@ const std = @import("std");
const vk = @import("vulkan");
const base = @import("base");
const lib = @import("lib.zig");
const VkError = base.VkError;
const Device = base.Device;
const Self = @This();
pub const Interface = base.Buffer;
-1
View File
@@ -3,7 +3,6 @@ const vk = @import("vulkan");
const base = @import("base");
const VkError = base.VkError;
const Device = base.Device;
const Self = @This();
pub const Interface = base.BufferView;
-2
View File
@@ -2,9 +2,7 @@ const std = @import("std");
const vk = @import("vulkan");
const base = @import("base");
const NonDispatchable = base.NonDispatchable;
const VkError = base.VkError;
const Device = base.Device;
const PhiCommandBuffer = @import("PhiCommandBuffer.zig");
-2
View File
@@ -3,9 +3,7 @@ const vk = @import("vulkan");
const base = @import("base");
const VkError = base.VkError;
const VulkanAllocator = base.VulkanAllocator;
const Device = base.Device;
const Self = @This();
pub const Interface = base.DescriptorPool;
-1
View File
@@ -3,7 +3,6 @@ const vk = @import("vulkan");
const base = @import("base");
const VkError = base.VkError;
const Device = base.Device;
const Self = @This();
pub const Interface = base.DescriptorSetLayout;
+1 -1
View File
@@ -229,7 +229,7 @@ fn uploadAndLaunchDaemon(instance: *base.Instance, allocator: std.mem.Allocator,
const local_path = std.fmt.allocPrint(allocator, "/tmp/ape_phi_device_{d}_{d}.mic", .{ std.os.linux.getpid(), mic_device_num }) catch return VkError.OutOfHostMemory;
defer allocator.free(local_path);
defer std.Io.Dir.deleteFileAbsolute(io, local_path) catch {};
defer std.Io.Dir.deleteFileAbsolute(io, local_path) catch @panic("Caught an error while handling an error");
std.Io.Dir.writeFile(.cwd(), io, .{
.sub_path = local_path,
+1 -1
View File
@@ -46,7 +46,7 @@ pub fn create(device: *PhiDevice, allocator: std.mem.Allocator, size: vk.DeviceS
.flags = 0,
};
var reply: proto.PhiAllocMemoryReply = undefined;
var reply = std.mem.zeroes(proto.PhiAllocMemoryReply);
try device.transport.request(proto.PHI_PACKET_ALLOC_MEMORY, std.mem.asBytes(&alloc_request), std.mem.asBytes(&reply));
if (reply.result.status != proto.PHI_STATUS_OK) {
-1
View File
@@ -3,7 +3,6 @@ const vk = @import("vulkan");
const base = @import("base");
const VkError = base.VkError;
const Device = base.Device;
const Self = @This();
pub const Interface = base.Event;
-1
View File
@@ -1,7 +1,6 @@
const std = @import("std");
const vk = @import("vulkan");
const base = @import("base");
const lib = @import("lib.zig");
const VkError = base.VkError;
-1
View File
@@ -3,7 +3,6 @@ const vk = @import("vulkan");
const base = @import("base");
const VkError = base.VkError;
const Device = base.Device;
const Self = @This();
pub const Interface = base.ImageView;
+1 -1
View File
@@ -98,7 +98,7 @@ fn requestPhysicalDevices(interface: *Interface, allocator: std.mem.Allocator, _
defer device.deinit();
const physical_device = try PhiPhysicalDevice.create(allocator, interface, device, device_num);
errdefer physical_device.interface.release(allocator) catch {};
errdefer physical_device.interface.release(allocator) catch @panic("Caught an error while handling an error");
const dispatchable = try Dispatchable(base.PhysicalDevice).wrap(allocator, &physical_device.interface);
errdefer dispatchable.destroy(allocator);
+5 -6
View File
@@ -10,7 +10,6 @@ const pci_ids = @import("pci_ids.zig").map;
const PhiDevice = @import("PhiDevice.zig");
const VkError = base.VkError;
const VulkanAllocator = base.VulkanAllocator;
const SurfaceKHR = base.SurfaceKHR;
const Self = @This();
@@ -87,7 +86,7 @@ pub fn create(allocator: std.mem.Allocator, instance: *base.Instance, mic_device
return VkError.InitializationFailed;
}
interface.props.pipeline_cache_uuid = undefined;
interface.props.pipeline_cache_uuid = @splat(0);
interface.props.limits = .{
.max_image_dimension_1d = 4096,
.max_image_dimension_2d = 4096,
@@ -872,10 +871,10 @@ fn cpuid(leaf_id: u32, subleaf_id: u32) CpuidRegs {
}
}
var eax: u32 = undefined;
var ebx: u32 = undefined;
var ecx: u32 = undefined;
var edx: u32 = undefined;
var eax: u32 = 0;
var ebx: u32 = 0;
var ecx: u32 = 0;
var edx: u32 = 0;
asm volatile ("cpuid"
: [_] "={eax}" (eax),
-1
View File
@@ -3,7 +3,6 @@ const vk = @import("vulkan");
const base = @import("base");
const VkError = base.VkError;
const Device = base.Device;
const Self = @This();
pub const Interface = base.PipelineLayout;
-1
View File
@@ -3,7 +3,6 @@ const vk = @import("vulkan");
const base = @import("base");
const VkError = base.VkError;
const Device = base.Device;
const Self = @This();
pub const Interface = base.QueryPool;
+1 -1
View File
@@ -66,7 +66,7 @@ pub fn submit(interface: *Interface, infos: []Interface.SubmitInfo, fence: ?*bas
@memcpy(payload[@sizeOf(proto.PhiWorkExecutionRequest)..], phi_command_buffer.commands.items);
// Synchronous queues for now
var reply: proto.PhiWorkExecutionReply = undefined;
var reply = std.mem.zeroes(proto.PhiWorkExecutionReply);
try device.transport.request(proto.PHI_PACKET_WORK_EXECUTION, payload, std.mem.asBytes(&reply));
if (reply.result.status != proto.PHI_STATUS_OK) {
-1
View File
@@ -3,7 +3,6 @@ const vk = @import("vulkan");
const base = @import("base");
const VkError = base.VkError;
const Device = base.Device;
const Self = @This();
pub const Interface = base.RenderPass;
+3
View File
@@ -68,6 +68,7 @@ pub fn request(self: *Self, command: c_uint, payload: []const u8, reply_payload:
try self.writeAll(std.mem.asBytes(&header));
try self.writeAll(payload);
// SAFETY: will be entirely written with the readAll
var reply_header: proto.PhiMessageHeader = undefined;
try self.readAll(std.mem.asBytes(&reply_header));
@@ -119,6 +120,8 @@ fn handshake(self: *Self) VkError!void {
.host_protocol_version = proto.PHI_PROTOCOL_VERSION,
.reserved = 0,
};
// SAFETY: will be entirely written by the request
var reply: proto.PhiHelloReply = undefined;
try self.request(proto.PHI_PACKET_HELLO, std.mem.asBytes(&request_payload), std.mem.asBytes(&reply));
if (reply.result.status != proto.PHI_STATUS_OK) {
-1
View File
@@ -1,4 +1,3 @@
const std = @import("std");
const PciInfo = struct {
id: u16,
+6
View File
@@ -13,12 +13,18 @@ pub const PortId = extern struct {
pub const SEND_BLOCK = 1;
pub const RECV_BLOCK = 1;
// SAFETY: load assigns every function pointer before the public wrappers can be used.
var scif_open: *const fn () callconv(.c) epd_t = undefined;
// SAFETY: load assigns every function pointer before the public wrappers can be used.
var scif_close: *const fn (epd: epd_t) callconv(.c) c_int = undefined;
// SAFETY: load assigns every function pointer before the public wrappers can be used.
var scif_connect: *const fn (epd: epd_t, dst: *const PortId) callconv(.c) c_int = undefined;
// SAFETY: load assigns every function pointer before the public wrappers can be used.
var scif_send: *const fn (epd: epd_t, msg: ?*const anyopaque, len: usize, flags: c_int) callconv(.c) isize = undefined;
// SAFETY: load assigns every function pointer before the public wrappers can be used.
var scif_recv: *const fn (epd: epd_t, msg: ?*anyopaque, len: usize, flags: c_int) callconv(.c) isize = undefined;
// SAFETY: load initializes the module before it can be closed or queried.
var module: std.DynLib = undefined;
var ref_count = std.atomic.Value(usize).init(0);
var load_mutex: base.SpinMutex = .{};