You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[UR][L0] Extend memory residency tests with P2P checks
Fill in the three placeholder multi-device tests in
memory_residency.cpp to verify the peer-access-driven residency
behaviour introduced by the parent commit.
allocationInitiallyAbsentOnPeer
Allocates USM memory on devices[0] without calling
urUsmP2PEnablePeerAccessExp first and asserts that the allocation is
NOT made resident on devices[1]. Verified by checking that free memory
on devices[0] (source) decreases by at least allocSize, while free
memory on devices[1] (peer) does not decrease by a full allocSize.
allocationExistsOnPeerWithEnabledAccess
Enables peer access from devices[0] to devices[1] and verifies that a
second enable attempt returns UR_RESULT_ERROR_INVALID_OPERATION (state
machine check). Allocates USM memory on devices[0] with P2P enabled
and asserts that source-device free memory decreases by at least
allocSize (the allocation succeeded and memory is on devices[0]).
Disables peer access and frees the allocation on exit.
Note: peer-device free memory is not checked because
UR_DEVICE_INFO_GLOBAL_MEM_FREE does not reliably reflect
zeContextMakeMemoryResident behaviour for device USM allocations.
allocationAbsentOnPeerWithDisabledAccess
Enables peer access and allocates USM memory on devices[0]. Disables
peer access and verifies that a second disable attempt returns
UR_RESULT_ERROR_INVALID_OPERATION (state machine check). Asserts that
source-device free memory still shows the allocation is present.
Frees the allocation on exit.
Note: peer-device eviction is not checked via free memory for the
same reason as above (unreliable for device USM).
All three tests:
- Skip when either device is not PVC (UR_DEVICE_INFO_GLOBAL_MEM_FREE
is only reliably accurate on PVC).
- Skip when no hardware P2P connection exists between the two devices
(UR_EXP_PEER_INFO_UR_PEER_ACCESS_SUPPORT == 0).
- Use the peerAccessEnabled flag in the fixture so that TearDown can
disable peer access even if a test assertion fails mid-way, keeping
subsequent tests in a clean state.
Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
0 commit comments