Add tracing to segment-anything (#777)

* Tracing support for segment-anything.

* More tracing.

* Handle the empty slice case.
This commit is contained in:
Laurent Mazare
2023-09-08 15:31:29 +01:00
committed by GitHub
parent e5703d2f56
commit 158ff3c609
6 changed files with 90 additions and 16 deletions

View File

@ -1889,6 +1889,9 @@ impl BackendStorage for CudaStorage {
let src_shape = src_l.shape();
let dims = src_shape.dims();
let el_count = src_shape.elem_count();
if el_count == 0 {
return Ok(());
}
let cfg = LaunchConfig::for_num_elems(el_count as u32);
let dev = &self.device;
let ds = dev.htod_copy([dims, src_l.stride()].concat()).w()?;