Halide
Halide::Runtime::Internal::HashMap Struct Reference

#include <hashmap.h>

Inherited by Halide::Runtime::Internal::THashMap< KeyType, ValueType >.

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 ()
 

Public Attributes

halide_mutex memoization_lock
 
CacheEntrycache_entries [kHashTableSize]
 
CacheEntrymost_recently_used
 
CacheEntryleast_recently_used
 
uint64_t kDefaultCacheSize
 
int64_t max_cache_size
 
int64_t current_cache_size
 
copy_value_func copy_value
 
destroy_value_func destroy_value
 
void * user_context
 
bool inited
 

Static Public Attributes

static const size_t kHashTableSize = 256
 

Detailed Description

Definition at line 120 of file hashmap.h.

Member Function Documentation

◆ init()

bool Halide::Runtime::Internal::HashMap::init ( void *  user_context,
copy_value_func  copy_value,
destroy_value_func  destroy_value 
)
inline

◆ prune()

◆ set_size()

void Halide::Runtime::Internal::HashMap::set_size ( int64_t  size)
inline

Definition at line 226 of file hashmap.h.

References kDefaultCacheSize, max_cache_size, memoization_lock, and prune().

◆ lookup()

int Halide::Runtime::Internal::HashMap::lookup ( void *  user_context,
const uint8_t cache_key,
int32_t  size,
uint8_t cache_value,
size_t  cache_value_size 
)
inline

◆ store()

void Halide::Runtime::Internal::HashMap::store ( void *  user_context,
const uint8_t cache_key,
int32_t  size,
const uint8_t cache_value,
size_t  cache_value_size 
)
inline

◆ release()

void Halide::Runtime::Internal::HashMap::release ( void *  user_context,
void *  host 
)
inline

Definition at line 364 of file hashmap.h.

◆ cleanup()

Member Data Documentation

◆ memoization_lock

halide_mutex Halide::Runtime::Internal::HashMap::memoization_lock

Definition at line 121 of file hashmap.h.

Referenced by set_size().

◆ kHashTableSize

const size_t Halide::Runtime::Internal::HashMap::kHashTableSize = 256
static

Definition at line 123 of file hashmap.h.

Referenced by prune().

◆ cache_entries

CacheEntry* Halide::Runtime::Internal::HashMap::cache_entries[kHashTableSize]

Definition at line 125 of file hashmap.h.

Referenced by cleanup(), and prune().

◆ most_recently_used

CacheEntry* Halide::Runtime::Internal::HashMap::most_recently_used

Definition at line 127 of file hashmap.h.

Referenced by cleanup(), and prune().

◆ least_recently_used

CacheEntry* Halide::Runtime::Internal::HashMap::least_recently_used

Definition at line 128 of file hashmap.h.

Referenced by cleanup(), and prune().

◆ kDefaultCacheSize

uint64_t Halide::Runtime::Internal::HashMap::kDefaultCacheSize

Definition at line 130 of file hashmap.h.

Referenced by set_size().

◆ max_cache_size

int64_t Halide::Runtime::Internal::HashMap::max_cache_size

Definition at line 131 of file hashmap.h.

Referenced by prune(), and set_size().

◆ current_cache_size

int64_t Halide::Runtime::Internal::HashMap::current_cache_size

Definition at line 132 of file hashmap.h.

Referenced by cleanup(), and prune().

◆ copy_value

copy_value_func Halide::Runtime::Internal::HashMap::copy_value

Definition at line 134 of file hashmap.h.

◆ destroy_value

destroy_value_func Halide::Runtime::Internal::HashMap::destroy_value

Definition at line 135 of file hashmap.h.

Referenced by cleanup(), and prune().

◆ user_context

◆ inited

bool Halide::Runtime::Internal::HashMap::inited

Definition at line 139 of file hashmap.h.


The documentation for this struct was generated from the following file: