P2PStating buffer allocation when P2P is not enabled between all GPUs

SWDEV-232580 & SWDEV-232580
Allocate p2p statging buffer when full P2P access is not available between all devices.
p2p staging buffer will eventually be used when required.

Change-Id: If8490ba7b1c52c432c1e942ae95421b9d2ec7097
This commit is contained in:
agodavar
2020-04-24 06:12:11 -04:00
committed by Anusha Godavarthy Surya
parent 27bfd2a3ee
commit f149fe0803
+1 -1
View File
@@ -734,7 +734,7 @@ bool Device::create(bool sramEccEnabled) {
return false;
}
if ((p2p_agents_.size() == 0) && (devices.size() > 1)) {
if ((p2p_agents_.size() < (devices.size()-1)) && (devices.size() > 1)) {
amd::Buffer* buf = new (GlbCtx()) amd::Buffer(GlbCtx(), CL_MEM_ALLOC_HOST_PTR, kP2PStagingSize);
if ((buf != nullptr) && buf->create()) {
p2p_stage_ = buf;