Skip to content

Commit 61e21fd

Browse files
spencerpattypetercadmkrainiukJOCwriter
authored andcommitted
oneMKL: update architecture
Co-authored-by: Caday, Peter <[email protected]> Co-authored-by: Kraynyuk, Maria <[email protected]> Co-authored-by: O'Connell, John <[email protected]>
1 parent 84c0d33 commit 61e21fd

File tree

7 files changed

+83
-40
lines changed

7 files changed

+83
-40
lines changed

source/elements/oneMKL/source/architecture/api_design.inc.rst

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
.. _onemkl_api_design:
22

3-
API design in oneMKL
4-
----------------------
5-
This section discusses the general features of oneMKL API design.
3+
API Design
4+
-----------
5+
6+
This section discusses the general features of oneMKL API design. In particular, it covers the use of namespaces and data types from C++, from DPC++ and new ones introduced for oneMKL APIs.
67

78
.. _onemkl_namespaces:
89

@@ -34,18 +35,18 @@ oneMKL uses C++ STL data types for scalars where applicable:
3435
* Integer scalars are C++ fixed-size integer types (``std::intN_t``, ``std::uintN_t``).
3536
* Complex numbers are represented by C++ ``std::complex`` types.
3637

37-
In general, scalar integer arguments to oneMKL routines are 64 bit integers (``std::int64_t`` or ``std::uint64_t``). Integer vectors and matrices may have varying bit widths, defined on a per-routine basis.
38+
In general, scalar integer arguments to oneMKL routines are 64-bit integers (``std::int64_t`` or ``std::uint64_t``). Integer vectors and matrices may have varying bit widths, defined on a per-routine basis.
3839

3940
.. _onemkl_dpcpp_datatypes:
4041

4142
DPC++ datatype usage
4243
++++++++++++++++++++
4344

44-
oneMKL uses following SYCL Language data types and DPC++ Language Extensions data types:
45+
oneMKL uses the following DPC++ data types:
4546

4647
* SYCL queue ``sycl::queue`` for scheduling kernels on a SYCL device. See :ref:`onemkl_queues` for more details.
47-
* SYCL buffer ``sycl::buffer`` for buffer based memory access. See :ref:`onemkl_buffers` for more details.
48-
* DPC++ Extension Unified Shared Memory (USM) for pointer based memory access. See :ref:`onemkl_usm` for more details.
48+
* SYCL buffer ``sycl::buffer`` for buffer-based memory access. See :ref:`onemkl_buffers` for more details.
49+
* Unified Shared Memory (USM) for pointer-based memory access. See :ref:`onemkl_usm` for more details.
4950
* SYCL event ``sycl::event`` for output event synchronization in oneMKL routines with USM pointers. See :ref:`onemkl_synchronization_with_usm` for more details.
5051
* Vector of SYCL events ``sycl::vector_class<sycl::event>`` for input events synchronization in oneMKL routines with USM pointers. See :ref:`onemkl_synchronization_with_usm` for more details.
5152

@@ -54,7 +55,7 @@ oneMKL uses following SYCL Language data types and DPC++ Language Extensions dat
5455
oneMKL defined datatypes
5556
++++++++++++++++++++++++
5657

57-
oneMKL linear algebra routines use scoped enum types as type-safe replacements for the traditional character arguments used in BLAS and LAPACK. These types all belong to the ``onemkl`` namespace.
58+
oneMKL dense and sparse linear algebra routines use scoped enum types as type-safe replacements for the traditional character arguments used in C/Fortran implementations of BLAS and LAPACK. These types all belong to the ``onemkl`` namespace.
5859

5960
Each enumeration value comes with two names: A single-character name (the traditional BLAS/LAPACK character) and a longer, more descriptive name. The two names are exactly equivalent and may be used interchangeably.
6061

@@ -180,3 +181,22 @@ Each enumeration value comes with two names: A single-character name (the tradit
180181
- ``offset::row``
181182
- The offset to apply to the output matrix is a row offset, that is to say all the rows in the ``C_offset`` matrix are the same and given by the elements in the ``co`` array.
182183

184+
.. rubric:: index_base
185+
:name: index_base
186+
:class: sectiontitle
187+
188+
The ``index_base`` type specifies how values in index arrays are interpreted. For instance, a sparse matrix stores nonzero values and the
189+
indices that they correspond to. The indices are traditionally provided in one of two forms: C/C++-style using zero-based
190+
indices, or Fortran-style using one-based indices. The ``index_base`` type can take the following values:
191+
192+
.. container:: tablenoborder
193+
194+
.. list-table::
195+
:header-rows: 1
196+
197+
* - Name
198+
- Description
199+
* - ``index_base::zero``
200+
- Index arrays for an input matrix are provided using zero-based (C/C++ style) index values. That is, indices start at 0.
201+
* - ``index_base::one``
202+
- Index arrays for an input matrix are provided using one-based (Fortran style) index values. That is, indices start at 1.

source/elements/oneMKL/source/architecture/architecture.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,16 @@
33
oneMKL Architecture
44
====================
55

6+
The oneMKL element of oneAPI has several general assumptions, requirements and recommendations for all domains contained therein. These will be addressed in this architecture section.
7+
In particular, DPC++ allows for a great control over the execution of kernels on the various devices. We discuss the supported execution models of oneMKL APIs in :ref:`onemkl_execution_model`.
8+
A discussion of how data is stored and passed in and out of the APIs is addressed in :ref:`onemkl_memory_model`.
9+
The general structure and design of oneMKL APIs including namespaces and common data types are expressed in :ref:`onemkl_api_design`.
10+
The exceptions and error handling are described in :ref:`onemkl_exceptions`.
11+
Finally all the other necessary aspects related to oneMKL architecture can be found in :ref:`onemkl_arch_other` including versioning and discussion of pre and post conditions.
12+
13+
614
.. include:: execution_model.inc.rst
715
.. include:: memory_model.inc.rst
816
.. include:: api_design.inc.rst
917
.. include:: exceptions.inc.rst
10-
.. include:: global_library_controls.inc.rst
18+
.. include:: other_architecture.inc.rst
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. _onemkl_exceptions:
22

3-
oneMKL Exceptions
4-
------------------
3+
Exceptions and Error Handling
4+
------------------------------
55

66
Will be added in a future version.
77

source/elements/oneMKL/source/architecture/execution_model.inc.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
Execution Model
44
---------------
55

6-
This section describes the execution environment common to all oneMKL functionality.
6+
This section describes the execution environment common to all oneMKL functionality. The execution environment includes how data is provided to computational routines in :ref:`onemkl_queues`, support for several devices in :ref:`onemkl_device_usage`, synchronous and asynchronous exection models in :ref:`onemkl_asynchronous_synchronous_execution` and :ref:`onemkl_host_thread_safety`.
77

88
.. _onemkl_queues:
99

10-
Queues
11-
++++++
10+
Use of Queues
11+
+++++++++++++
1212

13-
Will be added in a future version.
13+
The ``sycl::queue`` defined in the oneAPI DPC++ specification is used to specify the device and features enabled on that device on which a task will be enqueued. There are two forms of computational routines in oneMKL: class based :ref:`onemkl_member_functions` and standalone :ref:`onemkl_nonmember_functions`. As these may interact with the ``sycl::queue`` in different ways, we provide a section for each one to describe assumptions.
1414

1515

1616
.. _onemkl_nonmember_functions:
@@ -25,7 +25,8 @@ Each oneMKL non-member computational routine takes a ``sycl::queue`` reference a
2525
All computation performed by the routine shall be done on the hardware device(s) associated with this queue, with possible aid from the host, unless otherwise specified.
2626
In the case of an ordered queue, all computation shall also be ordered with respect to other kernels as if enqueued on that queue.
2727

28-
A particular oneMKL implementation may not support the execution of a given oneMKL routine on the specified device(s). In this case, the implementation may either perform the computation on the host or throw an exception.
28+
A particular oneMKL implementation may not support the execution of a given oneMKL routine on the specified device(s). In this case, the implementation may either perform the computation on the host or throw an exception. See :ref:`onemkl_exceptions` for the possible exceptions.
29+
2930

3031
.. _onemkl_member_functions:
3132

source/elements/oneMKL/source/architecture/global_library_controls.inc.rst

Lines changed: 0 additions & 23 deletions
This file was deleted.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
.. _onemkl_arch_other:
2+
3+
Other Features
4+
----------------
5+
This section covers all other features in the design of oneMKL architecture.
6+
7+
8+
9+
.. _onemkl_spec_versioning:
10+
11+
oneMKL Specification Versioning Strategy
12+
+++++++++++++++++++++++++++++++++++++++++
13+
14+
This oneMKL specification uses a ``MAJOR.MINOR.PATCH`` approach for its versioning strategy.
15+
The ``MAJOR`` count is updated when a significant new feature or domain is added or backward compatibility is broken.
16+
The ``MINOR`` count is updated when new APIs are changed or added or deleted, or language updated with relatively significant change to the meaning but without breaking backwards compatibility.
17+
The ``PATCH`` count is updated when wording, language or structure is updated without significant change to the meaning or interpretation.
18+
19+
20+
.. _onemkl_spec_current_version:
21+
22+
Current Version of this oneMKL Specification
23+
+++++++++++++++++++++++++++++++++++++++++++++
24+
25+
This is the oneMKL specification version 0.8.0.
26+
27+
28+
.. _onemkl_pre_post_conditions:
29+
30+
Pre/Post Condition Checking
31+
+++++++++++++++++++++++++++++++++++++++
32+
33+
The individual oneMKL computational routines will define any preconditions and postconditions and will define in this specification any specific checks or verifications that should be enabled for all implementations.
34+
35+

source/elements/oneMKL/source/index.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ oneMKL |mkl_version|
99

1010
The |mkl_full_name| (oneMKL) defines a set of fundamental mathematical routines for use in high-performance computing and other applications. As part of oneAPI, oneMKL is designed to allow execution on a wide variety of computational devices: CPUs, GPUs, FPGAs, and other accelerators. The functionality is subdivided into several domains: dense linear algebra, sparse linear algebra, discrete Fourier transforms, random number generators and vector math.
1111

12-
The general assumptions, design features and requirements for the oneMKL library and its routines will be described in :ref:`onemkl_architecture`. The individual domains and their APIs are described in :ref:`onemkl_domains`.
12+
13+
The general assumptions, design features and requirements for the oneMKL library and host-to-device computational routines will be described in :ref:`onemkl_architecture`.
14+
The individual domains and their APIs are described in :ref:`onemkl_domains`.
1315

1416

1517
.. toctree::

0 commit comments

Comments
 (0)