Skip to content

Commit b296922

Browse files
authored
[LAPACK][DOCS] Add LAPACK documentation (#135)
1 parent 99e6783 commit b296922

File tree

86 files changed

+11919
-5
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+11919
-5
lines changed

docs/create_new_backend.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
.. _create_backend_wrappers:
55

6-
Integrating a Third-party Library to oneAPI Math Kernel Library (oneMKL) Interfaces
6+
Integrating a Third-Party Library to oneAPI Math Kernel Library (oneMKL) Interfaces
77
====================================================================================
88

99
This step-by-step tutorial provides examples for enabling new third-party libraries in oneMKL.

docs/domains/dense_linear_algebra.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ Dense Linear Algebra
55

66
This section contains information about dense linear algebra routines:
77

8-
:ref:`matrix-storage` provides information about dense matrix and vector storage formats that are used by oneMKL :ref:`onemkl_blas`.
8+
:ref:`matrix-storage` provides information about dense matrix and vector storage formats that are used by oneMKL :ref:`onemkl_blas` and :ref:`onemkl_lapack`.
99

1010
:ref:`onemkl_blas` provides vector, matrix-vector, and matrix-matrix routines for dense matrices and vector operations.
1111

12+
:ref:`onemkl_lapack` provides more complex dense linear algebra routines, e.g., matrix factorization, solving dense systems of linear equations, least square problems, eigenvalue and singular value problems, and performing a number of related computational tasks.
1213

1314
.. toctree::
1415
:hidden:
1516

1617
matrix-storage.rst
1718
blas/blas.rst
19+
lapack/lapack.rst

docs/domains/lapack/gebrd.rst

Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
.. SPDX-FileCopyrightText: 2019-2020 Intel Corporation
2+
..
3+
.. SPDX-License-Identifier: CC-BY-4.0
4+
5+
.. _onemkl_lapack_gebrd:
6+
7+
gebrd
8+
=====
9+
10+
Reduces a general matrix to bidiagonal form.
11+
12+
.. container:: section
13+
14+
.. rubric:: Description
15+
16+
``gebrd`` supports the following precisions.
17+
18+
.. list-table::
19+
:header-rows: 1
20+
21+
* - T
22+
* - ``float``
23+
* - ``double``
24+
* - ``std::complex<float>``
25+
* - ``std::complex<double>``
26+
27+
The routine reduces a general :math:`m \times n` matrix :math:`A` to a
28+
bidiagonal matrix :math:`B` by an orthogonal (unitary) transformation.
29+
30+
31+
If :math:`m \ge n`, the reduction is given by :math:`A=QBP^H=\begin{pmatrix}B_1\\0\end{pmatrix}P^H=Q_1B_1P_H`
32+
33+
where :math:`B_{1}` is an :math:`n \times n` upper diagonal matrix,
34+
:math:`Q` and :math:`P` are orthogonal or, for a complex :math:`A`, unitary
35+
matrices; :math:`Q_{1}` consists of the first :math:`n` columns of
36+
:math:`Q`.
37+
38+
If :math:`m < n`, the reduction is given by
39+
40+
:math:`A = QBP^H = Q\begin{pmatrix}B_1\\0\end{pmatrix}P^H = Q_1B_1P_1^H`,
41+
42+
where :math:`B_{1}` is an :math:`m \times m` lower diagonal matrix,
43+
:math:`Q` and :math:`P` are orthogonal or, for a complex :math:`A`, unitary
44+
matrices; :math:`P_{1}` consists of the first :math:`m` columns of
45+
:math:`P`.
46+
47+
The routine does not form the matrices :math:`Q` and :math:`P` explicitly,
48+
but represents them as products of elementary reflectors. Routines
49+
are provided to work with the matrices :math:`Q` and :math:`P` in this
50+
representation:
51+
52+
If the matrix :math:`A` is real,
53+
54+
- to compute :math:`Q` and :math:`P` explicitly, call
55+
:ref:`onemkl_lapack_orgbr`.
56+
57+
If the matrix :math:`A` is complex,
58+
59+
- to compute :math:`Q` and :math:`P` explicitly, call
60+
:ref:`onemkl_lapack_ungbr`
61+
62+
gebrd (Buffer Version)
63+
----------------------
64+
65+
.. container:: section
66+
67+
.. rubric:: Syntax
68+
69+
.. code-block:: cpp
70+
71+
namespace oneapi::mkl::lapack {
72+
void gebrd(cl::sycl::queue &queue, std::int64_t m, std::int64_t n, cl::sycl::buffer<T,1> &a, std::int64_t lda, cl::sycl::buffer<realT,1> &d, cl::sycl::buffer<realT,1> &e, cl::sycl::buffer<T,1> &tauq, cl::sycl::buffer<T,1> &taup, cl::sycl::buffer<T,1> &scratchpad, std::int64_t scratchpad_size)
73+
}
74+
75+
.. container:: section
76+
77+
.. rubric:: Input Parameters
78+
79+
queue
80+
The queue where the routine should be executed.
81+
82+
m
83+
The number of rows in the matrix :math:`A` (:math:`0 \le m`).
84+
85+
n
86+
The number of columns in the matrix :math:`A` (:math:`0 \le n`).
87+
88+
a
89+
The buffer :math:`a`, size (``lda,*``). The buffer ``a`` contains the
90+
matrix :math:`A`. The second dimension of ``a`` must be at least
91+
:math:`\max(1, m)`.
92+
93+
lda
94+
The leading dimension of :math:`a`.
95+
96+
scratchpad_size
97+
Size of scratchpad memory as a number of floating point elements of type ``T``.
98+
Size should not be less than the value returned by :ref:`onemkl_lapack_gebrd_scratchpad_size` function.
99+
100+
.. container:: section
101+
102+
.. rubric:: Output Parameters
103+
104+
a
105+
If :math:`m \ge n`, the diagonal and first super-diagonal of a are
106+
overwritten by the upper bidiagonal matrix :math:`B`. The elements
107+
below the diagonal, with the buffer tauq, represent the orthogonal
108+
matrix :math:`Q` as a product of elementary reflectors, and the
109+
elements above the first superdiagonal, with the buffer ``taup``,
110+
represent the orthogonal matrix :math:`P` as a product of elementary
111+
reflectors.
112+
113+
If :math:`m<n`, the diagonal and first sub-diagonal of a are
114+
overwritten by the lower bidiagonal matrix :math:`B`. The elements
115+
below the first subdiagonal, with the buffer tauq, represent the
116+
orthogonal matrix :math:`Q` as a product of elementary reflectors, and
117+
the elements above the diagonal, with the buffer ``taup``, represent
118+
the orthogonal matrix :math:`P` as a product of elementary reflectors.
119+
120+
d
121+
Buffer, size at least :math:`\max(1, \min(m,n))`. Contains the diagonal
122+
elements of :math:`B`.
123+
124+
e
125+
Buffer, size at least :math:`\max(1, \min(m,n) - 1)`. Contains the
126+
off-diagonal elements of :math:`B`.
127+
128+
tauq
129+
Buffer, size at least :math:`\max(1, \min(m, n))`. The scalar factors of
130+
the elementary reflectors which represent the orthogonal or
131+
unitary matrix :math:`Q`.
132+
133+
taup
134+
Buffer, size at least :math:`\max(1, \min(m, n))`. The scalar factors of
135+
the elementary reflectors which represent the orthogonal or
136+
unitary matrix :math:`P`.
137+
138+
scratchpad
139+
Buffer holding scratchpad memory to be used by routine for storing intermediate results.
140+
141+
gebrd (USM Version)
142+
-------------------
143+
144+
.. container:: section
145+
146+
.. rubric:: Syntax
147+
148+
.. code-block:: cpp
149+
150+
namespace oneapi::mkl::lapack {
151+
cl::sycl::event gebrd(cl::sycl::queue &queue, std::int64_t m, std::int64_t n, T *a, std::int64_t lda, RealT *d, RealT *e, T *tauq, T *taup, T *scratchpad, std::int64_t scratchpad_size, const cl::sycl::vector_class<cl::sycl::event> &events = {})
152+
}
153+
154+
.. container:: section
155+
156+
.. rubric:: Input Parameters
157+
158+
queue
159+
The queue where the routine should be executed.
160+
161+
m
162+
The number of rows in the matrix :math:`A` (:math:`0 \le m`).
163+
164+
n
165+
The number of columns in the matrix :math:`A` (:math:`0 \le n`).
166+
167+
a
168+
Pointer to matrix :math:`A`. The second dimension of ``a`` must be at least
169+
:math:`\max(1, m)`.
170+
171+
lda
172+
The leading dimension of ``a``.
173+
174+
scratchpad_size
175+
Size of scratchpad memory as a number of floating point elements of type T.
176+
Size should not be less than the value returned by :ref:`onemkl_lapack_gebrd_scratchpad_size` function.
177+
178+
events
179+
List of events to wait for before starting computation. Defaults to empty list.
180+
181+
.. container:: section
182+
183+
.. rubric:: Output Parameters
184+
185+
a
186+
If :math:`m \ge n`, the diagonal and first super-diagonal of a are
187+
overwritten by the upper bidiagonal matrix :math:`B`. The elements
188+
below the diagonal, with the array tauq, represent the orthogonal
189+
matrix :math:`Q` as a product of elementary reflectors, and the
190+
elements above the first superdiagonal, with the array ``taup``,
191+
represent the orthogonal matrix :math:`P` as a product of elementary
192+
reflectors.
193+
194+
If :math:`m<n`, the diagonal and first sub-diagonal of a are
195+
overwritten by the lower bidiagonal matrix :math:`B`. The elements
196+
below the first subdiagonal, with the array tauq, represent the
197+
orthogonal matrix :math:`Q` as a product of elementary reflectors, and
198+
the elements above the diagonal, with the array ``taup``, represent
199+
the orthogonal matrix :math:`P` as a product of elementary reflectors.
200+
201+
d
202+
Pointer to memory of size at least :math:`\max(1, \min(m,n))`. Contains the diagonal
203+
elements of :math:`B`.
204+
205+
e
206+
Pointer to memory of size at least :math:`\max(1, \min(m,n) - 1)`. Contains the
207+
off-diagonal elements of :math:`B`.
208+
209+
tauq
210+
Pointer to memory of size at least :math:`\max(1, \min(m, n))`. The scalar factors of
211+
the elementary reflectors which represent the orthogonal or
212+
unitary matrix :math:`Q`.
213+
214+
taup
215+
Pointer to memory of size at least :math:`\max(1, \min(m, n))`. The scalar factors of
216+
the elementary reflectors which represent the orthogonal or
217+
unitary matrix :math:`P`.
218+
219+
scratchpad
220+
Pointer to scratchpad memory to be used by routine for storing intermediate results.
221+
222+
.. container:: section
223+
224+
.. rubric:: Return Values
225+
226+
Output event to wait on to ensure computation is complete.
227+
228+
**Parent topic:** :ref:`onemkl_lapack-singular-value-eigenvalue-routines`
229+
230+
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
.. SPDX-FileCopyrightText: 2019-2020 Intel Corporation
2+
..
3+
.. SPDX-License-Identifier: CC-BY-4.0
4+
5+
.. _onemkl_lapack_gebrd_scratchpad_size:
6+
7+
gebrd_scratchpad_size
8+
=====================
9+
10+
Computes size of scratchpad memory required for :ref:`onemkl_lapack_gebrd` function.
11+
12+
.. rubric:: Description
13+
14+
``gebrd_scratchpad_size`` supports the following precisions.
15+
16+
.. list-table::
17+
:header-rows: 1
18+
19+
* - T
20+
* - ``float``
21+
* - ``double``
22+
* - ``std::complex<float>``
23+
* - ``std::complex<double>``
24+
25+
Computes the number of elements of type ``T`` the scratchpad memory to be passed to :ref:`onemkl_lapack_gebrd` function should be able to hold.
26+
Calls to this routine must specify the template parameter explicitly.
27+
28+
.. rubric:: Syntax
29+
30+
.. code-block:: cpp
31+
32+
namespace oneapi::mkl::lapack {
33+
template <typename T>
34+
std::int64_t gebrd_scratchpad_size(cl::sycl::queue &queue, std::int64_t m, std::int64_t n, std::int64_t lda)
35+
}
36+
37+
.. container:: section
38+
39+
.. rubric:: Input Parameters
40+
41+
queue
42+
Device queue where calculations by :ref:`onemkl_lapack_gebrd` function will be performed.
43+
44+
m
45+
The number of rows in the matrix :math:`A` (:math:`0 \le m`).
46+
47+
n
48+
The number of columns in the matrix :math:`A` (:math:`0 \le n`).
49+
50+
lda
51+
The leading dimension of ``a``.
52+
53+
.. container:: section
54+
55+
.. rubric:: Return Value
56+
57+
The number of elements of type ``T`` the scratchpad memory to be passed to :ref:`onemkl_lapack_gebrd` function should be able to hold.
58+
59+
**Parent topic:** :ref:`onemkl_lapack-singular-value-eigenvalue-routines`
60+
61+

0 commit comments

Comments
 (0)