Skip to content

Commit 9048458

Browse files
JackAKirknpmillerJackAKirksteffenlarsen
authored
[SYCL][CUDA] Implement sycl_ext_oneapi_peer_access extension (intel#8303)
This implements the current extension doc from intel#6104 in the CUDA backend only. Fixes intel#7543. Fixes intel#6749. --------- Signed-off-by: JackAKirk <[email protected]> Co-authored-by: Nicolas Miller <[email protected]> Co-authored-by: JackAKirk <[email protected]> Co-authored-by: Steffen Larsen <[email protected]>
1 parent f23e307 commit 9048458

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

ur_interface_loader.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,3 +330,16 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetCommandBufferExpProcAddrTable(
330330

331331
return retVal;
332332
}
333+
334+
UR_DLLEXPORT ur_result_t UR_APICALL urGetUsmP2PExpProcAddrTable(
335+
ur_api_version_t version, ur_usm_p2p_exp_dditable_t *pDdiTable) {
336+
auto retVal = validateProcInputs(version, pDdiTable);
337+
if (UR_RESULT_SUCCESS != retVal) {
338+
return retVal;
339+
}
340+
pDdiTable->pfnEnablePeerAccessExp = urUsmP2PEnablePeerAccessExp;
341+
pDdiTable->pfnDisablePeerAccessExp = urUsmP2PDisablePeerAccessExp;
342+
pDdiTable->pfnPeerAccessGetInfoExp = urUsmP2PPeerAccessGetInfoExp;
343+
344+
return retVal;
345+
}

usm_p2p.cpp

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
//===----------- usm_p2p.cpp - L0 Adapter ----------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===-----------------------------------------------------------------===//
8+
9+
#include "ur_level_zero.hpp"
10+
11+
UR_APIEXPORT ur_result_t UR_APICALL urUsmP2PEnablePeerAccessExp(
12+
ur_device_handle_t commandDevice, ur_device_handle_t peerDevice) {
13+
14+
std::ignore = commandDevice;
15+
std::ignore = peerDevice;
16+
17+
urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__);
18+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
19+
}
20+
21+
UR_APIEXPORT ur_result_t UR_APICALL urUsmP2PDisablePeerAccessExp(
22+
ur_device_handle_t commandDevice, ur_device_handle_t peerDevice) {
23+
24+
std::ignore = commandDevice;
25+
std::ignore = peerDevice;
26+
27+
urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__);
28+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
29+
}
30+
31+
UR_APIEXPORT ur_result_t UR_APICALL urUsmP2PPeerAccessGetInfoExp(
32+
ur_device_handle_t commandDevice, ur_device_handle_t peerDevice,
33+
ur_exp_peer_info_t propName, size_t propSize, void *pPropValue,
34+
size_t *pPropSizeRet) {
35+
36+
std::ignore = commandDevice;
37+
std::ignore = peerDevice;
38+
std::ignore = propName;
39+
40+
UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet);
41+
// Zero return value indicates that all of the queries currently return false.
42+
return ReturnValue(uint32_t{0});
43+
}

0 commit comments

Comments
 (0)