use half::bf16;
use half::f16;
use hpt_macros::impl_scalar_convert;
use num_complex::{Complex32, Complex64};
use crate::dtype::TypeCommon;
#[cfg(all(
any(target_feature = "sse", target_arch = "arm", target_arch = "aarch64"),
not(target_feature = "avx2")
))]
use crate::simd::_128bit::*;
#[cfg(target_feature = "avx2")]
use crate::simd::_256bit::*;
pub(crate) trait Convertor {
fn to_bool(self) -> bool;
fn to_u8(self) -> u8;
fn to_u16(self) -> u16;
fn to_u32(self) -> u32;
fn to_u64(self) -> u64;
fn to_usize(self) -> usize;
fn to_i8(self) -> i8;
fn to_i16(self) -> i16;
fn to_i32(self) -> i32;
fn to_i64(self) -> i64;
fn to_isize(self) -> isize;
fn to_f32(self) -> f32;
fn to_f64(self) -> f64;
fn to_f16(self) -> f16;
fn to_bf16(self) -> bf16;
fn to_complex32(self) -> Complex32;
fn to_complex64(self) -> Complex64;
}
#[cfg(target_feature = "avx2")]
pub(crate) trait VecConvertor: Sized {
fn to_bool(self) -> boolx32 {
unreachable!()
}
fn to_u8(self) -> u8x32 {
unreachable!()
}
fn to_u16(self) -> u16x16 {
unreachable!()
}
fn to_u32(self) -> u32x8 {
unreachable!()
}
fn to_u64(self) -> u64x4 {
unreachable!()
}
fn to_usize(self) -> usizex4 {
unreachable!()
}
fn to_i8(self) -> i8x32 {
unreachable!()
}
fn to_i16(self) -> i16x16 {
unreachable!()
}
fn to_i32(self) -> i32x8 {
unreachable!()
}
fn to_i64(self) -> i64x4 {
unreachable!()
}
fn to_isize(self) -> isizex4 {
unreachable!()
}
fn to_f32(self) -> f32x8 {
unreachable!()
}
fn to_f64(self) -> f64x4 {
unreachable!()
}
fn to_f16(self) -> f16x16 {
unreachable!()
}
fn to_bf16(self) -> bf16x16 {
unreachable!()
}
fn to_complex32(self) -> cplx32x4 {
unreachable!()
}
fn to_complex64(self) -> cplx64x2 {
unreachable!()
}
}
#[cfg(all(
any(target_feature = "sse", target_arch = "arm", target_arch = "aarch64"),
not(target_feature = "avx2")
))]
pub(crate) trait VecConvertor: Sized {
fn to_bool(self) -> boolx16 {
unreachable!()
}
fn to_u8(self) -> u8x16 {
unreachable!()
}
fn to_u16(self) -> u16x8 {
unreachable!()
}
fn to_u32(self) -> u32x4 {
unreachable!()
}
fn to_u64(self) -> u64x2 {
unreachable!()
}
fn to_usize(self) -> usizex2 {
unreachable!()
}
fn to_i8(self) -> i8x16 {
unreachable!()
}
fn to_i16(self) -> i16x8 {
unreachable!()
}
fn to_i32(self) -> i32x4 {
unreachable!()
}
fn to_i64(self) -> i64x2 {
unreachable!()
}
fn to_isize(self) -> isizex2 {
unreachable!()
}
fn to_f32(self) -> f32x4 {
unreachable!()
}
fn to_f64(self) -> f64x2 {
unreachable!()
}
fn to_f16(self) -> f16x8 {
unreachable!()
}
fn to_bf16(self) -> bf16x8 {
unreachable!()
}
fn to_complex32(self) -> cplx32x2 {
unreachable!()
}
fn to_complex64(self) -> cplx64x1 {
unreachable!()
}
}
impl_scalar_convert!();