Add debug flag to override zeDeviceCanAccessPeer return value.

Signed-off-by: Michal Mrozek <michal.mrozek@intel.com>
This commit is contained in:
Michal Mrozek
2022-10-20 12:56:29 +00:00
committed by Compute-Runtime-Automation
parent 22dbae1771
commit 3384b2fed0
4 changed files with 24 additions and 1 deletions

View File

@@ -72,6 +72,11 @@ ze_result_t DeviceImp::canAccessPeer(ze_device_handle_t hPeerDevice, ze_bool_t *
DeviceImp *pPeerDevice = static_cast<DeviceImp *>(Device::fromHandle(hPeerDevice));
uint32_t peerRootDeviceIndex = pPeerDevice->getNEODevice()->getRootDeviceIndex();
if (NEO::DebugManager.flags.ForceZeDeviceCanAccessPerReturnValue.get() != -1) {
*value = !!NEO::DebugManager.flags.ForceZeDeviceCanAccessPerReturnValue.get();
return ZE_RESULT_SUCCESS;
}
if (this->crossAccessEnabledDevices.find(peerRootDeviceIndex) != this->crossAccessEnabledDevices.end()) {
*value = this->crossAccessEnabledDevices[peerRootDeviceIndex];
} else if (this->getNEODevice()->getRootDeviceIndex() == peerRootDeviceIndex) {