Skip to content

Commit e22c9b4

Browse files
authored
SWDEV-576718 - provide option to limit memory cache usage (#2810)
* SWDEV-576718 - provide option to limit memory cache usage * SWDEV-576718 - Use MiB instead of MB in description
1 parent 265d0a2 commit e22c9b4

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

projects/clr/rocclr/device/pal/palsettings.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,9 @@ bool Settings::create(const Pal::DeviceProperties& palProp,
347347
#endif
348348
}
349349

350+
resourceCacheSize_ = std::min(resourceCacheSize_,
351+
(uint64_t)GPU_MAX_RESOURCE_CACHE_SIZE * Mi);
352+
350353
// If is Rebar, override prepinned memory size.
351354
if ((heaps[Pal::GpuHeapInvisible].logicalSize == 0) &&
352355
(heaps[Pal::GpuHeapLocal].logicalSize > 256 * Mi)) {

projects/clr/rocclr/utils/flags.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ release(size_t, GPU_PINNED_XFER_SIZE, 32, \
8383
release(size_t, GPU_PINNED_MIN_XFER_SIZE, 128, \
8484
"The minimal buffer size for pinned read/write transfers in MiB") \
8585
release(size_t, GPU_RESOURCE_CACHE_SIZE, 64, \
86-
"The resource cache size in MB") \
86+
"The resource cache size in MiB") \
87+
release(size_t, GPU_MAX_RESOURCE_CACHE_SIZE, 16777216, \
88+
"The max resource cache size in MiB") \
8789
release(size_t, GPU_MAX_SUBALLOC_SIZE, 4096, \
8890
"The maximum size accepted for suballocations in KB") \
8991
release(size_t, GPU_NUM_MEM_DEPENDENCY, 256, \

0 commit comments

Comments
 (0)