SWDEV-325379 - Fix for remote copy crash
Change-Id: I22152c0b3538cf7cfc80f82505bc255c01d98f7b
Αυτή η υποβολή περιλαμβάνεται σε:
υποβλήθηκε από
Sarbojit Sarkar
γονέας
73ec7bada6
υποβολή
356e22f910
@@ -487,7 +487,8 @@ bool OneMemoryArgCommand::validatePeerMemory() {
|
|||||||
// extra memory objects.
|
// extra memory objects.
|
||||||
if (queue_device->settings().rocr_backend_) {
|
if (queue_device->settings().rocr_backend_) {
|
||||||
const std::vector<Device*>& srcDevices = memory_->getContext().devices();
|
const std::vector<Device*>& srcDevices = memory_->getContext().devices();
|
||||||
if (srcDevices.size() == 1 && queue_device != srcDevices[0]) {
|
if (!memory_->isArena() &&
|
||||||
|
srcDevices.size() == 1 && queue_device != srcDevices[0]) {
|
||||||
// current device and source device are not same hence
|
// current device and source device are not same hence
|
||||||
// explicit allow access is needed for P2P access
|
// explicit allow access is needed for P2P access
|
||||||
device::Memory* mem = memory_->getDeviceMemory(*srcDevices[0]);
|
device::Memory* mem = memory_->getDeviceMemory(*srcDevices[0]);
|
||||||
@@ -533,14 +534,16 @@ bool TwoMemoryArgsCommand::validatePeerMemory(){
|
|||||||
const std::vector<Device*>& dstDevices = memory2_->getContext().devices();
|
const std::vector<Device*>& dstDevices = memory2_->getContext().devices();
|
||||||
// explicit allow access is needed for P2P access
|
// explicit allow access is needed for P2P access
|
||||||
device::Memory* mem1 = memory1_->getDeviceMemory(*srcDevices[0]);
|
device::Memory* mem1 = memory1_->getDeviceMemory(*srcDevices[0]);
|
||||||
if (!mem1->getAllowedPeerAccess() && srcDevices.size() == 1) {
|
if (!memory1_->isArena() &&
|
||||||
|
!mem1->getAllowedPeerAccess() && srcDevices.size() == 1) {
|
||||||
void* src = reinterpret_cast<void*>(mem1->originalDeviceAddress());
|
void* src = reinterpret_cast<void*>(mem1->originalDeviceAddress());
|
||||||
accessAllowed = srcDevices[0]->deviceAllowAccess(src);
|
accessAllowed = srcDevices[0]->deviceAllowAccess(src);
|
||||||
mem1->setAllowedPeerAccess(true);
|
mem1->setAllowedPeerAccess(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
device::Memory* mem2 = memory2_->getDeviceMemory(*dstDevices[0]);
|
device::Memory* mem2 = memory2_->getDeviceMemory(*dstDevices[0]);
|
||||||
if (!mem2->getAllowedPeerAccess() && dstDevices.size() == 1) {
|
if (!memory2_->isArena() &&
|
||||||
|
!mem2->getAllowedPeerAccess() && dstDevices.size() == 1) {
|
||||||
void* dst = reinterpret_cast<void*>(mem2->originalDeviceAddress());
|
void* dst = reinterpret_cast<void*>(mem2->originalDeviceAddress());
|
||||||
accessAllowed &= dstDevices[0]->deviceAllowAccess(dst);
|
accessAllowed &= dstDevices[0]->deviceAllowAccess(dst);
|
||||||
mem2->setAllowedPeerAccess(true);
|
mem2->setAllowedPeerAccess(true);
|
||||||
|
|||||||
@@ -377,6 +377,8 @@ class Memory : public amd::RuntimeObject {
|
|||||||
//!save the user data during memory allocation
|
//!save the user data during memory allocation
|
||||||
UserData& getUserData() { return userData_; }
|
UserData& getUserData() { return userData_; }
|
||||||
|
|
||||||
|
//!find if memory object is Arena memory
|
||||||
|
virtual bool isArena() { return false; }
|
||||||
};
|
};
|
||||||
|
|
||||||
//! Buffers are a specialization of memory. Just a wrapper, really,
|
//! Buffers are a specialization of memory. Just a wrapper, really,
|
||||||
@@ -673,6 +675,7 @@ public:
|
|||||||
ArenaMemory(Context& context)
|
ArenaMemory(Context& context)
|
||||||
: Buffer(context, 0, std::numeric_limits<size_t>::max(),
|
: Buffer(context, 0, std::numeric_limits<size_t>::max(),
|
||||||
reinterpret_cast<void*>(kArenaMemoryPtr)) {}
|
reinterpret_cast<void*>(kArenaMemoryPtr)) {}
|
||||||
|
bool isArena() { return true; }
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace amd
|
} // namespace amd
|
||||||
|
|||||||
Αναφορά σε νέο ζήτημα
Block a user