diff --git a/rocclr/runtime/device/gpu/gpuresource.cpp b/rocclr/runtime/device/gpu/gpuresource.cpp index 851ab90a35..a1e5db9988 100644 --- a/rocclr/runtime/device/gpu/gpuresource.cpp +++ b/rocclr/runtime/device/gpu/gpuresource.cpp @@ -356,6 +356,16 @@ Resource::create(MemoryType memType, CreateParams* params, bool heap) desc.section = GSL_SECTION_SVM_ATOMICS; } } + + if (memType == Shader){ + if(dev().settings().svmFineGrainSystem_) { + desc.isAllocExecute = true; + } + // force to use remote memory for HW DEBUG or use + // local memory once we determine if FGS is supported + memType = (!dev().settings().enableHwDebug_) ? Local : RemoteUSWC; + } + // This is a thread safe operation const_cast(dev()).initializeHeapResources(); @@ -438,15 +448,6 @@ Resource::create(MemoryType memType, CreateParams* params, bool heap) else if (memoryType() == RemoteUSWC) { desc.type = GSL_MOA_MEMORY_AGP; } - else if (memoryType() == Shader){ - if(dev().settings().svmFineGrainSystem_) { - desc.isAllocExecute = true; - } - // force to use remote memory for HW DEBUG or use - // local memory once we determine if FGS is supported - memType = (!dev().settings().enableHwDebug_) ? Local : RemoteUSWC; - cal_.type_ = memType; - } else if (memoryType() == BusAddressable){ desc.type = GSL_MOA_MEMORY_CARD_BUS_ADDRESSABLE; }