struct
environment_descriptionInitialization parameters for stim::
Public variables
-
environment_
flags flags - System environment flags.
-
buffer_
view buffer - The main buffer used by simulations sharing this environment.
-
log_
interface* log - The log_
interface output used by simulations sharing this environment. -
cache_
interface* cache - The cache_
interface used by simulations sharing this environment. -
executor_
interface* executor - The executor_
interface used by simulations sharing this environment.
Variable documentation
environment_ flags stim:: environment_description:: flags
System environment flags.
buffer_ view stim:: environment_description:: buffer
The main buffer used by simulations sharing this environment.
Once simulation initialization is complete the library goes to great lengths to not perform any additional per-frame allocations, instead making use of a large pre-allocated central buffer. You may control the initialization of this buffer in a few different ways:
Letting the library decide (default)
stim::environment_description desc{}; // the lib will allocate a buffer of dynamically-determined size
Specifying the size of the buffer only
constexpr size_t buf_size = 1024 * 1024 * 64; stim::environment_description desc{}; desc.buffer = { nullptr, buf_size }; // the lib will manage the allocation internally
Managing the allocation yourself
constexpr size_t buf_size = 1024 * 1024 * 64; auto buf = malloc(buf_size); // or whatever you prefer stim::environment_description desc{}; desc.buffer = { buf, buf_size };
log_ interface* stim:: environment_description:: log
The log_
cache_ interface* stim:: environment_description:: cache
The cache_
executor_ interface* stim:: environment_description:: executor
The executor_