Insert zero sized pool on CPU agents without attached memory.
Ensures that all CPU agents will have a pool handle to allocate system memory. These pools will have no numa binding since the node their owning Agent represents has no installed memory. Change-Id: I9f72b455d633646839753c6719ff7f6a4c41f7c4
Этот коммит содержится в:
@@ -71,14 +71,12 @@ void CpuAgent::InitRegionList() {
|
||||
hsaKmtGetNodeMemoryProperties(node_id(), properties_.NumMemoryBanks,
|
||||
&mem_props[0])) {
|
||||
std::vector<HsaMemoryProperties>::iterator system_prop =
|
||||
std::find_if(mem_props.begin(), mem_props.end(),
|
||||
[](HsaMemoryProperties prop) -> bool {
|
||||
std::find_if(mem_props.begin(), mem_props.end(), [](HsaMemoryProperties prop) -> bool {
|
||||
return (prop.SizeInBytes > 0 && prop.HeapType == HSA_HEAPTYPE_SYSTEM);
|
||||
});
|
||||
|
||||
if (system_prop != mem_props.end()) {
|
||||
MemoryRegion* system_region_fine =
|
||||
new MemoryRegion(true, is_apu_node, this, *system_prop);
|
||||
MemoryRegion* system_region_fine = new MemoryRegion(true, is_apu_node, this, *system_prop);
|
||||
|
||||
regions_.push_back(system_region_fine);
|
||||
|
||||
@@ -92,18 +90,18 @@ void CpuAgent::InitRegionList() {
|
||||
HsaMemoryProperties system_props;
|
||||
std::memset(&system_props, 0, sizeof(HsaMemoryProperties));
|
||||
|
||||
const uintptr_t system_base = os::GetUserModeVirtualMemoryBase();
|
||||
const size_t system_physical_size = os::GetUsablePhysicalHostMemorySize();
|
||||
assert(system_physical_size != 0);
|
||||
|
||||
system_props.HeapType = HSA_HEAPTYPE_SYSTEM;
|
||||
system_props.SizeInBytes = (HSAuint64)system_physical_size;
|
||||
system_props.VirtualBaseAddress = (HSAuint64)(system_base);
|
||||
system_props.SizeInBytes = 0;
|
||||
system_props.VirtualBaseAddress = 0;
|
||||
|
||||
MemoryRegion* system_region =
|
||||
new MemoryRegion(true, is_apu_node, this, system_props);
|
||||
MemoryRegion* system_region_fine = new MemoryRegion(true, is_apu_node, this, system_props);
|
||||
regions_.push_back(system_region_fine);
|
||||
|
||||
regions_.push_back(system_region);
|
||||
if (!is_apu_node) {
|
||||
MemoryRegion* system_region_coarse =
|
||||
new MemoryRegion(false, is_apu_node, this, system_props);
|
||||
regions_.push_back(system_region_coarse);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user