vt::matmul#

template<typename T>
Tensor<T, 1> vt::matmul(Tensor<T, 1> &tensor1, Tensor<T, 1> &tensor2, cublasHandle_t handle = cuda::cublas.get_handle())#

Performs a dot product between two 1D tensors using CuBLAS functions.

Template Parameters:

T – Data type of the tensors.

Parameters:
  • tensor1 – The first tensor.

  • tensor2 – The second tensor.

  • handle – The CuBLAS handle. The default is the global CuBLAS handle.

Returns:

Tensor: The result tensor.

template<typename T>
Tensor<T, 2> vt::matmul(Tensor<T, 2> &tensor1, Tensor<T, 2> &tensor2, cublasHandle_t handle = cuda::cublas.get_handle())#

Performs matrix multiplication between two 2D tensors.

Template Parameters:

T – Data type of the tensors.

Parameters:
  • tensor1 – The first tensor.

  • tensor2 – The second tensor.

  • handle – The CuBLAS handle. The default is the global CuBLAS handle.

Returns:

Tensor: The result tensor.

template<typename T, size_t N>
Tensor<T, N> vt::matmul(Tensor<T, N> &tensor1, Tensor<T, N> &tensor2, cublasHandle_t handle = cuda::cublas.get_handle())#

Performs matrix multiplication between two N>2 tensors using batched matrix multiplication. This is a specialized version of the matmul function for N>2 tensors.

Template Parameters:

T – Data type of the tensors.

Parameters:
  • tensor1 – The first tensor.

  • tensor2 – The second tensor.

  • handle – The CuBLAS handle. The default is the global CuBLAS handle.

Returns:

Tensor: The result tensor.