Visible to Intel only — GUID: GUID-B8418FBB-1068-42A2-A2D8-43B2CD6F9FF2
Visible to Intel only — GUID: GUID-B8418FBB-1068-42A2-A2D8-43B2CD6F9FF2
save_state
Writes state of the random number engine to the file or memory buffer.
Description
The 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
namespace oneapi::mkl::rng { template<typename Engine> void save_state (Engine& engine, std::uint8_t* mem); }
Save to File Interface
namespace oneapi::mkl::rng { 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 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. |