oneapi::mkl::rng::save_state
Writes state of the random number engine to the file or memory buffer.
Description
The
oneapi::mkl::rng::save_state
function allows you to store the state of the random number engine in the binary format in a file or memory buffer.API
Syntax
Save to Memory Interface
template<typename Engine>
void save_state (Engine& engine,
std::uint8_t* mem);
Save to File Interface
template<typename Engine>
void save_state (Engine& engine,
const std::string& filename);
Include Files
- oneapi/mkl/rng.hpp
Input Parameters
Save to Memory Interface
Name | Type | Description |
---|---|---|
engine | Engine& | Object of engine class, which state would be saved. |
mem | std::uint8_t* | Memory, which you allocate to store the engine’s state. To check the size of memory in bytes needed for the particular engine, use the oneapi::mkl::rng::get_state_size function. |
Save to File Interface
Name | Type | Description |
---|---|---|
engine | Engine& | Object of engine class, which state would be saved. |
filename | const std::string& | Name of the file where the engine’s state would be written. |