@@ -35,11 +35,36 @@ UR_APIEXPORT ur_result_t UR_APICALL urUsmP2PPeerAccessGetInfoExp(
35
35
ur_exp_peer_info_t propName, size_t propSize, void *pPropValue,
36
36
size_t *pPropSizeRet) {
37
37
38
- std::ignore = commandDevice;
39
- std::ignore = peerDevice;
40
- std::ignore = propName;
41
-
42
38
UrReturnHelper ReturnValue (propSize, pPropValue, pPropSizeRet);
43
- // Zero return value indicates that all of the queries currently return false.
44
- return ReturnValue (uint32_t {0 });
39
+
40
+ bool propertyValue = false ;
41
+ switch (propName) {
42
+ case UR_EXP_PEER_INFO_UR_PEER_ACCESS_SUPPORTED: {
43
+ bool p2pAccessSupported = false ;
44
+ ze_device_p2p_properties_t p2pProperties;
45
+ ZE2UR_CALL (zeDeviceGetP2PProperties,
46
+ (commandDevice->ZeDevice , peerDevice->ZeDevice , &p2pProperties));
47
+ if (p2pProperties.flags & ZE_DEVICE_P2P_PROPERTY_FLAG_ACCESS) {
48
+ p2pAccessSupported = true ;
49
+ }
50
+ ze_bool_t p2pDeviceSupported = false ;
51
+ ZE2UR_CALL (
52
+ zeDeviceCanAccessPeer,
53
+ (commandDevice->ZeDevice , peerDevice->ZeDevice , &p2pDeviceSupported));
54
+ propertyValue = p2pAccessSupported && p2pDeviceSupported;
55
+ break ;
56
+ }
57
+ case UR_EXP_PEER_INFO_UR_PEER_ATOMICS_SUPPORTED: {
58
+ ze_device_p2p_properties_t p2pProperties;
59
+ ZE2UR_CALL (zeDeviceGetP2PProperties,
60
+ (commandDevice->ZeDevice , peerDevice->ZeDevice , &p2pProperties));
61
+ propertyValue = p2pProperties.flags & ZE_DEVICE_P2P_PROPERTY_FLAG_ATOMICS;
62
+ break ;
63
+ }
64
+ default : {
65
+ return UR_RESULT_ERROR_INVALID_ENUMERATION;
66
+ }
67
+ }
68
+
69
+ return ReturnValue (propertyValue);
45
70
}
0 commit comments