Intel® oneAPI Math Kernel Library Developer Reference - C

Service Routines

Stream handling comprises routines for creating, deleting, or copying the streams and getting the index of a basic generator. A random stream can also be saved to and then read from a binary file. Table "Service Routines" lists all available service routines

Service Routines

Routine

Short Description

vslNewStream

Creates and initializes a random stream.

vslNewStreamEx

Creates and initializes a random stream for the generators with multiple initial conditions.

vsliNewAbstractStream

Creates and initializes an abstract random stream for integer arrays.

vsldNewAbstractStream

Creates and initializes an abstract random stream for double precision floating-point arrays.

vslsNewAbstractStream

Creates and initializes an abstract random stream for single precision floating-point arrays.

vslDeleteStream

Deletes previously created stream.

vslCopyStream

Copies a stream to another stream.

vslCopyStreamState

Creates a copy of a random stream state.

vslSaveStreamF

Writes a stream to a binary file.

vslLoadStreamF

Reads a stream from a binary file.

vslSaveStreamM

Writes a random stream descriptive data, including state, to a memory buffer.

vslLoadStreamM

Creates a new stream and reads stream descriptive data, including state, from the memory buffer.

vslGetStreamSize

Computes size of memory necessary to hold the random stream.

vslLeapfrogStream

Initializes the stream by the leapfrog method to generate a subsequence of the original sequence.

vslSkipAheadStream

Initializes the stream by the skip-ahead method.

vslSkipAheadStreamEx

Initializes the stream by the advanced skip-ahead method.

vslGetStreamStateBrng

Obtains the index of the basic generator responsible for the generation of a given random stream.

vslGetNumRegBrngs

Obtains the number of currently registered basic generators.

Most of the generator-based work comprises three basic steps:

  1. Creating and initializing a stream (vslNewStream, vslNewStreamEx, vslCopyStream, vslCopyStreamState, vslLeapfrogStream, vslSkipAheadStream, vslSkipAheadStreamEx).

  2. Generating random numbers with given distribution, see Distribution Generators.

  3. Deleting the stream (vslDeleteStream).

Note that you can concurrently create multiple streams and obtain random data from one or several generators by using the stream state. You must use the vslDeleteStream function to delete all the streams afterwards.