SWDEV-334233 - add support for p2p in windows

Signed-off-by: sdashmiz <shadi.dashmiz@amd.com>
Change-Id: I9109120b5444c400e65cfff869cb36e876ffd1fc


[ROCm/clr commit: e176e27bf7]
이 커밋은 다음에 포함됨:
sdashmiz 작성하고 Shadi Dashmiz가 2022-07-14 15:07:33 -04:00를 커밋함
1 부모 f69b6922bb
커밋 3389e6077a
6 파일이 변경됨
+41 -50

검색과 일치하는 파일 없음

+27
파일 보기
@@ -85,6 +85,7 @@ bool VirtualDevice::ActiveWait() const {
namespace amd {
amd::Monitor Device::lockP2P_("Lock P2P ON/OFF");
std::pair<const Isa*, const Isa*> Isa::supportedIsas() {
constexpr amd::Isa::Feature NONE = amd::Isa::Feature::Unsupported;
constexpr amd::Isa::Feature ANY = amd::Isa::Feature::Any;
@@ -709,6 +710,32 @@ bool Device::getDeviceIDs(cl_device_type deviceType, uint32_t numEntries, cl_dev
return true;
}
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::UpdateStackSize(uint64_t stackSize) {
uint32_t maxMemPerThread = info().localMemSizePerCU_ / info().maxThreadsPerCU_;
if (maxMemPerThread < stackSize) {