Skip to main content

upload_webgpu_tensor

Function upload_webgpu_tensor 

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

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

§Examples

use tenferro_gpu::{webgpu::upload_webgpu_tensor, webgpu::WebGpuRuntime};
use tenferro_tensor::{Result, Tensor};

let _upload: fn(&WebGpuRuntime, &Tensor) -> Result<Tensor> = upload_webgpu_tensor;

§Errors

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