Enable the affine kernel for u8/u32. (#2376)

This commit is contained in:
Laurent Mazare
2024-08-01 09:03:11 +01:00
committed by GitHub
parent 4a52aeb437
commit 8696cf6494
2 changed files with 4 additions and 0 deletions

View File

@ -119,6 +119,8 @@ impl BackendStorage for MetalStorage {
DType::F32 => "affine_f32", DType::F32 => "affine_f32",
DType::F16 => "affine_f16", DType::F16 => "affine_f16",
DType::BF16 => "affine_bf16", DType::BF16 => "affine_bf16",
DType::U8 => "affine_u8",
DType::U32 => "affine_u32",
dtype => crate::bail!("Metal contiguous affine {dtype:?} not implemented"), dtype => crate::bail!("Metal contiguous affine {dtype:?} not implemented"),
}; };
candle_metal_kernels::call_affine( candle_metal_kernels::call_affine(

View File

@ -109,6 +109,8 @@ kernel void FN_NAME##_strided( \
} \ } \
AFFINE(affine_u8, uint8_t)
AFFINE(affine_u32, uint32_t)
AFFINE(affine_f32, float) AFFINE(affine_f32, float)
AFFINE(affine_f16, half) AFFINE(affine_f16, half)
POWF(powf_f32, float) POWF(powf_f32, float)