diff --git a/projects/clr/rocclr/device/device.hpp b/projects/clr/rocclr/device/device.hpp index b762098fe1..f0cd5cd284 100755 --- a/projects/clr/rocclr/device/device.hpp +++ b/projects/clr/rocclr/device/device.hpp @@ -581,7 +581,8 @@ class Settings : public amd::HeapObject { uint enableCoopGroups_ : 1; //!< Enable cooperative groups feature uint enableCoopMultiDeviceGroups_ : 1; //!< Enable cooperative groups multi device uint fenceScopeAgent_ : 1; //!< Enable fence scope agent in AQL dispatch packet - uint reserved_ : 11; + uint rocr_backend_ : 1; //!< Device uses ROCr backend for submissions + uint reserved_ : 10; }; uint value_; }; diff --git a/projects/clr/rocclr/device/rocm/rocsettings.cpp b/projects/clr/rocclr/device/rocm/rocsettings.cpp index 2dec296390..05c527a205 100644 --- a/projects/clr/rocclr/device/rocm/rocsettings.cpp +++ b/projects/clr/rocclr/device/rocm/rocsettings.cpp @@ -89,6 +89,8 @@ Settings::Settings() { hmmFlags_ = (!flagIsDefault(ROC_HMM_FLAGS)) ? ROC_HMM_FLAGS : Hmm::EnableSystemMemory | Hmm::EnableMallocPrefetch; + + rocr_backend_ = true; } bool Settings::create(bool fullProfile, int gfxipMajor, int gfxipMinor, bool coop_groups) { diff --git a/projects/clr/rocclr/platform/command.cpp b/projects/clr/rocclr/platform/command.cpp index 1f48a0e57a..3b7d3ab2a3 100644 --- a/projects/clr/rocclr/platform/command.cpp +++ b/projects/clr/rocclr/platform/command.cpp @@ -590,6 +590,13 @@ bool TransferBufferFileCommand::validateMemory() { } bool CopyMemoryP2PCommand::validateMemory() { + amd::Device* queue_device = &queue()->device(); + // Rocr backend maps memory from different devices by default and runtime doesn't need to track + // extra memory objects. Also P2P staging buffer always allocated + if (queue_device->settings().rocr_backend_) { + return true; + } + const std::vector& devices = memory1_->getContext().devices(); if (devices.size() != 1) { LogError("Can't allocate memory object for P2P extension"); @@ -614,11 +621,7 @@ bool CopyMemoryP2PCommand::validateMemory() { // Validate P2P memories on the current device, if any of them is null, then it's p2p staging if ((nullptr == memory1_->getDeviceMemory(queue()->device())) || (nullptr == memory2_->getDeviceMemory(queue()->device()))) { - // HIP doesn't support emulation - p2pStaging = !amd::IS_HIP; - if (!p2pStaging) { - return false; - } + p2pStaging = true; } if (devices[0]->P2PStage() != nullptr && p2pStaging) {