Developer Reference for Intel® oneAPI Math Kernel Library for Fortran

ID 766686
Date 6/24/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

vslNewStream

Creates and initializes a random stream.

Syntax

status = vslnewstream( stream, brng, seed )

Include Files

  • mkl.fi, mkl_vsl.f90

Input Parameters

Name

Type

Description

brng

INTEGER, INTENT(IN)

Index of the basic generator to initialize the stream. See Table Values of brng parameter for specific value.

seed

INTEGER, INTENT(IN)

Initial condition of the stream. In the case of a quasi-random number generator seed parameter is used to set the dimension. If the dimension is greater than the dimension that brng can support or is less than 1, then the dimension is assumed to be equal to 1.

Output Parameters

Name

Type

Description

stream

TYPE(VSL_STREAM_STATE), INTENT(OUT)

Stream state descriptor

Description

For a basic generator with number brng, this function creates a new stream and initializes it with a 32-bit seed. The seed is an initial value used to select a particular sequence generated by the basic generator brng. The function is also applicable for generators with multiple initial conditions. Use this function to create and initialize a new stream with a 32-bit seed only. If you need to provide multiple initial conditions such as several 32-bit or wider seeds, use the function vslNewStreamEx. See VS Notes for a more detailed description of stream initialization for different basic generators.

NOTE:

This function is not applicable for abstract basic random number generators. Please use vsliNewAbstractStream, vslsNewAbstractStream or vsldNewAbstractStream to utilize integer, single-precision or double-precision external random data respectively.

Product and Performance Information

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.

Notice revision #20201201

Return Values

VSL_ERROR_OK, VSL_STATUS_OK

Indicates no error, execution is successful.

VSL_RNG_ERROR_INVALID_BRNG_INDEX

BRNG index is invalid.

VSL_ERROR_MEM_FAILURE

System cannot allocate memory for stream.

VSL_RNG_ERROR_NONDETERMINISTIC_NOT_SUPPORTED

Non-deterministic random number generator is not supported.

VSL_RNG_ERROR_ARS5_NOT_SUPPORTED

ARS-5 random number generator is not supported on the CPU running the application.