rocblas_srotg Interface Reference

rocblas_srotg Interface Reference#

HIPFORT API Reference: hipfort_rocblas::rocblas_srotg Interface Reference
hipfort_rocblas::rocblas_srotg Interface Reference

BLAS Level 1 API. More...

Public Member Functions

integer(kind(rocblas_status_success)) function rocblas_srotg_ (handle, a, b, c, s)
 

Detailed Description

BLAS Level 1 API.

The rotg functions create the Givens rotation matrix for the vector (a b). Scalars a, b, c, and s can be stored in either host or device memory. The location is specified by calling rocblas_set_pointer_mode. The computation uses the formulas:

sigma = sgn(a)    if |a| >  |b|
      = sgn(b)    if |b| >= |a|
r = sigma*sqrt( a**2 + b**2 )
c = 1; s = 0      if r = 0
c = a/r; s = b/r  if r != 0

The subroutine also computes:

z = s    if |a| > |b|,
  = 1/c  if |b| >= |a| and c != 0
  = 1    if c = 0

This allows c and s to be reconstructed from z as follows:

If z = 1, set c = 0, s = 1.
If |z| < 1, set c = sqrt(1 - z**2) and s = z.
If |z| > 1, set c = 1/z and s = sqrt( 1 - c**2).
Parameters
[in]handle- [rocblas_handle] handle to the rocBLAS library context queue.
[in,out]a- pointer to a, an element in vector (a,b), overwritten with r.
[in,out]b- pointer to b, an element in vector (a,b), overwritten with z.
[out]c- pointer to c, cosine element of the Givens rotation.
[out]s- pointer to s, sine element of the Givens rotation.

Member Function/Subroutine Documentation

◆ rocblas_srotg_()

integer(kind(rocblas_status_success)) function hipfort_rocblas::rocblas_srotg::rocblas_srotg_ ( type(c_ptr), value  handle,
type(c_ptr), value  a,
type(c_ptr), value  b,
type(c_ptr), value  c,
type(c_ptr), value  s 
)

The documentation for this interface was generated from the following file: