SWDEV-333438 - Fix for hipEnablePeerAccess segfault

Change-Id: I60720d1d9b9c522d15fe17dcfbc609571a4fd266
Этот коммит содержится в:
Sarbojit Sarkar authored and Sarbojit Sarkar committed 2022-04-26 05:21:52 -04:00
1 родитель 8cffe6d427
Коммит 6b15e0a1cc
2 files changed
+4 -2

No files matched your search

+3 -2
Просмотреть файл
@@ -106,6 +106,7 @@ std::vector<hsa_agent_t> roc::Device::gpu_agents_;
std::vector<AgentInfo> roc::Device::cpu_agents_;
address Device::mg_sync_ = nullptr;
amd::Monitor Device::lockP2P_("Lock P2P ON/OFF");
bool NullDevice::create(const amd::Isa &isa) {
if (!isa.runtimeRocSupported()) {
@@ -2016,7 +2017,7 @@ void Device::hostFree(void* ptr, size_t size) const { memFree(ptr, size); }
bool Device::enableP2P(amd::Device* ptrDev) {
assert(ptrDev != nullptr);
amd::ScopedLock lock(lockP2P_);
Device* peerDev = static_cast<Device*>(ptrDev);
if (std::find(enabled_p2p_devices_.begin(), enabled_p2p_devices_.end(), peerDev) ==
enabled_p2p_devices_.end()) {
@@ -2029,7 +2030,7 @@ bool Device::enableP2P(amd::Device* ptrDev) {
bool Device::disableP2P(amd::Device* ptrDev) {
assert(ptrDev != nullptr);
amd::ScopedLock lock(lockP2P_);
Device* peerDev = static_cast<Device*>(ptrDev);
//if device is present then remove
auto it = std::find(enabled_p2p_devices_.begin(), enabled_p2p_devices_.end(), peerDev);