rublas 0.1.72

Linear algebra and matrix multiplication for Ruda.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use ruda_kernel::{dsl::Runtime, tensor::{RudaTensor, allocation::empty_device_dtype}};
use ruda_core::tensor::{DType, calculate_matmul_output};

/// Creates an empty output tensor with matmul output shape
pub fn init_matmul_output<R: Runtime>(
    lhs: &RudaTensor<R>,
    rhs: &RudaTensor<R>,
    dtype: DType,
) -> RudaTensor<R> {
    empty_device_dtype(
        lhs.client.clone(),
        lhs.device.clone(),
        calculate_matmul_output(lhs.meta.shape(), rhs.meta.shape()).unwrap(),
        dtype,
    )
}