rotg (USM Version)

Computes the parameters for a Givens rotation.

Description

Given the Cartesian coordinates (a, b) of a point, the rotg routines return the parameters c, s, r, and z associated with the Givens rotation. The parameters c and s define a unitary matrix such that:

\[\begin{split}\left[ \begin{array}{ccc} c & s \\ -s & c \end{array} \right] \cdot \left[ \begin{array}{ccc} a \\ b \end{array} \right] = \left[ \begin{array}{ccc} r \\ 0 \end{array} \right]\end{split}\]

The parameter z is defined such that if |a| > |b|, z is s; otherwise if c is not 0 z is 1/c; otherwise z is 1.

API

Syntax

namespace oneapi::mkl::blas::column_major {
    sycl::event rotg(sycl::queue &queue,
                     T *a,
                     T *b,
                     T_real *c,
                     T *s,
                     const std::vector<sycl::event> &dependencies = {})
}
namespace oneapi::mkl::blas::row_major {
    sycl::event rotg(sycl::queue &queue,
                     T *a,
                     T *b,
                     T_real *c,
                     T *s,
                     const std::vector<sycl::event> &dependencies = {})
}

The USM version of rotg supports the following precisions and devices.

T

T_real

Devices Supported

float

float

Host, CPU, and GPU

double

double

Host, CPU, and GPU

std::complex<float>

float

Host, CPU, and GPU

std::complex<double>

double

Host, CPU, and GPU

Input Parameters

exec_queue

The queue where the routine should be executed

a

Pointer to the x-coordinate of the point.

b

Pointer to the y-coordinate of the point.

dependencies

List of events to wait for before starting computation, if any. If omitted, defaults to no dependencies.

Output Parameters

a

Pointer to the parameter r associated with the Givens rotation.

b

Pointer to the parameter z associated with the Givens rotation.

c

Pointer to the parameter c associated with the Givens rotation.

s

Pointer to the parameter s associated with the Givens rotation.

Return Values

Output event to wait on to ensure computation is complete.