(git:e7e05ae)
dbm_mempool.h
Go to the documentation of this file.
1 /*----------------------------------------------------------------------------*/
2 /* CP2K: A general program to perform molecular dynamics simulations */
3 /* Copyright 2000-2024 CP2K developers group <https://cp2k.org> */
4 /* */
5 /* SPDX-License-Identifier: BSD-3-Clause */
6 /*----------------------------------------------------------------------------*/
7 #ifndef DBM_MEMPOOL_H
8 #define DBM_MEMPOOL_H
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 #include <stdbool.h>
15 
16 /*******************************************************************************
17  * \brief Internal routine for allocating host memory from the pool.
18  * \author Ole Schuett
19  ******************************************************************************/
20 void *dbm_mempool_host_malloc(const size_t size);
21 
22 /*******************************************************************************
23  * \brief Internal routine for allocating device memory from the pool.
24  * \author Ole Schuett
25  ******************************************************************************/
26 void *dbm_mempool_device_malloc(const size_t size);
27 
28 /*******************************************************************************
29  * \brief Internal routine for releasing memory back to the pool.
30  * \author Ole Schuett
31  ******************************************************************************/
32 void dbm_mempool_free(void *memory);
33 
34 /*******************************************************************************
35  * \brief Internal routine for freeing all memory in the pool.
36  * \author Ole Schuett
37  ******************************************************************************/
38 void dbm_mempool_clear(void);
39 
40 #ifdef __cplusplus
41 }
42 #endif
43 
44 #endif
45 
46 // EOF
void * dbm_mempool_device_malloc(const size_t size)
Internal routine for allocating device memory from the pool.
Definition: dbm_mempool.c:149
void dbm_mempool_clear(void)
Internal routine for freeing all memory in the pool.
Definition: dbm_mempool.c:185
void dbm_mempool_free(void *memory)
Internal routine for releasing memory back to the pool.
Definition: dbm_mempool.c:157
void * dbm_mempool_host_malloc(const size_t size)
Internal routine for allocating host memory from the pool.
Definition: dbm_mempool.c:141