mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 09:14:47 +08:00
performance: limit usm host allocation recycle
Query system total memory size and limit usm host allocation recycle to use at most x%. x is read from ExperimentalEnableDeviceAllocationCache for device and ExperimentalEnableHostAllocationCache for host. Related-To: GSD-7497 Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
87990b8cfc
commit
371788210d
@@ -153,11 +153,13 @@ class SVMAllocsManager {
|
||||
};
|
||||
|
||||
struct SvmAllocationCache {
|
||||
void insert(size_t size, void *);
|
||||
bool insert(size_t size, void *);
|
||||
void *get(size_t size, const UnifiedMemoryProperties &unifiedMemoryProperties, SVMAllocsManager *svmAllocsManager);
|
||||
void trim(SVMAllocsManager *svmAllocsManager);
|
||||
std::vector<SvmCacheAllocationInfo> allocations;
|
||||
std::mutex mtx;
|
||||
size_t maxSize = 0;
|
||||
size_t totalSize = 0;
|
||||
};
|
||||
|
||||
enum class FreePolicyType : uint32_t {
|
||||
@@ -234,6 +236,8 @@ class SVMAllocsManager {
|
||||
using NonGpuDomainAllocsContainer = std::vector<void *>;
|
||||
NonGpuDomainAllocsContainer nonGpuDomainAllocs;
|
||||
|
||||
void initUsmAllocationsCaches(Device &device);
|
||||
|
||||
protected:
|
||||
void *createZeroCopySvmAllocation(size_t size, const SvmAllocationProperties &svmProperties,
|
||||
const RootDeviceIndicesContainer &rootDeviceIndices,
|
||||
@@ -242,7 +246,7 @@ class SVMAllocsManager {
|
||||
|
||||
void freeZeroCopySvmAllocation(SvmAllocationData *svmData);
|
||||
|
||||
void initUsmDeviceAllocationsCache();
|
||||
void initUsmDeviceAllocationsCache(Device &device);
|
||||
void initUsmHostAllocationsCache();
|
||||
void freeSVMData(SvmAllocationData *svmData);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user