[Phi] adding basic host emulation for development without access to a
Mirror Gitea refs to GitHub / mirror (push) Successful in 39s
Test / build_and_test (push) Successful in 5m15s
Build / build (push) Successful in 7m20s

Xeon Phi
This commit is contained in:
2026-08-02 12:46:59 +02:00
parent fa673251c0
commit e68d78cccc
18 changed files with 512 additions and 213 deletions
+13 -1
View File
@@ -61,7 +61,8 @@ fn destroy(interface: *Interface, allocator: std.mem.Allocator) VkError!void {
self.threaded.deinit();
allocator.destroy(self);
mic.unload();
if (comptime !lib.config.phi_host_emulation)
mic.unload();
}
fn requestPhysicalDevices(interface: *Interface, allocator: std.mem.Allocator, _: []base.drm.Card) VkError!void {
@@ -69,6 +70,17 @@ fn requestPhysicalDevices(interface: *Interface, allocator: std.mem.Allocator, _
return;
}
if (comptime lib.config.phi_host_emulation) {
const physical_device = try PhiPhysicalDevice.createEmulated(allocator, interface);
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);
interface.physical_devices.append(allocator, dispatchable) catch return VkError.OutOfHostMemory;
return;
}
mic.load() catch |err| {
std.log.scoped(.MIC).err("Failed to load libmicmgmt: {s}", .{@errorName(err)});
return VkError.InitializationFailed;