SWDEV-334233 - add support for p2p in windows
Signed-off-by: sdashmiz <shadi.dashmiz@amd.com> Change-Id: I9109120b5444c400e65cfff869cb36e876ffd1fc
Αυτή η υποβολή περιλαμβάνεται σε:
υποβλήθηκε από
Shadi Dashmiz
γονέας
782e0f2a8d
υποβολή
e176e27bf7
@@ -106,7 +106,6 @@ 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()) {
|
||||
@@ -2020,31 +2019,6 @@ void* Device::hostNumaAlloc(size_t size, size_t alignment, bool atomics) const {
|
||||
|
||||
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()) {
|
||||
enabled_p2p_devices_.push_back(peerDev);
|
||||
// Update access to all old allocations
|
||||
amd::MemObjMap::UpdateAccess(static_cast<amd::Device*>(this));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
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);
|
||||
if (it != enabled_p2p_devices_.end()) {
|
||||
enabled_p2p_devices_.erase(it);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Device::deviceAllowAccess(void* ptr) const {
|
||||
std::lock_guard<std::mutex> lock(lock_allow_access_);
|
||||
if (!p2pAgents().empty()) {
|
||||
|
||||
Αναφορά σε νέο ζήτημα
Block a user