mirror of
https://github.com/huggingface/candle.git
synced 2025-06-18 11:37:11 +00:00
Enable the affine kernel for u8/u32. (#2376)
This commit is contained in:
@ -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(
|
||||||
|
@ -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)
|
||||||
|
Reference in New Issue
Block a user