Skip to documentation
SLOP

tiny.simd.PoolWorkerMapping

Reference tiny.simd PoolWorkerMapping

Defined in thread.pool.

API (6)

Actions

Public operations.

Fields and members

Public fields and members.

No direct callersNo direct callsthread.poolPoolWorkerMapping
Static calls · unresolved targets: unknown · external targets: unknown.

Source

Source: lib/simd/src/thread/pool.zig:103

zig
pub const PoolWorkerMapping = struct {    cluster_index: u8 = 0,    max_cluster_workers: usize = 0,    pub fn init(        cluster_index: usize,        max_cluster_workers: usize,    ) error{ InvalidCluster, EmptyCluster }!PoolWorkerMapping {        if (cluster_index > all_clusters) return error.InvalidCluster;        if (max_cluster_workers == 0) return error.EmptyCluster;        return .{            .cluster_index = @intCast(cluster_index),            .max_cluster_workers = max_cluster_workers,        };    }    pub fn clusterIndex(self: PoolWorkerMapping) usize {        return self.cluster_index;    }    pub fn maxClusterWorkers(self: PoolWorkerMapping) usize {        return self.max_cluster_workers;    }    pub fn globalIndex(        self: PoolWorkerMapping,        worker_index: usize,    ) usize {        if (self.max_cluster_workers == 0) return worker_index;        if (self.cluster_index == all_clusters) {            std.debug.assert(worker_index < all_clusters);            return worker_index * self.max_cluster_workers;        }        std.debug.assert(worker_index < self.max_cluster_workers);        return self.cluster_index * self.max_cluster_workers + worker_index;    }};

Source: lib/simd/src/root.zig:131

zig
pub const PoolWorkerMapping = thread.PoolWorkerMapping;
Called byCallsNo direct callsThreadPoolglobalWorkerIndextest sourcelib.simd.src.thread.pooltest: Highway pool worker mapping pre...PoolWorkerMappingglobalIndex
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callstest sourcelib.simd.src.thread.pooltest: Highway pool worker mapping pre...PoolWorkerMappinginit
Static calls · unresolved targets: 0 · external targets: 0.

Also reachable as

thread.PoolWorkerMapping.

Audit

Definitions5
Public names15
Members2
Version26.7.0
Revisiondaab053ee433