MCPcopy Create free account
hub / github.com/cosdata/cosdata / dot_product_binary

Function dot_product_binary

src/models/dot_product.rs:115–123  ·  view source on GitHub ↗
(x_vec: &[Vec<u8>], y_vec: &[Vec<u8>], res: u8)

Source from the content-addressed store, hash-verified

113}
114
115pub fn dot_product_binary(x_vec: &[Vec<u8>], y_vec: &[Vec<u8>], res: u8) -> f32 {
116 #[cfg(target_arch = "x86_64")]
117 {
118 if is_x86_feature_detected!("avx") && is_x86_feature_detected!("avx2") {
119 return unsafe { x86_64::dot_product_binary_avx2(x_vec, y_vec, res) };
120 }
121 }
122 dot_product_binary_scalar(x_vec, y_vec, res)
123}
124
125pub fn dot_product_quaternary(x_vec: &[Vec<u8>], y_vec: &[Vec<u8>], res: u8) -> f32 {
126 #[cfg(target_arch = "x86_64")]

Callers 2

calculateMethod · 0.85
cosine_similarityFunction · 0.85

Calls 2

dot_product_binary_avx2Function · 0.85

Tested by

no test coverage detected