MCPcopy Create free account
hub / github.com/Rust-GPU/rust-cuda / dot

Method dot

crates/blastoff/src/level1.rs:360–369  ·  view source on GitHub ↗

Computes the dot product of two vectors: $$ \sum^n_{i=1} \boldsymbol{x}_i * \boldsymbol{y}_i $$ # Panics Panics if the buffers are not long enough for the length requested. # Example ``` # fn main() -> Result<(), Box > { # let _a = cust::quick_init()?; # use blastoff::CublasContext; # use cust::prelude::*; # use cust::memory::DeviceBox; # use cust::util::SliceExt; # let

(
        &mut self,
        stream: &Stream,
        n: usize,
        x: &impl GpuBuffer<T>,
        y: &impl GpuBuffer<T>,
        result: &mut impl GpuBox<T>,
    )

Source from the content-addressed store, hash-verified

358 /// # }
359 /// ```
360 pub fn dot<T: FloatLevel1>(
361 &mut self,
362 stream: &Stream,
363 n: usize,
364 x: &impl GpuBuffer<T>,
365 y: &impl GpuBuffer<T>,
366 result: &mut impl GpuBox<T>,
367 ) -> Result {
368 self.dot_strided(stream, n, x, None, y, None, result)
369 }
370
371 /// Same as [`CublasContext::dotu`] but with an explicit stride.
372 ///

Callers 8

reflectFunction · 0.45
refractFunction · 0.45
scatterMethod · 0.45
hitMethod · 0.45
length2Method · 0.45
dotFunction · 0.45
length2Method · 0.45
dotFunction · 0.45

Calls 1

dot_stridedMethod · 0.80

Tested by

no test coverage detected