// File: mla_decode_bf16_contract.h
#pragma once
#include <cstdint>

// Harness contract for the llama.cpp (ggml) mla_decode baseline.
// Causal MLA decode (weight-absorbed/compressed form, MQA-style shared K/V
// latent). Called by armbench_entry_mla_decode (binding.cpp); implemented by
// kernel.cpp.
// Q is row-major bf16 [M, n_heads, c_q]; K is row-major bf16 [S, c_q] (shared
// across heads); V is row-major bf16 [S, kv_lora_rank] (shared across heads);
// v_mla is row-major bf16 [n_heads, v_head_dim, kv_lora_rank]; out is
// row-major fp32 [M, n_heads, v_head_dim].
// KV-cache-style causal softmax(Q.K^T * scale)*V per head, then up-projected
// per head by v_mla; scale uses the true un-absorbed head dim (qk_true_dim),
// not c_q.
int armbench_llamacpp_mla_decode(const void* Q, const void* K, const void* V,
                                 const void* v_mla, float* out,
                                 int64_t M, int64_t S, int64_t n_heads, int64_t c_q,
                                 int64_t kv_lora_rank, int64_t v_head_dim,
                                 int64_t qk_true_dim);