oarust 0.18.0

GPU-first semantic computing runtime written in Rust
Documentation
// @generated by tool/gen/fn/generate.py; DO NOT EDIT.
// schema=matrix_blas.json schema_version=1 generator_version=64
// schema_sha256=923f078871da395b32c267810611a04885c383d5cb159a144fb1186d1d866ce8
// Semantic operation: matrix.matmul; stable kernel ID: 614.
// FP32 scalar fallback: one invocation per output element.

import storage;
import attributes;

struct PushConstants {
	uint left_index;
	uint right_index;
	uint output_index;
	uint m;
	uint n;
	uint k;
};

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

[kernel_name("matmul_nt_naive")]
[domain("matrix")]
[variant("naive")]
[dtype("f32")]
[status("experimental")]
[shader("compute")]
[numthreads(256, 1, 1)]
void main(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;
	float accumulator = 0.0f;
	for (uint inner = 0; inner < push.k; ++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.output_index], row * push.n + column, accumulator);
}