fix: correct setting p2p atomics property

p2p atomics flag should be set based on info queried from fabric

Related-To: NEO-14938
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2025-06-17 07:45:52 +00:00
committed by Compute-Runtime-Automation
parent 299c8689da
commit de57a3f3dd
2 changed files with 27 additions and 114 deletions

View File

@@ -667,13 +667,10 @@ ze_result_t DeviceImp::getP2PProperties(ze_device_handle_t hPeerDevice,
canAccessPeer(hPeerDevice, &peerAccessAvaiable);
if (peerAccessAvaiable) {
pP2PProperties->flags = ZE_DEVICE_P2P_PROPERTY_FLAG_ACCESS;
if (this->getNEODevice()->getHardwareInfo().capabilityTable.p2pAtomicAccessSupported &&
peerDevice->getNEODevice()->getHardwareInfo().capabilityTable.p2pAtomicAccessSupported) {
ze_device_p2p_bandwidth_exp_properties_t p2pBandwidthProperties{};
getP2PPropertiesDirectFabricConnection(peerDevice, &p2pBandwidthProperties);
if (std::max(p2pBandwidthProperties.physicalBandwidth, p2pBandwidthProperties.logicalBandwidth) > 0u) {
pP2PProperties->flags |= ZE_DEVICE_P2P_PROPERTY_FLAG_ATOMICS;
}
ze_device_p2p_bandwidth_exp_properties_t p2pBandwidthProperties{};
getP2PPropertiesDirectFabricConnection(peerDevice, &p2pBandwidthProperties);
if (std::max(p2pBandwidthProperties.physicalBandwidth, p2pBandwidthProperties.logicalBandwidth) > 0u) {
pP2PProperties->flags |= ZE_DEVICE_P2P_PROPERTY_FLAG_ATOMICS;
}
}
}

View File

@@ -2859,7 +2859,7 @@ TEST(MultipleSubDevicesP2PTest, whenGettingP2PPropertiesBetweenSubDevicesThenPee
EXPECT_TRUE(p2pProperties.flags & ZE_DEVICE_P2P_PROPERTY_FLAG_ATOMICS);
}
template <bool p2pAccess, bool p2pAtomicAccessDevice0, bool p2pAtomicAccessDevice1>
template <bool p2pAccess, bool p2pAtomicAccess>
struct MultipleDevicesP2PFixture : public ::testing::Test {
void SetUp() override {
@@ -2872,12 +2872,12 @@ struct MultipleDevicesP2PFixture : public ::testing::Test {
NEO::HardwareInfo hardwareInfo = *NEO::defaultHwInfo;
hardwareInfo.capabilityTable.p2pAccessSupported = p2pAccess;
hardwareInfo.capabilityTable.p2pAtomicAccessSupported = p2pAtomicAccessDevice0;
hardwareInfo.capabilityTable.p2pAtomicAccessSupported = p2pAtomicAccess;
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(&hardwareInfo);
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
hardwareInfo.capabilityTable.p2pAccessSupported = p2pAccess;
hardwareInfo.capabilityTable.p2pAtomicAccessSupported = p2pAtomicAccessDevice1;
hardwareInfo.capabilityTable.p2pAtomicAccessSupported = p2pAtomicAccess;
executionEnvironment->rootDeviceEnvironments[1]->setHwInfoAndInitHelpers(&hardwareInfo);
executionEnvironment->rootDeviceEnvironments[1]->initGmm();
@@ -2914,7 +2914,7 @@ struct MultipleDevicesP2PFixture : public ::testing::Test {
const uint32_t numSubDevices = 2u;
};
using MemoryAccessPropertieP2PAccess0Atomic0 = MultipleDevicesP2PFixture<0, 0, 0>;
using MemoryAccessPropertieP2PAccess0Atomic0 = MultipleDevicesP2PFixture<0, 0>;
TEST_F(MemoryAccessPropertieP2PAccess0Atomic0, WhenCallingGetMemoryAccessPropertiesWithDevicesHavingNoAccessSupportThenNoSupportIsReturned) {
L0::Device *device = driverHandle->devices[0];
ze_device_memory_access_properties_t properties;
@@ -2925,7 +2925,7 @@ TEST_F(MemoryAccessPropertieP2PAccess0Atomic0, WhenCallingGetMemoryAccessPropert
EXPECT_EQ(expectedSharedCrossDeviceAllocCapabilities, properties.sharedCrossDeviceAllocCapabilities);
}
using MemoryAccessPropertieP2PAccess1Atomic0 = MultipleDevicesP2PFixture<1, 0, 0>;
using MemoryAccessPropertieP2PAccess1Atomic0 = MultipleDevicesP2PFixture<1, 0>;
TEST_F(MemoryAccessPropertieP2PAccess1Atomic0, WhenCallingGetMemoryAccessPropertiesWithDevicesHavingP2PAccessSupportThenSupportIsReturned) {
L0::Device *device = driverHandle->devices[0];
ze_device_memory_access_properties_t properties;
@@ -2937,7 +2937,7 @@ TEST_F(MemoryAccessPropertieP2PAccess1Atomic0, WhenCallingGetMemoryAccessPropert
EXPECT_EQ(expectedSharedCrossDeviceAllocCapabilities, properties.sharedCrossDeviceAllocCapabilities);
}
using MemoryAccessPropertieP2PAccess1Atomic0 = MultipleDevicesP2PFixture<1, 0, 0>;
using MemoryAccessPropertieP2PAccess1Atomic0 = MultipleDevicesP2PFixture<1, 0>;
TEST_F(MemoryAccessPropertieP2PAccess1Atomic0, WhenCallingGetMemoryAccessPropertiesWithDevicesHavingP2PWithoutRecoverablePageFaultsThenSupportIsReturned) {
DebugManagerStateRestore restorer;
debugManager.flags.EnableRecoverablePageFaults.set(0);
@@ -2953,7 +2953,7 @@ TEST_F(MemoryAccessPropertieP2PAccess1Atomic0, WhenCallingGetMemoryAccessPropert
EXPECT_EQ(expectedSharedCrossDeviceAllocCapabilities, properties.sharedCrossDeviceAllocCapabilities);
}
using MemoryAccessPropertieP2PAccess1Atomic0 = MultipleDevicesP2PFixture<1, 0, 0>;
using MemoryAccessPropertieP2PAccess1Atomic0 = MultipleDevicesP2PFixture<1, 0>;
TEST_F(MemoryAccessPropertieP2PAccess1Atomic0, WhenCallingGetMemoryAccessPropertiesWithDevicesHavingP2PWithoutKmdMigrationThenSupportIsReturned) {
DebugManagerStateRestore restorer;
debugManager.flags.EnableRecoverablePageFaults.set(1);
@@ -2969,7 +2969,7 @@ TEST_F(MemoryAccessPropertieP2PAccess1Atomic0, WhenCallingGetMemoryAccessPropert
EXPECT_EQ(expectedSharedCrossDeviceAllocCapabilities, properties.sharedCrossDeviceAllocCapabilities);
}
using MemoryAccessPropertieP2PAccess1Atomic0 = MultipleDevicesP2PFixture<1, 0, 0>;
using MemoryAccessPropertieP2PAccess1Atomic0 = MultipleDevicesP2PFixture<1, 0>;
TEST_F(MemoryAccessPropertieP2PAccess1Atomic0,
WhenCallingGetMemoryAccessPropertiesWithDevicesHavingP2PAndConcurrentAccessSupportThenBasicSupportIsReturned) {
DebugManagerStateRestore restorer;
@@ -2986,7 +2986,7 @@ TEST_F(MemoryAccessPropertieP2PAccess1Atomic0,
EXPECT_EQ(expectedSharedCrossDeviceAllocCapabilities, properties.sharedCrossDeviceAllocCapabilities);
}
using MemoryAccessPropertieP2PAccess1Atomic0 = MultipleDevicesP2PFixture<1, 0, 0>;
using MemoryAccessPropertieP2PAccess1Atomic0 = MultipleDevicesP2PFixture<1, 0>;
TEST_F(MemoryAccessPropertieP2PAccess1Atomic0,
WhenCallingGetMemoryAccessPropertiesWithDevicesHavingP2PAndConcurrentAccessSupportAndEnableCrossP2PSharedAccessKeyThenSupportIsReturned) {
DebugManagerStateRestore restorer;
@@ -3004,7 +3004,7 @@ TEST_F(MemoryAccessPropertieP2PAccess1Atomic0,
EXPECT_EQ(expectedSharedCrossDeviceAllocCapabilities, properties.sharedCrossDeviceAllocCapabilities);
}
using MemoryAccessPropertieP2PAccess1Atomic1 = MultipleDevicesP2PFixture<1, 1, 0>;
using MemoryAccessPropertieP2PAccess1Atomic1 = MultipleDevicesP2PFixture<1, 1>;
TEST_F(MemoryAccessPropertieP2PAccess1Atomic1,
WhenCallingGetMemoryAccessPropertiesWithDevicesHavingP2PAndAtomicAccessSupportThenBasicSupportIsReturned) {
DebugManagerStateRestore restorer;
@@ -3038,7 +3038,7 @@ TEST_F(MemoryAccessPropertieP2PAccess1Atomic1,
EXPECT_EQ(expectedSharedCrossDeviceAllocCapabilities, properties.sharedCrossDeviceAllocCapabilities);
}
using MultipleDevicesP2PDevice0Access0Atomic0Device1Access0Atomic0Test = MultipleDevicesP2PFixture<0, 0, 0>;
using MultipleDevicesP2PDevice0Access0Atomic0Device1Access0Atomic0Test = MultipleDevicesP2PFixture<0, 0>;
TEST_F(MultipleDevicesP2PDevice0Access0Atomic0Device1Access0Atomic0Test, WhenCallingGetP2PPropertiesWithBothDevicesHavingNoAccessSupportThenNoSupportIsReturned) {
L0::Device *device0 = driverHandle->devices[0];
L0::Device *device1 = driverHandle->devices[1];
@@ -3086,7 +3086,7 @@ TEST_F(MultipleDevicesP2PDevice0Access0Atomic0Device1Access0Atomic0Test, WhenCal
EXPECT_EQ(ZE_RESULT_SUCCESS, res);
}
using MultipleDevicesP2PDevice0Access1Atomic0Device1Access1Atomic0Test = MultipleDevicesP2PFixture<1, 0, 0>;
using MultipleDevicesP2PDevice0Access1Atomic0Device1Access1Atomic0Test = MultipleDevicesP2PFixture<1, 0>;
TEST_F(MultipleDevicesP2PDevice0Access1Atomic0Device1Access1Atomic0Test, WhenCallingGetP2PPropertiesWithBothDevicesHavingAccessSupportThenSupportIsReturned) {
L0::Device *device0 = driverHandle->devices[0];
L0::Device *device1 = driverHandle->devices[1];
@@ -3098,31 +3098,7 @@ TEST_F(MultipleDevicesP2PDevice0Access1Atomic0Device1Access1Atomic0Test, WhenCal
EXPECT_FALSE(p2pProperties.flags & ZE_DEVICE_P2P_PROPERTY_FLAG_ATOMICS);
}
using MultipleDevicesP2PDevice0Access1Atomic0Device1Access1Atomic1Test = MultipleDevicesP2PFixture<1, 0, 1>;
TEST_F(MultipleDevicesP2PDevice0Access1Atomic0Device1Access1Atomic1Test, WhenCallingGetP2PPropertiesWithBothDevicesHavingAccessSupportAndOnlyOneWithAtomicThenSupportIsReturnedOnlyForAccess) {
L0::Device *device0 = driverHandle->devices[0];
L0::Device *device1 = driverHandle->devices[1];
ze_device_p2p_properties_t p2pProperties = {};
device0->getP2PProperties(device1, &p2pProperties);
EXPECT_TRUE(p2pProperties.flags & ZE_DEVICE_P2P_PROPERTY_FLAG_ACCESS);
EXPECT_FALSE(p2pProperties.flags & ZE_DEVICE_P2P_PROPERTY_FLAG_ATOMICS);
}
using MultipleDevicesP2PDevice0Access1Atomic1Device1Access1Atomic0Test = MultipleDevicesP2PFixture<1, 1, 0>;
TEST_F(MultipleDevicesP2PDevice0Access1Atomic1Device1Access1Atomic0Test, WhenCallingGetP2PPropertiesWithBothDevicesHavingAccessSupportAndOnlyFirstWithAtomicThenSupportIsReturnedOnlyForAccess) {
L0::Device *device0 = driverHandle->devices[0];
L0::Device *device1 = driverHandle->devices[1];
ze_device_p2p_properties_t p2pProperties = {};
device0->getP2PProperties(device1, &p2pProperties);
EXPECT_TRUE(p2pProperties.flags & ZE_DEVICE_P2P_PROPERTY_FLAG_ACCESS);
EXPECT_FALSE(p2pProperties.flags & ZE_DEVICE_P2P_PROPERTY_FLAG_ATOMICS);
}
using MultipleDevicesP2PDevice0Access1Atomic1Device1Access1Atomic1Test = MultipleDevicesP2PFixture<1, 1, 1>;
using MultipleDevicesP2PDevice0Access1Atomic1Device1Access1Atomic1Test = MultipleDevicesP2PFixture<1, 1>;
TEST_F(MultipleDevicesP2PDevice0Access1Atomic1Device1Access1Atomic1Test, WhenCallingGetP2PPropertiesWithBothDevicesHavingAccessAndAtomicSupportThenSupportIsReturnedOnlyForAccess) {
L0::Device *device0 = driverHandle->devices[0];
L0::Device *device1 = driverHandle->devices[1];
@@ -3134,7 +3110,7 @@ TEST_F(MultipleDevicesP2PDevice0Access1Atomic1Device1Access1Atomic1Test, WhenCal
EXPECT_FALSE(p2pProperties.flags & ZE_DEVICE_P2P_PROPERTY_FLAG_ATOMICS);
}
template <bool p2pAccess, bool p2pAtomicAccessDevice0, bool p2pAtomicAccessDevice1>
template <bool p2pAccess, bool p2pAtomicAccess>
struct MultipleDevicesP2PWithXeLinkFixture : public ::testing::Test {
void SetUp() override {
debugManager.flags.CreateMultipleSubDevices.set(numSubDevices);
@@ -3145,13 +3121,13 @@ struct MultipleDevicesP2PWithXeLinkFixture : public ::testing::Test {
auto hwInfo0 = *NEO::defaultHwInfo;
hwInfo0.capabilityTable.p2pAccessSupported = p2pAccess;
hwInfo0.capabilityTable.p2pAtomicAccessSupported = p2pAtomicAccessDevice0;
hwInfo0.capabilityTable.p2pAtomicAccessSupported = p2pAtomicAccess;
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(&hwInfo0);
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
auto hwInfo1 = *NEO::defaultHwInfo;
hwInfo1.capabilityTable.p2pAccessSupported = p2pAccess;
hwInfo1.capabilityTable.p2pAtomicAccessSupported = p2pAtomicAccessDevice1;
hwInfo1.capabilityTable.p2pAtomicAccessSupported = p2pAtomicAccess;
executionEnvironment->rootDeviceEnvironments[1]->setHwInfoAndInitHelpers(&hwInfo1);
executionEnvironment->rootDeviceEnvironments[1]->initGmm();
@@ -3222,7 +3198,7 @@ struct MultipleDevicesP2PWithXeLinkFixture : public ::testing::Test {
edgeXeLink->vertexA = FabricVertex::fromHandle(vertex0SubVertices[1]);
edgeXeLink->vertexB = FabricVertex::fromHandle(vertex1SubVertices[0]);
memcpy_s(edgeXeLink->properties.model, ZE_MAX_FABRIC_EDGE_MODEL_EXP_SIZE, xeLinkModel, strlen(xeLinkModel));
edgeXeLink->properties.bandwidth = xeLinkBandwidth;
edgeXeLink->properties.bandwidth = p2pAtomicAccess ? xeLinkBandwidth : 0;
edgeXeLink->properties.bandwidthUnit = ZE_BANDWIDTH_UNIT_BYTES_PER_NANOSEC;
edgeXeLink->properties.latency = 1u;
edgeXeLink->properties.latencyUnit = ZE_LATENCY_UNIT_HOP;
@@ -3233,7 +3209,7 @@ struct MultipleDevicesP2PWithXeLinkFixture : public ::testing::Test {
edgeMdfiXeLink->vertexA = FabricVertex::fromHandle(vertex0SubVertices[0]);
edgeMdfiXeLink->vertexB = FabricVertex::fromHandle(vertex1SubVertices[0]);
memcpy_s(edgeMdfiXeLink->properties.model, ZE_MAX_FABRIC_EDGE_MODEL_EXP_SIZE, mdfiXeLinkModel, strlen(mdfiXeLinkModel));
edgeMdfiXeLink->properties.bandwidth = xeLinkBandwidth;
edgeMdfiXeLink->properties.bandwidth = p2pAtomicAccess ? xeLinkBandwidth : 0;
edgeMdfiXeLink->properties.bandwidthUnit = ZE_BANDWIDTH_UNIT_BYTES_PER_NANOSEC;
edgeMdfiXeLink->properties.latency = std::numeric_limits<uint32_t>::max();
edgeMdfiXeLink->properties.latencyUnit = ZE_LATENCY_UNIT_UNKNOWN;
@@ -3244,7 +3220,7 @@ struct MultipleDevicesP2PWithXeLinkFixture : public ::testing::Test {
edgeMdfiXeLinkMdfi->vertexA = FabricVertex::fromHandle(vertex0SubVertices[0]);
edgeMdfiXeLinkMdfi->vertexB = FabricVertex::fromHandle(vertex1SubVertices[1]);
memcpy_s(edgeMdfiXeLinkMdfi->properties.model, ZE_MAX_FABRIC_EDGE_MODEL_EXP_SIZE, mdfiXeLinkMdfiModel, strlen(mdfiXeLinkMdfiModel));
edgeMdfiXeLinkMdfi->properties.bandwidth = xeLinkBandwidth;
edgeMdfiXeLinkMdfi->properties.bandwidth = p2pAtomicAccess ? xeLinkBandwidth : 0;
edgeMdfiXeLinkMdfi->properties.bandwidthUnit = ZE_BANDWIDTH_UNIT_BYTES_PER_NANOSEC;
edgeMdfiXeLinkMdfi->properties.latency = std::numeric_limits<uint32_t>::max();
edgeMdfiXeLinkMdfi->properties.latencyUnit = ZE_LATENCY_UNIT_UNKNOWN;
@@ -3255,7 +3231,7 @@ struct MultipleDevicesP2PWithXeLinkFixture : public ::testing::Test {
edgeXeLinkMdfi->vertexA = FabricVertex::fromHandle(vertex0SubVertices[1]);
edgeXeLinkMdfi->vertexB = FabricVertex::fromHandle(vertex1SubVertices[1]);
memcpy_s(edgeXeLinkMdfi->properties.model, ZE_MAX_FABRIC_EDGE_MODEL_EXP_SIZE, xeLinkMdfiModel, strlen(xeLinkMdfiModel));
edgeXeLinkMdfi->properties.bandwidth = xeLinkBandwidth;
edgeXeLinkMdfi->properties.bandwidth = p2pAtomicAccess ? xeLinkBandwidth : 0;
edgeXeLinkMdfi->properties.bandwidthUnit = ZE_BANDWIDTH_UNIT_BYTES_PER_NANOSEC;
edgeXeLinkMdfi->properties.latency = std::numeric_limits<uint32_t>::max();
edgeXeLinkMdfi->properties.latencyUnit = ZE_LATENCY_UNIT_UNKNOWN;
@@ -3273,7 +3249,7 @@ struct MultipleDevicesP2PWithXeLinkFixture : public ::testing::Test {
ze_fabric_vertex_handle_t vertex1SubVertices[numSubDevices];
};
using MultipleDevicesP2PWithXeLinkDevice0Access0Atomic0Device1Access0Atomic0Test = MultipleDevicesP2PWithXeLinkFixture<false, false, false>;
using MultipleDevicesP2PWithXeLinkDevice0Access0Atomic0Device1Access0Atomic0Test = MultipleDevicesP2PWithXeLinkFixture<false, false>;
TEST_F(MultipleDevicesP2PWithXeLinkDevice0Access0Atomic0Device1Access0Atomic0Test, WhenCallingGetP2PPropertiesWithNoDeviceHavingAccessSupportThenNoDeviceHasP2PAccessSupport) {
auto subDevice00 = DeviceImp::fromHandle(device0SubDevices[0]);
auto subDevice01 = DeviceImp::fromHandle(device0SubDevices[1]);
@@ -3303,7 +3279,7 @@ TEST_F(MultipleDevicesP2PWithXeLinkDevice0Access0Atomic0Device1Access0Atomic0Tes
EXPECT_FALSE(p2pProperties.flags & ZE_DEVICE_P2P_PROPERTY_FLAG_ATOMICS);
}
using MultipleDevicesP2PWithXeLinkDevice0Access1Atomic0Device1Access1Atomic0Test = MultipleDevicesP2PWithXeLinkFixture<true, false, false>;
using MultipleDevicesP2PWithXeLinkDevice0Access1Atomic0Device1Access1Atomic0Test = MultipleDevicesP2PWithXeLinkFixture<true, false>;
TEST_F(MultipleDevicesP2PWithXeLinkDevice0Access1Atomic0Device1Access1Atomic0Test, WhenCallingGetP2PPropertiesWithBothDeviceHavingAccessSupportThenBothDevicesHaveP2PAccessSupport) {
auto subDevice00 = DeviceImp::fromHandle(device0SubDevices[0]);
auto subDevice01 = DeviceImp::fromHandle(device0SubDevices[1]);
@@ -3333,67 +3309,7 @@ TEST_F(MultipleDevicesP2PWithXeLinkDevice0Access1Atomic0Device1Access1Atomic0Tes
EXPECT_FALSE(p2pProperties.flags & ZE_DEVICE_P2P_PROPERTY_FLAG_ATOMICS);
}
using MultipleDevicesP2PWithXeLinkDevice0Access1Atomic1Device1Access1Atomic0Test = MultipleDevicesP2PWithXeLinkFixture<true, true, false>;
TEST_F(MultipleDevicesP2PWithXeLinkDevice0Access1Atomic1Device1Access1Atomic0Test, WhenCallingGetP2PPropertiesWithSecondDeviceDoesNotHaveAtomicSupportThenCorrectSupportIsReturned) {
auto subDevice00 = DeviceImp::fromHandle(device0SubDevices[0]);
auto subDevice01 = DeviceImp::fromHandle(device0SubDevices[1]);
auto subDevice10 = DeviceImp::fromHandle(device1SubDevices[0]);
auto subDevice11 = DeviceImp::fromHandle(device1SubDevices[1]);
ze_device_p2p_properties_t p2pProperties;
p2pProperties = {};
EXPECT_EQ(ZE_RESULT_SUCCESS, subDevice00->getP2PProperties(subDevice10, &p2pProperties));
EXPECT_TRUE(p2pProperties.flags & ZE_DEVICE_P2P_PROPERTY_FLAG_ACCESS);
EXPECT_FALSE(p2pProperties.flags & ZE_DEVICE_P2P_PROPERTY_FLAG_ATOMICS);
p2pProperties = {};
EXPECT_EQ(ZE_RESULT_SUCCESS, subDevice00->getP2PProperties(subDevice11, &p2pProperties));
EXPECT_TRUE(p2pProperties.flags & ZE_DEVICE_P2P_PROPERTY_FLAG_ACCESS);
EXPECT_FALSE(p2pProperties.flags & ZE_DEVICE_P2P_PROPERTY_FLAG_ATOMICS);
p2pProperties = {};
EXPECT_EQ(ZE_RESULT_SUCCESS, subDevice01->getP2PProperties(subDevice10, &p2pProperties));
EXPECT_TRUE(p2pProperties.flags & ZE_DEVICE_P2P_PROPERTY_FLAG_ACCESS);
EXPECT_FALSE(p2pProperties.flags & ZE_DEVICE_P2P_PROPERTY_FLAG_ATOMICS);
p2pProperties = {};
EXPECT_EQ(ZE_RESULT_SUCCESS, subDevice01->getP2PProperties(subDevice11, &p2pProperties));
EXPECT_TRUE(p2pProperties.flags & ZE_DEVICE_P2P_PROPERTY_FLAG_ACCESS);
EXPECT_FALSE(p2pProperties.flags & ZE_DEVICE_P2P_PROPERTY_FLAG_ATOMICS);
}
using MultipleDevicesP2PWithXeLinkDevice0Access1Atomic0Device1Access1Atomic1Test = MultipleDevicesP2PWithXeLinkFixture<true, false, true>;
TEST_F(MultipleDevicesP2PWithXeLinkDevice0Access1Atomic0Device1Access1Atomic1Test, WhenCallingGetP2PPropertiesWithFirstDeviceDoesNotHaveAtomicSupportThenCorrectSupportIsReturned) {
auto subDevice00 = DeviceImp::fromHandle(device0SubDevices[0]);
auto subDevice01 = DeviceImp::fromHandle(device0SubDevices[1]);
auto subDevice10 = DeviceImp::fromHandle(device1SubDevices[0]);
auto subDevice11 = DeviceImp::fromHandle(device1SubDevices[1]);
ze_device_p2p_properties_t p2pProperties;
p2pProperties = {};
EXPECT_EQ(ZE_RESULT_SUCCESS, subDevice00->getP2PProperties(subDevice10, &p2pProperties));
EXPECT_TRUE(p2pProperties.flags & ZE_DEVICE_P2P_PROPERTY_FLAG_ACCESS);
EXPECT_FALSE(p2pProperties.flags & ZE_DEVICE_P2P_PROPERTY_FLAG_ATOMICS);
p2pProperties = {};
EXPECT_EQ(ZE_RESULT_SUCCESS, subDevice00->getP2PProperties(subDevice11, &p2pProperties));
EXPECT_TRUE(p2pProperties.flags & ZE_DEVICE_P2P_PROPERTY_FLAG_ACCESS);
EXPECT_FALSE(p2pProperties.flags & ZE_DEVICE_P2P_PROPERTY_FLAG_ATOMICS);
p2pProperties = {};
EXPECT_EQ(ZE_RESULT_SUCCESS, subDevice01->getP2PProperties(subDevice10, &p2pProperties));
EXPECT_TRUE(p2pProperties.flags & ZE_DEVICE_P2P_PROPERTY_FLAG_ACCESS);
EXPECT_FALSE(p2pProperties.flags & ZE_DEVICE_P2P_PROPERTY_FLAG_ATOMICS);
p2pProperties = {};
EXPECT_EQ(ZE_RESULT_SUCCESS, subDevice01->getP2PProperties(subDevice11, &p2pProperties));
EXPECT_TRUE(p2pProperties.flags & ZE_DEVICE_P2P_PROPERTY_FLAG_ACCESS);
EXPECT_FALSE(p2pProperties.flags & ZE_DEVICE_P2P_PROPERTY_FLAG_ATOMICS);
}
using MultipleDevicesP2PWithXeLinkDevice0Access1Atomic1Device1Access1Atomic1Test = MultipleDevicesP2PWithXeLinkFixture<true, true, true>;
using MultipleDevicesP2PWithXeLinkDevice0Access1Atomic1Device1Access1Atomic1Test = MultipleDevicesP2PWithXeLinkFixture<true, true>;
TEST_F(MultipleDevicesP2PWithXeLinkDevice0Access1Atomic1Device1Access1Atomic1Test, WhenCallingGetP2PPropertiesWithBothDevicesHavingAccessAndAtomicSupportThenCorrectSupportIsReturned) {
auto subDevice00 = DeviceImp::fromHandle(device0SubDevices[0]);
auto subDevice01 = DeviceImp::fromHandle(device0SubDevices[1]);