CreateAndRegisterAllocatorV2 property
\brief Create an allocator with specific type and register it with the ::OrtEnv
This API enhance CreateAndRegisterAllocator that it can create an allocator with specific type, not just CPU allocator
Enables sharing the allocator between multiple sessions that use the same env instance.
Lifetime of the created allocator will be valid for the duration of the environment.
Returns an error if an allocator with the same ::OrtMemoryInfo is already registered.
\paramin env OrtEnv instance
\paramin provider_type ExecutionProvider type
\paramin mem_info OrtMemoryInfo instance
\paramin arena_cfg Arena configuration
\paramin provider_options_keys key of the provider options map
\paramin provider_options_values value of the provider options map
\paramin num_keys Length of the provider options map
Implementation
external ffi.Pointer<
ffi.NativeFunction<
OrtStatusPtr Function(
ffi.Pointer<OrtEnv> env,
ffi.Pointer<ffi.Char> provider_type,
ffi.Pointer<OrtMemoryInfo> mem_info,
ffi.Pointer<OrtArenaCfg> arena_cfg,
ffi.Pointer<ffi.Pointer<ffi.Char>> provider_options_keys,
ffi.Pointer<ffi.Pointer<ffi.Char>> provider_options_values,
ffi.Size num_keys,
)
>
>
CreateAndRegisterAllocatorV2;