Developer Reference for Intel® oneAPI Math Kernel Library for 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.) |
Creates and initializes a random stream. |
vslNewStreamEx (Creates and initializes a random stream for generators with multiple initial conditions.) |
Creates and initializes a random stream for the generators with multiple initial conditions. |
vsliNewAbstractStream (Creates and initializes an abstract random stream for integer arrays.) |
Creates and initializes an abstract random stream for integer arrays. |
vsldNewAbstractStream (Creates and initializes an abstract random stream for double precision floating-point arrays.) |
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.) |
Creates and initializes an abstract random stream for single precision floating-point arrays. |
vslDeleteStream (Deletes a random stream.) |
Deletes previously created stream. |
vslCopyStream (Creates a copy of a random stream.) |
Copies a stream to another stream. |
vslCopyStreamState (Creates a copy of a random stream state.) |
Creates a copy of a random stream state. |
vslSaveStreamF (Writes random stream descriptive data, including stream state, to binary file.) |
Writes a stream to a binary file. |
vslLoadStreamF (Creates new stream and reads stream descriptive data, including stream state, from binary file.) |
Reads a stream from a binary file. |
vslSaveStreamM (Writes random stream descriptive data, including stream state, to a memory buffer.) |
Writes a random stream descriptive data, including state, to a memory buffer. |
vslLoadStreamM (Creates a new stream and reads stream descriptive data, including stream state, from the memory buffer.) |
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.) |
Computes size of memory necessary to hold the random stream. |
vslLeapfrogStream (Initializes a stream using the leapfrog method.) |
Initializes the stream by the leapfrog method to generate a subsequence of the original sequence. |
vslSkipAheadStream (Initializes a stream using the block-splitting method.) |
Initializes the stream by the skip-ahead method. |
Initializes the stream by the advanced skip-ahead method. |
|
vslGetStreamStateBrng (Returns index of a basic generator used for generation of a given random stream.) |
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.) |
Obtains the number of currently registered basic generators. |
Most of the generator-based work comprises three basic steps:
Creating and initializing a stream ( vslNewStream (Creates and initializes a random stream.) , vslNewStreamEx (Creates and initializes a random stream for generators with multiple initial conditions.) , vslCopyStream (Creates a copy of a random stream.) , vslCopyStreamState (Creates a copy of a random stream state.) , vslLeapfrogStream (Initializes a stream using the leapfrog method.) , vslSkipAheadStream (Initializes a stream using the block-splitting method.) , vslSkipAheadStreamEx (Initializes a stream using the block-splitting method with partitioned number of skipped elements.) ).
Generating random numbers with given distribution, see Distribution Generators .
Deleting the stream ( vslDeleteStream (Deletes a random stream.) ).
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 (Deletes a random stream.) function to delete all the streams afterwards.