SWDEV-381633 - Use blit manager on app's queue

Heap initialization used device queue, but it shoudl be used for
cooperative launches only. Heap initialization must use the same queue
as the current dispatch.

Change-Id: I856621bf82bbdeb1c2d0fbc4970e90d09af805cb


[ROCm/clr commit: 67af16bdf3]
This commit is contained in:
German Andryeyev
2023-02-08 17:55:08 -05:00
والد 50307ab94c
کامیت b180effdb6
6فایلهای تغییر یافته به همراه10 افزوده شده و 10 حذف شده
@@ -2356,8 +2356,8 @@ void Device::ReleaseExclusiveGpuAccess(VirtualGPU& vgpu) const {
}
// ================================================================================================
void Device::HiddenHeapAlloc() {
auto HeapAlloc = [this]() -> bool {
void Device::HiddenHeapAlloc(const VirtualGPU& gpu) {
auto HeapAlloc = [this, &gpu]() -> bool {
// Allocate initial heap for device memory allocator
static constexpr size_t HeapBufferSize = 128 * Ki;
heap_buffer_ = createMemory(HeapBufferSize);
@@ -2369,7 +2369,7 @@ void Device::HiddenHeapAlloc() {
LogError("Heap buffer allocation failed!");
return false;
}
bool result = static_cast<const KernelBlitManager&>(xferMgr()).initHeap(
bool result = static_cast<const KernelBlitManager&>(gpu.blitMgr()).initHeap(
heap_buffer_, initial_heap_buffer_, HeapBufferSize, initial_heap_size_ / (2 * Mi));
return result;
@@ -629,7 +629,7 @@ class Device : public NullDevice {
#endif
#endif
//! Allocates hidden heap for device memory allocations
void HiddenHeapAlloc();
void HiddenHeapAlloc(const VirtualGPU& gpu);
private:
static void PAL_STDCALL PalDeveloperCallback(void* pPrivateData, const Pal::uint32 deviceIndex,
@@ -362,7 +362,7 @@ hsa_kernel_dispatch_packet_t* HSAILKernel::loadArguments(VirtualGPU& gpu, const
case amd::KernelParameterDescriptor::HiddenHeap:
// Allocate hidden heap for HIP applications only
if ((amd::IS_HIP) && (palDevice().HeapBuffer() == nullptr)) {
const_cast<Device&>(palDevice()).HiddenHeapAlloc();
const_cast<Device&>(palDevice()).HiddenHeapAlloc(gpu);
}
if (palDevice().HeapBuffer() != nullptr) {
// Add heap pointer to the code
@@ -3243,8 +3243,8 @@ bool Device::IsValidAllocation(const void* dev_ptr, size_t size) const {
}
// ================================================================================================
void Device::HiddenHeapAlloc() {
auto HeapAllocZeroOut = [this]() -> bool {
void Device::HiddenHeapAlloc(const VirtualGPU& gpu) {
auto HeapAllocZeroOut = [this, &gpu]() -> bool {
// Allocate initial heap for device memory allocator
static constexpr size_t HeapBufferSize = 128 * Ki;
heap_buffer_ = createMemory(HeapBufferSize);
@@ -3256,7 +3256,7 @@ void Device::HiddenHeapAlloc() {
LogError("Heap buffer allocation failed!");
return false;
}
bool result = static_cast<const KernelBlitManager&>(xferMgr()).initHeap(
bool result = static_cast<const KernelBlitManager&>(gpu.blitMgr()).initHeap(
heap_buffer_, initial_heap_buffer_, HeapBufferSize, initial_heap_size_ / (2 * Mi));
return result;
@@ -547,7 +547,7 @@ class Device : public NullDevice {
bool IsValidAllocation(const void* dev_ptr, size_t size) const;
//! Allocates hidden heap for device memory allocations
void HiddenHeapAlloc();
void HiddenHeapAlloc(const VirtualGPU& gpu);
private:
bool create();
@@ -2958,7 +2958,7 @@ bool VirtualGPU::submitKernelInternal(const amd::NDRangeContainer& sizes,
case amd::KernelParameterDescriptor::HiddenHeap:
// Allocate hidden heap for HIP applications only
if ((amd::IS_HIP) && (dev().HeapBuffer() == nullptr)) {
const_cast<Device&>(dev()).HiddenHeapAlloc();
const_cast<Device&>(dev()).HiddenHeapAlloc(*this);
}
if (dev().HeapBuffer() != nullptr) {
// Add heap pointer to the code