Open dkales opened 2 months ago
Hmm yeah actually I agree with you. At first I thought Option provided a way to do this, but its the reverse - Option::as_ref "Converts from &Option<T>
to Option<&T>
."
I think using the CudaViews is a fairly okay work around for this (probably why it's usable in the first place). Creating a view is very cheap and you can reuse them as many times as you want. Unless I'm missing something.
I think using the CudaViews is a fairly okay work around for this (probably why it's usable in the first place). Creating a view is very cheap and you can reuse them as many times as you want. Unless I'm missing something.
yeah this is a workaround, but only possible since the last version while this interface was there much longer, just wanted to raise this as a suggestion
In https://github.com/coreylowman/cudarc/blob/886d6d27cd68da4f81ce30a98bdf1940a895f813/src/nccl/safe.rs#L242-L245, the sendbuf is given as an
&Option<T>
, which involves wrapping theT
, which is something like aCudaSlice
in an Option to pass it in there, making re-use of the sendbuffer later on less ergonomic, since you need to get it back from theOption
. The other way around would make this easier, but IDK if there are some other drawbacks I'm not seeing ATM?