|
17 | 17 | #include <algorithm>
|
18 | 18 | #include <mutex> // NOLINT
|
19 | 19 | #include "paddle/fluid/memory/allocation/aligned_allocator.h"
|
20 |
| - |
21 |
| -DEFINE_bool(free_idle_chunk, false, |
22 |
| - "Whether to free idle chunk when each allocation is freed. " |
23 |
| - "If false, all freed allocation would be cached to speed up next " |
24 |
| - "allocation request. If true, no allocation would be cached. This " |
25 |
| - "flag only works when FLAGS_allocator_strategy=auto_growth."); |
26 |
| - |
27 |
| -DEFINE_bool(free_when_no_cache_hit, false, |
28 |
| - "Whether to free idle chunks when no cache hit. If true, idle " |
29 |
| - "chunk would be freed when no cache hit; if false, idle " |
30 |
| - "chunk would be freed when out of memory occurs. This flag " |
31 |
| - "only works when FLAGS_allocator_strategy=auto_growth."); |
| 20 | +#include "paddle/fluid/platform/flags.h" |
| 21 | + |
| 22 | +PADDLE_DEFINE_EXPORTED_READONLY_bool( |
| 23 | + free_idle_chunk, false, |
| 24 | + "Whether to free idle chunk when each allocation is freed. " |
| 25 | + "If false, all freed allocation would be cached to speed up next " |
| 26 | + "allocation request. If true, no allocation would be cached. This " |
| 27 | + "flag only works when FLAGS_allocator_strategy=auto_growth."); |
| 28 | + |
| 29 | +PADDLE_DEFINE_EXPORTED_READONLY_bool( |
| 30 | + free_when_no_cache_hit, false, |
| 31 | + "Whether to free idle chunks when no cache hit. If true, idle " |
| 32 | + "chunk would be freed when no cache hit; if false, idle " |
| 33 | + "chunk would be freed when out of memory occurs. This flag " |
| 34 | + "only works when FLAGS_allocator_strategy=auto_growth."); |
32 | 35 |
|
33 | 36 | namespace paddle {
|
34 | 37 | namespace memory {
|
|
0 commit comments