Skip to content

Commit e3d127d

Browse files
authored
Merge pull request #2246 from JackAKirk/p2p-fix-impl
[spec][usm-p2p] p2p info query return int instead of uint32_t, fix l0 impl
2 parents 884b646 + 4f1fd54 commit e3d127d

File tree

5 files changed

+13
-11
lines changed

5 files changed

+13
-11
lines changed

include/ur_api.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -9819,9 +9819,9 @@ urUSMReleaseExp(
98199819
///////////////////////////////////////////////////////////////////////////////
98209820
/// @brief Supported peer info
98219821
typedef enum ur_exp_peer_info_t {
9822-
UR_EXP_PEER_INFO_UR_PEER_ACCESS_SUPPORTED = 0, ///< [uint32_t] 1 if P2P access is supported otherwise P2P access is not
9822+
UR_EXP_PEER_INFO_UR_PEER_ACCESS_SUPPORTED = 0, ///< [int] 1 if P2P access is supported otherwise P2P access is not
98239823
///< supported.
9824-
UR_EXP_PEER_INFO_UR_PEER_ATOMICS_SUPPORTED = 1, ///< [uint32_t] 1 if atomic operations are supported over the P2P link,
9824+
UR_EXP_PEER_INFO_UR_PEER_ATOMICS_SUPPORTED = 1, ///< [int] 1 if atomic operations are supported over the P2P link,
98259825
///< otherwise such operations are not supported.
98269826
/// @cond
98279827
UR_EXP_PEER_INFO_FORCE_UINT32 = 0x7fffffff

include/ur_print.hpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -10308,9 +10308,9 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr, ur_exp_peer_in
1030810308

1030910309
switch (value) {
1031010310
case UR_EXP_PEER_INFO_UR_PEER_ACCESS_SUPPORTED: {
10311-
const uint32_t *tptr = (const uint32_t *)ptr;
10312-
if (sizeof(uint32_t) > size) {
10313-
os << "invalid size (is: " << size << ", expected: >=" << sizeof(uint32_t) << ")";
10311+
const int *tptr = (const int *)ptr;
10312+
if (sizeof(int) > size) {
10313+
os << "invalid size (is: " << size << ", expected: >=" << sizeof(int) << ")";
1031410314
return UR_RESULT_ERROR_INVALID_SIZE;
1031510315
}
1031610316
os << (const void *)(tptr) << " (";
@@ -10320,9 +10320,9 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr, ur_exp_peer_in
1032010320
os << ")";
1032110321
} break;
1032210322
case UR_EXP_PEER_INFO_UR_PEER_ATOMICS_SUPPORTED: {
10323-
const uint32_t *tptr = (const uint32_t *)ptr;
10324-
if (sizeof(uint32_t) > size) {
10325-
os << "invalid size (is: " << size << ", expected: >=" << sizeof(uint32_t) << ")";
10323+
const int *tptr = (const int *)ptr;
10324+
if (sizeof(int) > size) {
10325+
os << "invalid size (is: " << size << ", expected: >=" << sizeof(int) << ")";
1032610326
return UR_RESULT_ERROR_INVALID_SIZE;
1032710327
}
1032810328
os << (const void *)(tptr) << " (";

scripts/core/EXP-USM-P2P.rst

+2
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ Changelog
6969
+-----------+---------------------------------------------+
7070
| 1.1 | Added USM_P2P_EXTENSION_STRING_EXP ID Macro |
7171
+-----------+---------------------------------------------+
72+
| 1.2 | Switch Info types from uint32_t to int |
73+
+-----------+---------------------------------------------+
7274

7375
Contributors
7476
--------------------------------------------------------------------------------

scripts/core/exp-usm-p2p.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ name: $x_exp_peer_info_t
2424
typed_etors: True
2525
etors:
2626
- name: UR_PEER_ACCESS_SUPPORTED
27-
desc: "[uint32_t] 1 if P2P access is supported otherwise P2P access is not supported."
27+
desc: "[int] 1 if P2P access is supported otherwise P2P access is not supported."
2828
- name: UR_PEER_ATOMICS_SUPPORTED
29-
desc: "[uint32_t] 1 if atomic operations are supported over the P2P link, otherwise such operations are not supported."
29+
desc: "[int] 1 if atomic operations are supported over the P2P link, otherwise such operations are not supported."
3030
--- #--------------------------------------------------------------------------
3131
type: function
3232
desc: "Enable access to peer device memory"

source/adapters/level_zero/usm_p2p.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ ur_result_t urUsmP2PPeerAccessGetInfoExp(ur_device_handle_t commandDevice,
4141

4242
UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet);
4343

44-
bool propertyValue = false;
44+
int propertyValue = 0;
4545
switch (propName) {
4646
case UR_EXP_PEER_INFO_UR_PEER_ACCESS_SUPPORTED: {
4747
bool p2pAccessSupported = false;

0 commit comments

Comments
 (0)