Same as [`CublasContext::dot`] but with an explicit stride. # Panics Panics if the buffers are not long enough for the stride and length requested.
(
&mut self,
stream: &Stream,
n: usize,
x: &impl GpuBuffer<T>,
x_stride: Option<usize>,
y: &impl GpuBuffer<T>,
y_stride: Option<usize>,
| 298 | /// |
| 299 | /// Panics if the buffers are not long enough for the stride and length requested. |
| 300 | pub fn dot_strided<T: FloatLevel1>( |
| 301 | &mut self, |
| 302 | stream: &Stream, |
| 303 | n: usize, |
| 304 | x: &impl GpuBuffer<T>, |
| 305 | x_stride: Option<usize>, |
| 306 | y: &impl GpuBuffer<T>, |
| 307 | y_stride: Option<usize>, |
| 308 | result: &mut impl GpuBox<T>, |
| 309 | ) -> Result { |
| 310 | check_stride(x, n, x_stride); |
| 311 | check_stride(y, n, y_stride); |
| 312 | |
| 313 | self.with_stream(stream, |ctx| unsafe { |
| 314 | Ok(T::dot( |
| 315 | ctx.raw, |
| 316 | n as i32, |
| 317 | x.as_device_ptr().as_ptr(), |
| 318 | x_stride.unwrap_or(1) as i32, |
| 319 | y.as_device_ptr().as_ptr(), |
| 320 | y_stride.unwrap_or(1) as i32, |
| 321 | result.as_device_ptr().as_mut_ptr(), |
| 322 | ) |
| 323 | .to_result()?) |
| 324 | }) |
| 325 | } |
| 326 | |
| 327 | /// Computes the dot product of two vectors: |
| 328 | /// |
no test coverage detected