Add env key to disable 2MB suballocation.

Change-Id: Icca3041c3578aa180a656c01aae62f2ad6e8b583


[ROCm/ROCR-Runtime commit: 4275661682]
Αυτή η υποβολή περιλαμβάνεται σε:
Sean Keely
2017-09-13 06:35:05 -05:00
γονέας 9fd778eec1
υποβολή 3aeea948cb
2 αρχεία άλλαξαν με 10 προσθήκες και 3 διαγραφές
@@ -171,7 +171,8 @@ hsa_status_t MemoryRegion::Allocate(size_t size, AllocateFlags alloc_flags,
(alloc_flags & AllocateDoubleMap ? 1 : 0);
// Only allow using the suballocator for ordinary VRAM.
bool useSubAlloc = IsLocalMemory();
bool useSubAlloc = !core::Runtime::runtime_singleton_->flag().disable_fragment_alloc();
useSubAlloc &= IsLocalMemory();
useSubAlloc &= (alloc_flags == AllocateRestrict);
useSubAlloc &= (size <= fragment_allocator_.max_alloc());
if (useSubAlloc) {
@@ -88,6 +88,9 @@ class Flag {
var = os::GetEnvVar("HSA_TOOLS_REPORT_LOAD_FAILURE");
report_tool_load_failures_ = (var == "0") ? false : true;
var = os::GetEnvVar("HSA_DISABLE_FRAGMENT_ALLOCATOR");
disable_fragment_alloc_ = (var == "1") ? true : false;
}
bool check_flat_scratch() const { return check_flat_scratch_; }
@@ -104,14 +107,16 @@ class Flag {
bool sdma_wait_idle() const { return sdma_wait_idle_; }
bool report_tool_load_failures() const { return report_tool_load_failures_; }
bool disable_fragment_alloc() const { return disable_fragment_alloc_; }
uint32_t max_queues() const { return max_queues_; }
size_t scratch_mem_size() const { return scratch_mem_size_; }
std::string tools_lib_names() const { return tools_lib_names_; }
bool report_tool_load_failures() const { return report_tool_load_failures_; }
private:
bool check_flat_scratch_;
bool enable_vm_fault_message_;
@@ -121,6 +126,7 @@ class Flag {
bool sdma_wait_idle_;
bool enable_queue_fault_message_;
bool report_tool_load_failures_;
bool disable_fragment_alloc_;
uint32_t max_queues_;