Rename vec-dot to vec-ops. (#449)

* Rename vec-dot to vec-ops.

* Also bump the crate version.

* Add a currently empty readme.
This commit is contained in:
Laurent Mazare
2023-08-15 10:48:57 +01:00
committed by GitHub
parent 495e0b7580
commit 531f23b4d0
14 changed files with 30 additions and 29 deletions

View File

@ -1,4 +1,4 @@
pub trait VecDot: num_traits::NumAssign + Copy {
pub trait VecOps: num_traits::NumAssign + Copy {
/// Dot-product of two vectors.
///
/// # Safety
@ -28,7 +28,7 @@ pub trait VecDot: num_traits::NumAssign + Copy {
}
}
impl VecDot for f32 {
impl VecOps for f32 {
#[inline(always)]
unsafe fn vec_dot(lhs: *const Self, rhs: *const Self, res: *mut Self, len: usize) {
super::vec_dot_f32(lhs, rhs, res, len)
@ -40,7 +40,7 @@ impl VecDot for f32 {
}
}
impl VecDot for half::f16 {
impl VecOps for half::f16 {
#[inline(always)]
unsafe fn vec_dot(lhs: *const Self, rhs: *const Self, res: *mut Self, len: usize) {
let mut res_f32 = 0f32;
@ -49,10 +49,10 @@ impl VecDot for half::f16 {
}
}
impl VecDot for f64 {}
impl VecDot for half::bf16 {}
impl VecDot for u8 {}
impl VecDot for u32 {}
impl VecOps for f64 {}
impl VecOps for half::bf16 {}
impl VecOps for u8 {}
impl VecOps for u32 {}
#[inline(always)]
pub fn par_for_each(n_threads: usize, func: impl Fn(usize) + Send + Sync) {