SWDEV-336024 - Clear device heap to 0 in ROCr path

Change-Id: Id100ca6d6d5bd7fb16ca8c98ff0b12c9df1d69ab
This commit is contained in:
German Andryeyev
2022-05-19 09:24:47 -04:00
parent 4aee5e21fb
commit 830898753d
2 changed files with 18 additions and 2 deletions
+7 -1
View File
@@ -1087,6 +1087,7 @@ void PAL_STDCALL Device::PalDeveloperCallback(void* pPrivateData, const Pal::uin
#endif // PAL_GPUOPEN_OCL
}
// ================================================================================================
bool Device::initializeHeapResources() {
amd::ScopedLock k(lockForInitHeap_);
if (!heapInitComplete_) {
@@ -1154,13 +1155,18 @@ bool Device::initializeHeapResources() {
xferQueue_->enableSyncedBlit();
if (amd::IS_HIP) {
// Allocate initial heap for device memory allocator
static constexpr size_t HeapBufferSize = 1024 * Ki;
static constexpr size_t HeapBufferSize = 128 * Ki;
heap_buffer_ = createMemory(HeapBufferSize);
if (heap_buffer_ == nullptr) {
LogError("Heap buffer allocation failed!");
return false;
}
}
}
return true;
}
// ================================================================================================
device::VirtualDevice* Device::createVirtualDevice(amd::CommandQueue* queue) {
bool profiling = false;
uint rtCUs = amd::CommandQueue::RealTimeDisabled;