gemvdot

Computes a sparse matrix-dense vector product with dot product.

Description and Assumptions

Refer to Supported Types for a list of supported <fp> and <intType>. The oneapi::mkl::sparse::gemvdot routine computes a sparse matrix-dense vector product and dot product defined as

\[y \leftarrow \alpha \text{op}(A) x + \beta y\]
\[d \leftarrow x y\]

where:

A is a general sparse matrix, \(\alpha\), \(\beta\), and d are scalars, \(x\) and \(y\) are dense vectors.

gemvdot (Buffer version)

Syntax

namespace oneapi::mkl::sparse {

   void gemvdot (sycl::queue                          &queue,
                 oneapi::mkl::transpose               transpose_val,
                 fp                                   alpha,
                 oneapi::mkl::sparse::matrix_handle_t A_handle,
                 sycl::buffer<fp, 1>                  &x,
                 fp                                   beta,
                 sycl::buffer<fp, 1>                  &y,
                 sycl::buffer<fp, 1>                  &d);

}

Input Parameters

queue

Specifies the SYCL command queue which will be used for SYCL kernels execution.

transpose_val

Specifies operation op() on input matrix. The possible options are described in transpose enum class.

alpha

Specifies the scalar \(\alpha\).

A_handle

Handle to object containing sparse matrix \(A\). Created using the oneapi::mkl::sparse::set_csr_data routine.

x

SYCL memory object containing an array of size at least equal to the number of columns of matrix \(\text{op}(A)\).

beta

Specifies the scalar \(\beta\).

y

SYCL memory object containing an array of size at least equal to the number of rows of matrix \(\text{op}(A)\).

d

SYCL scalar memory object used to store the result of dot product.

Output Parameters

y

Overwritten by the updated vector y.

d

Overwritten by the dot product of x and y.

Throws

This routine shall throw the following exceptions if the associated condition is detected. An implementation may throw additional implementation-specific exception(s) in case of error conditions not covered here.

gemvdot (USM version)

Syntax

namespace oneapi::mkl::sparse {

   sycl::event gemvdot (sycl::queue                           &queue,
                        oneapi::mkl::transpose                transpose_val,
                        fp                                    alpha,
                        oneapi::mkl::sparse::matrix_handle_t  A_handle,
                        fp                                    *x,
                        fp                                    beta,
                        fp                                    *y,
                        fp                                    *d,
                        const std::vector<sycl::event>        &dependencies = {});

}

Input Parameters

queue

Specifies the SYCL command queue which will be used for SYCL kernels execution.

transpose_val

Specifies operation op() on input matrix. The possible options are described in transpose enum class.

alpha

Specifies the scalar \(\alpha\).

A_handle

Handle to object containing sparse matrix \(A\). Created using the oneapi::mkl::sparse::set_csr_data routine.

x

Device-accessible USM object containing an array of size at least equal to the number of columns of matrix \(\text{op}(A)\).

beta

Specifies the scalar \(\beta\).

y

Device-accessible USM object containing an array of size at least equal to the number of rows of matrix \(\text{op}(A)\)

d

Device-accessible USM scalar object used to store the result of dot product.

dependencies

List of events that oneapi::mkl::sparse::gemvdot routine depends on. If omitted, defaults to no dependencies.

Output Parameters

y

Overwritten by the updated vector y.

d

Overwritten by the dot product of x and y.

Throws

This routine shall throw the following exceptions if the associated condition is detected. An implementation may throw additional implementation-specific exception(s) in case of error conditions not covered here.

Return Values

Output event that can be waited upon or added as a dependency for the completion of gemvdot routine.