Skip to content

Commit 8f64ff8

Browse files
authored
[MKL] Fixes for VM, RNG, Stats (#433)
* [MKL] Fix directories for VM, RNG, Stats * [MKL][RNG] Minor fixes * [RNG] address comments
1 parent bf78ebf commit 8f64ff8

16 files changed

+102
-93
lines changed

source/elements/oneMKL/source/domains/domains.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This section describes the Data Parallel C++ (DPC++) interface.
1212
.. include:: dense_linear_algebra.inc.rst
1313
.. include:: sparse_linear_algebra.inc.rst
1414
.. include:: discrete_fourier_transforms.inc.rst
15-
.. include:: rng/random_number_generators.inc.rst
16-
.. include:: stats/stats.inc.rst
17-
.. include:: vm/vector_math.inc.rst
15+
.. include:: random_number_generators.inc.rst
16+
.. include:: stats.inc.rst
17+
.. include:: vector_math.inc.rst
1818

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.. SPDX-FileCopyrightText: 2019-2020 Intel Corporation
2+
..
3+
.. SPDX-License-Identifier: CC-BY-4.0
4+
5+
.. _onemkl_rng:
6+
7+
Random Number Generators
8+
-------------------------
9+
10+
The oneAPI Math Kernel Library Random Number Generators provides a :ref:`set of routines <onemkl_rng_overview>` implementing commonly
11+
used :ref:`pseudorandom, quasi-random, and non-deterministic generators <onemkl_rng_engines_basic_random_number_generators>`
12+
with :ref:`continuous and discrete distributions <onemkl_rng_distributions>`.
13+
14+
.. toctree::
15+
:hidden:
16+
17+
rng/onemkl-rng-overview.rst

source/elements/oneMKL/source/domains/rng/engines-basic-random-number-generators.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Engines (Basic Random Number Generators)
4040
* - \ :ref:`onemkl_rng_mt19937`\
4141
- Mersenne Twister pseudorandom number generator ``MT19937``\ :ref:`[Matsumoto98] <onemkl_rng_bibliography>` with period length 2\ :sup:`19937`-1 of the produced sequence
4242
* - \ :ref:`onemkl_rng_mt2203`\
43-
- Set of 6024 Mersenne Twister pseudorandom number generators ``MT2203``\ `[Matsumoto98] <onemkl_rng_bibliography>`, :ref:`[Matsumoto00] <onemkl_rng_bibliography>`. Each of them generates a sequence of period length equal to 2\ :sup:`2203`-1. Parameters of the generators provide mutual independence of the corresponding sequences.
43+
- Set of 6024 Mersenne Twister pseudorandom number generators ``MT2203``\ :ref:`[Matsumoto98] <onemkl_rng_bibliography>`, :ref:`[Matsumoto00] <onemkl_rng_bibliography>`. Each of them generates a sequence of period length equal to 2\ :sup:`2203`-1. Parameters of the generators provide mutual independence of the corresponding sequences.
4444
* - \ :ref:`onemkl_rng_sfmt19937`\
4545
- SIMD-oriented Fast Mersenne Twister pseudorandom number generator ``SFMT19937``\ :ref:`[Saito08] <onemkl_rng_bibliography>` with a period length equal to 2\ :sup:`19937`-1 of the produced sequence.
4646
* - \ :ref:`onemkl_rng_sobol`\

source/elements/oneMKL/source/domains/rng/mkl-rng-gaussian.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ class gaussian
156156
.. rubric:: Throws
157157

158158
oneapi::mkl::invalid_argument
159-
Exception is thrown when :math:`stddev \leq` static_cast<RealType>(0.0)
159+
Exception is thrown when `stddev` :math:`\leq` `static_cast<RealType>(0.0)`
160160

161161
.. container:: section
162162

source/elements/oneMKL/source/domains/rng/mkl-rng-leapfrog.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ leapfrog
3333
3434
namespace oneapi::mkl::rng {
3535
template<typename EngineType>
36-
void oneapi::mkl::rng::leapfrog(EngineType& engine, std::uint64_t idx, std::uint64_t stride);
36+
void leapfrog(EngineType& engine, std::uint64_t idx, std::uint64_t stride);
3737
}
3838
3939
.. container:: section
@@ -61,16 +61,16 @@ leapfrog
6161
.. code-block:: cpp
6262
6363
// Creating 3 identical engines
64-
mkl::rng::mcg31m1 engine_1(queue, seed);
64+
oneapi::mkl::rng::mcg31m1 engine_1(queue, seed);
6565
66-
mkl::rng::mcg31m1 engine_2(engine_1);
67-
mkl::rng::mcg31m1 engine_3(engine_1);
66+
oneapi::mkl::rng::mcg31m1 engine_2(engine_1);
67+
oneapi::mkl::rng::mcg31m1 engine_3(engine_1);
6868
6969
7070
// Leapfrogging the states of engines
71-
mkl::rng::leapfrog(engine_1, 0 , 3);
72-
mkl::rng::leapfrog(engine_2, 1 , 3);
73-
mkl::rng::leapfrog(engine_3, 2 , 3);
71+
oneapi::mkl::rng::leapfrog(engine_1, 0 , 3);
72+
oneapi::mkl::rng::leapfrog(engine_2, 1 , 3);
73+
oneapi::mkl::rng::leapfrog(engine_3, 2 , 3);
7474
// Generating random numbers
7575
7676

source/elements/oneMKL/source/domains/rng/mkl-rng-skip_ahead.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ skip_ahead
3333
3434
namespace oneapi::mkl::rng {
3535
template<typename EngineType>
36-
void oneapi::mkl::rng::skip_ahead(EngineType& engine, std::uint64_t num_to_skip);
36+
void skip_ahead(EngineType& engine, std::uint64_t num_to_skip);
3737
}
3838
3939
.. container:: section

source/elements/oneMKL/source/domains/rng/overview.rst renamed to source/elements/oneMKL/source/domains/rng/onemkl-rng-overview.rst

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
55
.. _onemkl_rng_overview:
66

7-
Random Number Generators (RNG) Overview
8-
=======================================
7+
Random Number Generators (RNG)
8+
==============================
99

1010
.. rubric:: Definitions
1111

@@ -62,3 +62,15 @@ The RNG domain also contains two types of free functions:
6262
Engine classes work with both generation and service routines. Distribution classes are used in
6363
generation routines only. Refer to the :ref:`onemkl_rng_usage_model`
6464
section for the description of typical RNG scenario.
65+
66+
.. toctree::
67+
:hidden:
68+
69+
onemkl-rng-usage-model.rst
70+
generate-routine.rst
71+
engines-basic-random-number-generators.rst
72+
service-routines.rst
73+
distributions.rst
74+
bibliography.rst
75+
76+
**Parent topic:** :ref:`onemkl_rng`

source/elements/oneMKL/source/domains/rng/onemkl-rng-usage-model.rst

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,13 @@ oneMKL RNG Usage Model
1212

1313
A typical algorithm for random number generators is as follows:
1414

15+
1. Create and initialize the object for basic random number generator.
1516

16-
1. Create and initialize the object for basic random number
17-
generator.
18-
19-
20-
- Use the skip_ahead or leapfrog function if it is required (used
21-
in parallel with random number generation for Host and CPU
22-
devices).
23-
17+
- Use the `skip_ahead` or `leapfrog` function if it is required (used in parallel with random number generation for Host and CPU devices).
2418

2519
2. Create and initialize the object for distribution generator.
2620

27-
28-
3. Call the generate routine to get random numbers with appropriate
29-
statistical distribution.
30-
21+
3. Call the generate routine to get random numbers with appropriate statistical distribution.
3122

3223
The following example demonstrates generation of random numbers that
3324
is output of basic generator (engine) PHILOX4X32X10. The seed is

source/elements/oneMKL/source/domains/rng/random_number_generators.inc.rst

Lines changed: 0 additions & 28 deletions
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.. SPDX-FileCopyrightText: 2019-2020 Intel Corporation
2+
..
3+
.. SPDX-License-Identifier: CC-BY-4.0
4+
5+
.. _onemkl_stats:
6+
7+
Summary Statistics
8+
-------------------
9+
10+
The oneMKL provides a set of :ref:`Summary Statistics routines <onemkl_stats_overview>` that compute basic statistical estimates for single and double precision multi-dimensional datasets.
11+
12+
.. toctree::
13+
:hidden:
14+
15+
stats/onemkl_stats_overview.rst

0 commit comments

Comments
 (0)