tiny.simd.initProcessorTopology
Defined in tiny.simd.
Source
Source: lib/simd/src/topology/native.zig:88
zig
pub fn init(allocator: std.mem.Allocator) std.mem.Allocator.Error!topology.Topology { if (comptime builtin.target.os.tag == .linux) { var records: [topology.max_logical_processors]topology.ProcessorRecord = undefined; const count = linux.fillRecords(&records); if (count == 0) return .{}; var detected = topology.Topology.initFromRecords( allocator, records[0..count], ) catch |err| switch (err) { error.OutOfMemory => return error.OutOfMemory, else => return .{}, }; linux.fillClusterCacheSizes(&detected); return detected; } if (comptime builtin.target.os.tag.isDarwin()) { var records: [topology.max_logical_processors]topology.ProcessorRecord = undefined; const count = apple.fillRecords(&records); if (count == 0) return .{}; return topology.Topology.initFromRecords( allocator, records[0..count], ) catch |err| switch (err) { error.OutOfMemory => return error.OutOfMemory, else => return .{}, }; } if (comptime builtin.target.os.tag == .windows) { var records: [topology.max_logical_processors]topology.ProcessorRecord = undefined; const count = try windows.fillRecords(allocator, &records); if (count == 0) return .{}; return topology.Topology.initFromRecords( allocator, records[0..count], ) catch |err| switch (err) { error.OutOfMemory => return error.OutOfMemory, else => return .{}, }; } return .{};}Source: lib/simd/src/root.zig:99
zig
pub const initProcessorTopology = topology.init;Also reachable as
Audit
| Definitions | 1 |
|---|---|
| Public names | 2 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |