SharedPrePackedWeightCache_StoreWeightData property

Pointer<NativeFunction<OrtStatusPtr Function(Pointer<OrtSharedPrePackedWeightCache> prepacked_weight_cache, Pointer<Pointer<Void>> buffer_data_ptrs, Pointer<Size> buffer_data_sizes, Size num_buffers)>> SharedPrePackedWeightCache_StoreWeightData
getter/setter pair

\brief Sets one or more data buffers that collectively hold the pre-packed data for a single shared weight.

\note Used within the implementation of OrtKernelImpl::PrePackWeight() when the kernel wants to share pre-packed weight data with other kernels. The buffer data MUST be allocated with the OrtAllocator provided to OrtKernelImpl::PrePack.

\note Ownership of weight data transfers to the OrtSharedPrePackedWeightCache instance on success. If this function returns an error status, the caller retains ownership of the weight data.

\note Subsequent calls with the same OrtSharedPrePackedWeightCache instance release and replace the old data.

\paramin prepacked_weight_cache The OrtSharedPrePackedWeightCache instance. \paramin buffer_data_ptrs An array of buffer data pointers that collectively hold the pre-packed data for a single shared weight. Note that sometimes a single weight may have multiple pre-packed buffers and it is up to the kernel implementation to determine how to split the data into multiple buffers (if desired). \paramin buffer_data_sizes An array of buffer byte sizes, one per element in buffer_data_ptrs. \paramin num_buffers The number of buffers used to store the data for the shared pre-packed weight. Specifies the number of elements in the buffer_data_ptrs and buffer_data_sizes arrays.

\snippet{doc} snippets.dox OrtStatus Return Value

\since Version 1.24.

Implementation

external ffi.Pointer<
  ffi.NativeFunction<
    OrtStatusPtr Function(
      ffi.Pointer<OrtSharedPrePackedWeightCache> prepacked_weight_cache,
      ffi.Pointer<ffi.Pointer<ffi.Void>> buffer_data_ptrs,
      ffi.Pointer<ffi.Size> buffer_data_sizes,
      ffi.Size num_buffers,
    )
  >
>
SharedPrePackedWeightCache_StoreWeightData;