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