Skip to main content

upload_tensor

Function upload_tensor 

Source
pub fn upload_tensor(rt: &CudaRuntime, tensor: &Tensor) -> Result<Tensor>
Expand description

Upload a host tensor into a CubeCL-managed GPU allocation.

§Examples

use tenferro_gpu::{cuda::upload_tensor, cuda::CudaRuntime};
use tenferro_tensor::{Result, Tensor};

let _upload: fn(&CudaRuntime, &Tensor) -> Result<Tensor> = upload_tensor;

§Errors

Returns crate::Error::RuntimeState when the source is backend-resident or belongs to another placement, crate::Error::Unsupported for a dtype unavailable in CubeCL, or crate::Error::BackendSource on allocation.