add u32 - U32 gather (#2653)

This commit is contained in:
zachcp
2024-11-30 17:18:07 -05:00
committed by GitHub
parent b52c2c6050
commit dba7a9c93e
2 changed files with 81 additions and 79 deletions

View File

@ -1244,6 +1244,7 @@ impl BackendStorage for MetalStorage {
(DType::U32, DType::F32) => "gather_u32_f32",
(DType::U32, DType::F16) => "gather_u32_f16",
(DType::U32, DType::BF16) => "gather_u32_bf16",
(DType::U32, DType::U32) => "gather_u32_u32",
(left, right) => crate::bail!("Metal gather {left:?} {right:?} not implemented"),
};
let command_buffer = self.device.command_buffer()?;

View File

@ -214,6 +214,7 @@ GATHER_OP(gather_u32_f16, uint, half)
#if defined(__HAVE_BFLOAT__)
GATHER_OP(gather_u32_bf16, uint, bfloat)
#endif
GATHER_OP(gather_u32_u32, uint, uint)
SCATTER_ADD_OP(sa_u32_f32, uint32_t, float)
SCATTER_ADD_OP(sa_u8_f32, uint8_t, float)