CreateArenaCfgV2 property

Pointer<NativeFunction<OrtStatusPtr Function(Pointer<Pointer<Char>> arena_config_keys, Pointer<Size> arena_config_values, Size num_keys, Pointer<Pointer<OrtArenaCfg>> out)>> CreateArenaCfgV2
getter/setter pair

\brief Create an ::OrtArenaCfg

Create the configuration of an arena that can eventually be used to define an arena based allocator's behavior.

Supported keys are (See https://onnxruntime.ai/docs/get-started/with-c.html for details on what the following parameters mean and how to choose these values.): "max_mem": Maximum memory that can be allocated by the arena based allocator. Use 0 for ORT to pick the best value. Default is 0. "arena_extend_strategy": 0 = kNextPowerOfTwo, 1 = kSameAsRequested. Use -1 to allow ORT to choose the default. "initial_chunk_size_bytes": (Possible) Size of the first allocation in the arena. Only relevant if arena strategy is kNextPowerOfTwo. Use -1 to allow ORT to choose the default. Ultimately, the first allocation size is determined by the allocation memory request. "max_dead_bytes_per_chunk": Threshold of unused memory in an allocated chunk of arena memory after crossing which the current chunk is chunked into 2. "initial_growth_chunk_size_bytes": (Possible) Size of the second allocation in the arena. Only relevant if arena strategy is kNextPowerOfTwo. Use -1 to allow ORT to choose the default. "max_power_of_two_extend_bytes": The maximum extend size if arena strategy is kNextPowerOfTwo. It is not an allocation limit, it is only a limit for extension when requested byte is less than the limit. When requested bytes is more than the limit, allocator will still return as requested. Use -1 to allow ORT to choose the default 1GB for max_power_of_two_extend_bytes. Ultimately, the allocation size is determined by the allocation memory request. Further allocation sizes are governed by the arena extend strategy.

\paramin arena_config_keys Keys to configure the arena \paramin arena_config_values Values to configure the arena \paramin num_keys Number of keys in arena_config_keys and arena_config_values \paramout out Newly created ::OrtArenaCfg. Must be freed with OrtApi::ReleaseArenaCfg

\snippet{doc} snippets.dox OrtStatus Return Value

Implementation

external ffi.Pointer<
  ffi.NativeFunction<
    OrtStatusPtr Function(
      ffi.Pointer<ffi.Pointer<ffi.Char>> arena_config_keys,
      ffi.Pointer<ffi.Size> arena_config_values,
      ffi.Size num_keys,
      ffi.Pointer<ffi.Pointer<OrtArenaCfg>> out,
    )
  >
>
CreateArenaCfgV2;