SWDEV-412393 - Force alloc memory to avoid another hsa image creation.

Change-Id: Ia3cd99eb736231e6dfe013ebae6c41fd4cc657bc
This commit is contained in:
Jaydeep Patel
2023-08-17 05:18:07 +00:00
parent d6dc82b220
commit 289535e805
3 ha cambiato i file con 12 aggiunte e 9 eliminazioni
+3 -2
Vedi File
@@ -1195,7 +1195,8 @@ bool Image::Format::isSupported(const Context& context, cl_mem_object_type image
// ================================================================================================
Image* Image::createView(const Context& context, const Format& format, device::VirtualDevice* vDev,
uint baseMipLevel, cl_mem_flags flags, bool createMipmapView) {
uint baseMipLevel, cl_mem_flags flags, bool createMipmapView,
bool forceAlloc) {
// Find the image dimensions and create a corresponding object
Image* view = new (context) Image(format, *this, baseMipLevel, flags, createMipmapView);
@@ -1210,7 +1211,7 @@ Image* Image::createView(const Context& context, const Format& format, device::V
view->initDeviceMemory();
// Check if runtime has to allocate memory
if ((context.devices().size() == 1) || DISABLE_DEFERRED_ALLOC) {
if ((context.devices().size() == 1) || DISABLE_DEFERRED_ALLOC || forceAlloc) {
for (uint i = 0; i < numDevices_; ++i) {
// Make sure the parent's device memory is avaialbe
if ((deviceMemories_[i].ref_ != nullptr) &&