Skip to content

[spec][usm-p2p] p2p info query return int instead of uint32_t, fix l0 impl #2246

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/ur_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -9817,9 +9817,9 @@ urUSMReleaseExp(
///////////////////////////////////////////////////////////////////////////////
/// @brief Supported peer info
typedef enum ur_exp_peer_info_t {
UR_EXP_PEER_INFO_UR_PEER_ACCESS_SUPPORTED = 0, ///< [uint32_t] 1 if P2P access is supported otherwise P2P access is not
UR_EXP_PEER_INFO_UR_PEER_ACCESS_SUPPORTED = 0, ///< [int] 1 if P2P access is supported otherwise P2P access is not
///< supported.
UR_EXP_PEER_INFO_UR_PEER_ATOMICS_SUPPORTED = 1, ///< [uint32_t] 1 if atomic operations are supported over the P2P link,
UR_EXP_PEER_INFO_UR_PEER_ATOMICS_SUPPORTED = 1, ///< [int] 1 if atomic operations are supported over the P2P link,
///< otherwise such operations are not supported.
/// @cond
UR_EXP_PEER_INFO_FORCE_UINT32 = 0x7fffffff
Expand Down
12 changes: 6 additions & 6 deletions include/ur_print.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10308,9 +10308,9 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr, ur_exp_peer_in

switch (value) {
case UR_EXP_PEER_INFO_UR_PEER_ACCESS_SUPPORTED: {
const uint32_t *tptr = (const uint32_t *)ptr;
if (sizeof(uint32_t) > size) {
os << "invalid size (is: " << size << ", expected: >=" << sizeof(uint32_t) << ")";
const int *tptr = (const int *)ptr;
if (sizeof(int) > size) {
os << "invalid size (is: " << size << ", expected: >=" << sizeof(int) << ")";
return UR_RESULT_ERROR_INVALID_SIZE;
}
os << (const void *)(tptr) << " (";
Expand All @@ -10320,9 +10320,9 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr, ur_exp_peer_in
os << ")";
} break;
case UR_EXP_PEER_INFO_UR_PEER_ATOMICS_SUPPORTED: {
const uint32_t *tptr = (const uint32_t *)ptr;
if (sizeof(uint32_t) > size) {
os << "invalid size (is: " << size << ", expected: >=" << sizeof(uint32_t) << ")";
const int *tptr = (const int *)ptr;
if (sizeof(int) > size) {
os << "invalid size (is: " << size << ", expected: >=" << sizeof(int) << ")";
return UR_RESULT_ERROR_INVALID_SIZE;
}
os << (const void *)(tptr) << " (";
Expand Down
2 changes: 2 additions & 0 deletions scripts/core/EXP-USM-P2P.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ Changelog
+-----------+---------------------------------------------+
| 1.1 | Added USM_P2P_EXTENSION_STRING_EXP ID Macro |
+-----------+---------------------------------------------+
| 1.2 | Switch Info types from uint32_t to int |
+-----------+---------------------------------------------+

Contributors
--------------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions scripts/core/exp-usm-p2p.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ name: $x_exp_peer_info_t
typed_etors: True
etors:
- name: UR_PEER_ACCESS_SUPPORTED
desc: "[uint32_t] 1 if P2P access is supported otherwise P2P access is not supported."
desc: "[int] 1 if P2P access is supported otherwise P2P access is not supported."
- name: UR_PEER_ATOMICS_SUPPORTED
desc: "[uint32_t] 1 if atomic operations are supported over the P2P link, otherwise such operations are not supported."
desc: "[int] 1 if atomic operations are supported over the P2P link, otherwise such operations are not supported."
--- #--------------------------------------------------------------------------
type: function
desc: "Enable access to peer device memory"
Expand Down
2 changes: 1 addition & 1 deletion source/adapters/level_zero/usm_p2p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ ur_result_t urUsmP2PPeerAccessGetInfoExp(ur_device_handle_t commandDevice,

UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet);

bool propertyValue = false;
int propertyValue = 0;
switch (propName) {
case UR_EXP_PEER_INFO_UR_PEER_ACCESS_SUPPORTED: {
bool p2pAccessSupported = false;
Expand Down
Loading