From f149fe08037f97111da4008375ce948a1bd2f3a7 Mon Sep 17 00:00:00 2001 From: agodavar Date: Fri, 24 Apr 2020 06:12:11 -0400 Subject: [PATCH] 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 --- rocclr/device/rocm/rocdevice.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rocclr/device/rocm/rocdevice.cpp b/rocclr/device/rocm/rocdevice.cpp index a6099dbf58..3726410927 100755 --- a/rocclr/device/rocm/rocdevice.cpp +++ b/rocclr/device/rocm/rocdevice.cpp @@ -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;