#pragma once
#include <stddef.h>
#include <stdint.h>
#include "xnnpack.h"
#include "xnnpack/common.h"
#include "xnnpack/memory.h"
#include "xnnpack/mutex.h"
#ifdef __cplusplus
extern "C" {
#endif
#define XNN_CACHE_NOT_FOUND …
uint32_t murmur_hash3(const void* key, size_t len, uint32_t seed);
struct xnn_cache_bucket { … };
enum xnn_cache_type { … };
struct xnn_cache { … };
struct xnn_code_cache { … };
enum xnn_status xnn_init_code_cache(struct xnn_code_cache* cache);
enum xnn_status xnn_release_code_cache(struct xnn_code_cache* cache);
size_t xnn_get_or_insert_code_cache(struct xnn_code_cache* cache, void* ptr,
size_t size);
XNN_INLINE static bool xnn_code_cache_valid(struct xnn_code_cache* code_cache) { … }
enum xnn_cache_state { … };
struct xnn_internal_weights_cache { … };
enum xnn_status xnn_internal_init_weights_cache_with_size(struct xnn_internal_weights_cache* cache, size_t size);
enum xnn_status xnn_internal_finalize_weights_cache(
struct xnn_internal_weights_cache* cache, enum xnn_weights_cache_finalization_kind finalization_kind);
enum xnn_status xnn_internal_release_weights_cache(struct xnn_internal_weights_cache* cache);
void* xnn_internal_reserve_space_in_weights_cache(struct xnn_internal_weights_cache* cache, size_t n);
size_t xnn_internal_get_or_insert_weights_cache(
struct xnn_internal_weights_cache* cache, const struct xnn_weights_cache_look_up_key* cache_key, void* ptr, size_t size);
bool xnn_internal_weights_cache_is_finalized(struct xnn_internal_weights_cache* cache);
size_t xnn_internal_weights_cache_look_up(
struct xnn_internal_weights_cache* cache, const struct xnn_weights_cache_look_up_key* cache_key);
void* xnn_internal_weights_cache_offset_to_addr(struct xnn_internal_weights_cache* weights_cache, size_t offset);
enum xnn_status xnn_internal_delete_weights_cache(struct xnn_internal_weights_cache* weights_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);
size_t xnn_weights_cache_look_up(
xnn_weights_cache_t cache, const struct xnn_weights_cache_look_up_key* cache_key);
#ifdef __cplusplus
}
#endif