oarust 0.14.0

GPU-first semantic computing engine written in Rust
// @generated by tool/gen/fn/generate.py; DO NOT EDIT.
// schema=matrix_blas.json schema_version=1 generator_version=64
// schema_sha256=069a018c55da56f4a086cd2e1adf93d14c368274db0386dd226084fb9060700b
// Semantic operation: matrix.mat_mul_nt; stable kernel ID: 702.
// FP32 split-K partial: one invocation per output element per K slice.
// `group_id.z` selects the K slice; partials land in the planner-owned
// workspace at `split * m * n + element` for the reduction donor.

import storage;
import attributes;

struct PushConstants {
	uint left_index;
	uint right_index;
	uint partial_index;
	uint m;
	uint n;
	uint k;
	uint k_chunk;
};

[[vk::push_constant]] PushConstants push;
[[vk::binding(0, 0)]] RWByteAddressBuffer storage_buffers[];

[kernel_name("mat_mul_nt_split_k")]
[domain("matrix")]
[variant("split_k")]
[dtype("f32")]
[status("experimental")]
[shader("compute")]
[numthreads(256, 1, 1)]
void main(uint3 group_id : SV_GroupID, uint3 dispatch_thread_id : SV_DispatchThreadID) {
	uint element = dispatch_thread_id.x;
	if (element >= push.m * push.n) {
		return;
	}
	uint row = element / push.n;
	uint column = element % push.n;
	uint k_begin = group_id.z * push.k_chunk;
	uint k_end = min(k_begin + push.k_chunk, push.k);
	float accumulator = 0.0f;
	for (uint inner = k_begin; inner < k_end; ++inner) {
		accumulator += load_f32(storage_buffers[push.left_index], row * push.k + inner)
			* load_f32(storage_buffers[push.right_index], column * push.k + inner);
	}
	store_f32(
		storage_buffers[push.partial_index],
		group_id.z * push.m * push.n + element,
		accumulator
	);
}