Skip to content

Commit

Permalink
When no weight cache is provided to XNNPack, create one to share pack…
Browse files Browse the repository at this point in the history
…ed weights between operations.

PiperOrigin-RevId: 623781016
  • Loading branch information
qukhan authored and xnnpack-bot committed Apr 12, 2024
1 parent 4810270 commit 35c99f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 3 additions & 0 deletions include/xnnpack.h
Original file line number Diff line number Diff line change
Expand Up @@ -1905,6 +1905,9 @@ enum xnn_status xnn_finalize_weights_cache(
xnn_weights_cache_t weights_cache,
enum xnn_weights_cache_finalization_kind finalization_kind);

// Wrapper function of the function pointers in `xnn_weights_cache_t`.
bool xnn_weights_cache_is_finalized(xnn_weights_cache_t cache);

/// Destroy a weights cache object, as well as memory used for the cache.
/// @param weights_cache - the weights cache object to destroy.
enum xnn_status xnn_delete_weights_cache(xnn_weights_cache_t weights_cache);
Expand Down
3 changes: 0 additions & 3 deletions src/xnnpack/cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,6 @@ void* xnn_internal_weights_cache_offset_to_addr(struct xnn_internal_weights_cach

enum xnn_status xnn_internal_delete_weights_cache(struct xnn_internal_weights_cache* weights_cache);

// Wrapper function of the function pointers in `xnn_weights_cache_t`.
bool xnn_weights_cache_is_finalized(xnn_weights_cache_t cache);

size_t xnn_look_up_or_insert_weights_cache(
xnn_weights_cache_t cache, const struct xnn_weights_cache_look_up_key* cache_key, void* ptr, size_t size);

Expand Down

0 comments on commit 35c99f2

Please sign in to comment.