Read the detailed description!
General Principle of ROCK Caches:
To avoid re-allocate NUMA or GPU memory in every iteration, the memory buffers are stored in cache structures. The typical signature of a function making use of caches is
Read the detailed description!
Definition crock.h:167
The user defines a pointer to the structure, and invoke the func() with
Notes:
- If call the function with func(..., NULL) i.e. pp_cache == NULL then no cache is assumed (e.g. for a diagnostic step with fewer electrons).
- If ptr_cache == NULL then a new cache will be allocated.
- To release the cached memory for sanitizer checks:
if (ptr_cache) {
ptr_cache->
free(ptr_cache);
ptr_cache = NULL;
}
void(* free)(struct cr_cache *self)
Definition crock.h:168
- Caches require the same dim_* and the same parallelization setup (e.g. number of threads), as they are determining the size of memory.
- Caveat: Do not mix caches for different functions! If there multiple functions need to be cached, one should invoke func_1(..., ptr_cache_1) and func_2(..., ptr_cache_2). Accelerated functions have *_gpu() (using device pointers) and *_offload() (using host pointers) variants, Mixing caches between them is also not supported.