Halide 19.0.0
Halide compiler and libraries
|
#include <hashmap.h>
Public Member Functions | |
bool | init (void *user_context, copy_value_func copy_value, destroy_value_func destroy_value) |
void | prune () |
void | set_size (int64_t size) |
int | lookup (void *user_context, const uint8_t *cache_key, int32_t size, uint8_t *cache_value, size_t cache_value_size) |
void | store (void *user_context, const uint8_t *cache_key, int32_t size, const uint8_t *cache_value, size_t cache_value_size) |
void | release (void *user_context, void *host) |
void | cleanup () |
Static Public Attributes | |
static const size_t | kHashTableSize = 256 |
|
inline |
Definition at line 150 of file hashmap.h.
References cache_entries, copy_value, current_cache_size, destroy_value, halide_debug_assert, inited, kDefaultCacheSize, least_recently_used, max_cache_size, memoization_lock, memset(), most_recently_used, and user_context.
Referenced by Halide::Runtime::Internal::THashMap< KeyType, ValueType >::init().
|
inline |
Definition at line 170 of file hashmap.h.
References cache_entries, current_cache_size, Halide::Runtime::Internal::CacheEntry::destroy(), destroy_value, halide_debug_assert, Halide::Runtime::Internal::CacheEntry::hash, hashmap_free, Halide::Runtime::Internal::CacheEntry::in_use_count, kHashTableSize, least_recently_used, Halide::Runtime::Internal::CacheEntry::less_recent, max_cache_size, Halide::Runtime::Internal::CacheEntry::more_recent, most_recently_used, Halide::Runtime::Internal::CacheEntry::next, user_context, and Halide::Runtime::Internal::CacheEntry::value_size.
Referenced by set_size(), and store().
|
inline |
Definition at line 226 of file hashmap.h.
References kDefaultCacheSize, max_cache_size, memoization_lock, and prune().
|
inline |
Definition at line 237 of file hashmap.h.
References cache_entries, copy_value, Halide::Runtime::Internal::djb_hash(), halide_debug_assert, Halide::Runtime::Internal::CacheEntry::hash, Halide::Runtime::Internal::CacheEntry::in_use_count, Halide::Runtime::Internal::CacheEntry::key, Halide::Runtime::Internal::CacheEntry::key_size, Halide::Runtime::Internal::keys_equal(), kHashTableSize, least_recently_used, Halide::Runtime::Internal::CacheEntry::less_recent, memoization_lock, Halide::Runtime::Internal::CacheEntry::more_recent, most_recently_used, Halide::Runtime::Internal::CacheEntry::next, user_context, Halide::Runtime::Internal::CacheEntry::value, and Halide::Runtime::Internal::CacheEntry::value_size.
Referenced by Halide::Runtime::Internal::THashMap< KeyType, ValueType >::lookup().
|
inline |
Definition at line 299 of file hashmap.h.
References cache_entries, copy_value, current_cache_size, destroy_value, Halide::Runtime::Internal::djb_hash(), halide_debug_assert, hashmap_malloc, Halide::Runtime::Internal::CacheEntry::in_use_count, Halide::Runtime::Internal::CacheEntry::init(), inited, Halide::Runtime::Internal::keys_equal(), kHashTableSize, least_recently_used, Halide::Runtime::Internal::CacheEntry::less_recent, memoization_lock, Halide::Runtime::Internal::CacheEntry::more_recent, most_recently_used, Halide::Runtime::Internal::CacheEntry::next, prune(), and user_context.
Referenced by Halide::Runtime::Internal::THashMap< KeyType, ValueType >::store().
|
inline |
Definition at line 364 of file hashmap.h.
References halide_debug_assert, and user_context.
|
inline |
Definition at line 371 of file hashmap.h.
References cache_entries, current_cache_size, Halide::Runtime::Internal::CacheEntry::destroy(), destroy_value, hashmap_free, least_recently_used, most_recently_used, Halide::Runtime::Internal::CacheEntry::next, and user_context.
halide_mutex Halide::Runtime::Internal::HashMap::memoization_lock |
|
static |
CacheEntry* Halide::Runtime::Internal::HashMap::cache_entries[kHashTableSize] |
CacheEntry* Halide::Runtime::Internal::HashMap::most_recently_used |
CacheEntry* Halide::Runtime::Internal::HashMap::least_recently_used |
uint64_t Halide::Runtime::Internal::HashMap::kDefaultCacheSize |
Definition at line 130 of file hashmap.h.
Referenced by init(), and set_size().
int64_t Halide::Runtime::Internal::HashMap::max_cache_size |
Definition at line 131 of file hashmap.h.
Referenced by init(), prune(), and set_size().
int64_t Halide::Runtime::Internal::HashMap::current_cache_size |
copy_value_func Halide::Runtime::Internal::HashMap::copy_value |
destroy_value_func Halide::Runtime::Internal::HashMap::destroy_value |
void* Halide::Runtime::Internal::HashMap::user_context |
Definition at line 137 of file hashmap.h.
Referenced by cleanup(), init(), Halide::Runtime::Internal::THashMap< KeyType, ValueType >::init(), lookup(), Halide::Runtime::Internal::THashMap< KeyType, ValueType >::lookup(), prune(), release(), store(), and Halide::Runtime::Internal::THashMap< KeyType, ValueType >::store().
bool Halide::Runtime::Internal::HashMap::inited |