File: precision.rst

package info (click to toggle)
rocsolver 6.4.3-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 17,876 kB
  • sloc: cpp: 151,850; python: 2,275; sh: 875; objc: 642; ansic: 402; makefile: 71; xml: 26
file content (93 lines) | stat: -rw-r--r-- 3,403 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
.. meta::
  :description: rocSOLVER library precision support overview
  :keywords: rocSOLVER, ROCm, API, Linear Algebra, documentation, precision support, data types

.. _rocsolver-precision-support:

********************************************************************
rocSOLVER precision support
********************************************************************

This section provides an overview of the numerical precision types supported by the rocSOLVER library.

Supported precision types
=========================

rocSOLVER supports four primary precision types across its functions:

.. list-table::
    :header-rows: 1

    *
      - Type prefix
      - C++ type
      - Description

    *
      - ``s``
      - ``float``
      - Single-precision real (32-bit)

    *
      - ``d``
      - ``double``
      - Double-precision real (64-bit)

    *
      - ``c``
      - ``rocblas_float_complex``
      - Single-precision complex (32-bit real, 32-bit imaginary)

    *
      - ``z``
      - ``rocblas_double_complex``
      - Double-precision complex (64-bit real, 64-bit imaginary)

Function naming convention
--------------------------

rocSOLVER follows the standard LAPACK naming convention where the first letter of the function name
indicates the precision type:

* Functions beginning with ``rocsolver_s`` operate on single-precision real data.
* Functions beginning with ``rocsolver_d`` operate on double-precision real data.
* Functions beginning with ``rocsolver_c`` operate on single-precision complex data.
* Functions beginning with ``rocsolver_z`` operate on double-precision complex data.

For example, the LU factorization function ``getrf`` is implemented as:

* ``rocsolver_sgetrf`` - For single-precision real matrices
* ``rocsolver_dgetrf`` - For double-precision real matrices
* ``rocsolver_cgetrf`` - For single-precision complex matrices
* ``rocsolver_zgetrf`` - For double-precision complex matrices

In the documentation, these are often represented generically as ``rocsolver_<type>getrf()``, where ``<type>``
is a placeholder for the precision type prefix.

Understanding precision in function signatures
----------------------------------------------

In the function signatures throughout the documentation, precision information is indicated directly in the
parameter types. For example:

.. code-block:: c

    rocblas_status rocsolver_slarfb(rocblas_handle handle, /* ... */
                                    float *v, /* ... */
                                    float *t, /* ... */
                                    float *a, /* ... */)

The parameter types (``float``, ``double``, ``rocblas_float_complex``, or ``rocblas_double_complex``) correspond
to the function prefix and indicate the precision used by that specific function variant.

Real versus complex precision
-----------------------------

Some LAPACK functions have different behaviors or names when operating on real versus complex data:

* Functions for symmetric matrices (prefix ``sy``) use the same name for both real precision types.
* Functions for Hermitian matrices (prefix ``he``) are used for complex precision types.
* Some auxiliary routines might be specific to real or complex precision types.

For example, ``rocsolver_ssytrd`` and ``rocsolver_dsytrd`` handle real symmetric matrices, while ``rocsolver_chetrd``
and ``rocsolver_zhetrd`` handle complex Hermitian matrices.