mirror of
https://github.com/huggingface/candle.git
synced 2025-06-19 03:54:56 +00:00
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:
@ -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) {
|
||||
|
Reference in New Issue
Block a user