Visible to Intel only — GUID: GUID-F7FDF793-E41D-4E9E-8A56-85B30E899A74
Visible to Intel only — GUID: GUID-F7FDF793-E41D-4E9E-8A56-85B30E899A74
Engines
Random number engines are used for uniformly distributed random numbers generation by using a seed - the initial value that allows to select a particular random number sequence. Initialization is an engine-specific procedure.
Algorithm Input
Engines accept the input described below. Pass the Input ID as a parameter to the methods that provide input for your algorithm. For more details, see Algorithms.
Input ID |
Input |
---|---|
tableToFill |
Pointer to the numeric table of size . This input can be an object of any class derived from NumericTable except CSRNumericTable, PackedSymmetricMatrix, PackedTriangularMatrix, and MergedNumericTable when it holds one of the above table types. |
Algorithm Output
Engines calculate the result described below. Pass the Result ID as a parameter to the methods that access the results of your algorithm. For more details, see Algorithms.
Result ID |
Result |
---|---|
randomNumbers |
Pointer to the numeric table with generated random floating-point values of single or double precision. In oneDAL, engines are in-place, which means that the algorithm does not allocate memory for the distribution result, but returns pointer to the filled input. |
Parallel Random Number Generation
The following methods that support generation of sequences of random numbers in parallel are supported in library:
- Family
-
Engines follow the same algorithmic scheme with different algorithmic parameters. The set of the parameters guarantee independence of random number sequences produced by the engines.
The example below demonstrates the idea for the case when 2 engines from the same family are used to generate 2 random sequences:
Family method of random sequence generation - SkipAhead
-
This method skips nskip elements of the original random sequence. This method allows to produce nThreads non-overlapping subsequences.
The example below demonstrates the idea for the case when 2 subsequences are used from the random sequence:
SkipAhead method of random sequence generation - LeapFrog
-
This method generates random numbers with a stride of nThreads. threadIdx is an index of the current thread.
The example below demonstrates the idea for the case when 2 subsequences are used from the random sequence:
LeapFrog method of random sequence generation
These methods are represented with member functions of classes that represent functionality described in the Engines section. See API References for details.