From 6c608512c323a7383a3087ee96e7e1e42e55402a Mon Sep 17 00:00:00 2001 From: Nathaniel Simard Date: Wed, 8 Jan 2025 12:02:09 -0500 Subject: [PATCH] Fix const cast identifier for cpp (#400) --- crates/cubecl-cpp/src/shared/instruction.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/cubecl-cpp/src/shared/instruction.rs b/crates/cubecl-cpp/src/shared/instruction.rs index 4c765558..47bfca11 100644 --- a/crates/cubecl-cpp/src/shared/instruction.rs +++ b/crates/cubecl-cpp/src/shared/instruction.rs @@ -450,8 +450,10 @@ for ({i_ty} {i} = {start}; {i} {cmp} {end}; {increment}) {{ Instruction::Fma { a, b, c, out } => Fma::format(f, a, b, c, out), Instruction::Wmma(it) => write!(f, "{it}"), Instruction::Bitcast(UnaryInstruction { input, out }) => { + let qualifier = out.const_qualifier(); let out_elem = out.elem(); let out = out.fmt_left(); + match (input.elem(), out_elem) { (Elem::F32, Elem::I32) => { writeln!(f, "{out} = __float_as_int({input});") @@ -490,7 +492,7 @@ for ({i_ty} {i} = {start}; {i} {cmp} {end}; {increment}) {{ writeln!(f, "{out} = __ushort_as_bfloat16({input});") } (Elem::I32, Elem::U32) => { - writeln!(f, "{out} = reinterpret_cast({input});") + writeln!(f, "{out} = reinterpret_cast({input});") } elem => panic!("Unsupported type for bitcasting {elem:?}"), }