Same as [`CublasContext::copy`] 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: &mut impl GpuBuffer<T>,
y_stride: Option<usize>,
| 230 | /// |
| 231 | /// Panics if the buffers are not long enough for the stride and length requested. |
| 232 | pub fn copy_strided<T: Level1>( |
| 233 | &mut self, |
| 234 | stream: &Stream, |
| 235 | n: usize, |
| 236 | x: &impl GpuBuffer<T>, |
| 237 | x_stride: Option<usize>, |
| 238 | y: &mut impl GpuBuffer<T>, |
| 239 | y_stride: Option<usize>, |
| 240 | ) -> Result { |
| 241 | check_stride(x, n, x_stride); |
| 242 | check_stride(y, n, y_stride); |
| 243 | |
| 244 | self.with_stream(stream, |ctx| unsafe { |
| 245 | Ok(T::copy( |
| 246 | ctx.raw, |
| 247 | n as i32, |
| 248 | x.as_device_ptr().as_ptr(), |
| 249 | x_stride.unwrap_or(1) as i32, |
| 250 | y.as_device_ptr().as_mut_ptr(), |
| 251 | y_stride.unwrap_or(1) as i32, |
| 252 | ) |
| 253 | .to_result()?) |
| 254 | }) |
| 255 | } |
| 256 | |
| 257 | /// Copies `n` elements from `x` into `y`, overriding any previous data inside `y`. |
| 258 | /// |
no test coverage detected