From e4ee9fdc9fe55b38f3cdff5dac8a0c2bc339b9d7 Mon Sep 17 00:00:00 2001 From: biondizzle Date: Sat, 30 May 2026 17:01:13 +0000 Subject: [PATCH] =?UTF-8?q?P6:=20Fix=20host-side=20BF16=E2=86=92FP32=20con?= =?UTF-8?q?version=20in=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/unit/test_p6_tma_store.cu | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/unit/test_p6_tma_store.cu b/tests/unit/test_p6_tma_store.cu index 20768ea3..477dbd05 100644 --- a/tests/unit/test_p6_tma_store.cu +++ b/tests/unit/test_p6_tma_store.cu @@ -153,7 +153,13 @@ int main() { float* f_direct = new float[n_h * HD]; float* f_tma = new float[n_h * HD]; - auto b2f = [](bf16_t h) -> float { float f; asm("cvt.f32.bf16 %0, %1;" : "=f"(f) : "h"(h)); return f; }; + auto b2f = [](bf16_t h) -> float { + unsigned short us = h; + unsigned int u = us << 16; + float f; + memcpy(&f, &u, 4); + return f; + }; for (int i = 0; i < n_h * HD; i++) { f_direct[i] = b2f(h_o_direct[i]); f_tma[i] = b2f(h_o_tma[i]);