xnn.common.cpu_kernels.prepare#

xnn.common.cpu_kernels.prepare(kernel, grid, *args, balance=None, **meta)[source]#

The launch kernel[grid](*args, **meta) on CPU tensors, compiled and packed, to be called once or many times (grid an int or a 1-tuple; num_warps and num_stages are ignored). balance an int64 prefix (n_programs + 1,) of the programs’ work (a compressed-row pointer): each thread takes contiguous programs of an equal share of it, instead of chunks taken as threads finish.

Parameters:

balance (Tensor | None)

Return type:

Launch