Skip to content

Commit

Permalink
[SYCL][CUDA] Implement sycl_ext_oneapi_peer_access extension (#8303)
Browse files Browse the repository at this point in the history
This implements the current extension doc from
intel/llvm#6104 in the CUDA backend only.

Fixes intel/llvm#7543.
Fixes intel/llvm#6749.

---------

Signed-off-by: JackAKirk <jack.kirk@codeplay.com>
Co-authored-by: Nicolas Miller <nicolas.miller@codeplay.com>
Co-authored-by: JackAKirk <chezjakirk@gmail.com>
Co-authored-by: Steffen Larsen <steffen.larsen@intel.com>
  • Loading branch information
4 people authored and omarahmed1111 committed Oct 23, 2023
1 parent e32f6a9 commit 0d05bd0
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ur_interface_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,3 +330,16 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetCommandBufferExpProcAddrTable(

return retVal;
}

UR_DLLEXPORT ur_result_t UR_APICALL urGetUsmP2PExpProcAddrTable(
ur_api_version_t version, ur_usm_p2p_exp_dditable_t *pDdiTable) {
auto retVal = validateProcInputs(version, pDdiTable);
if (UR_RESULT_SUCCESS != retVal) {
return retVal;
}
pDdiTable->pfnEnablePeerAccessExp = urUsmP2PEnablePeerAccessExp;
pDdiTable->pfnDisablePeerAccessExp = urUsmP2PDisablePeerAccessExp;
pDdiTable->pfnPeerAccessGetInfoExp = urUsmP2PPeerAccessGetInfoExp;

return retVal;
}
43 changes: 43 additions & 0 deletions usm_p2p.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//===----------- usm_p2p.cpp - L0 Adapter ----------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===-----------------------------------------------------------------===//

#include "ur_level_zero.hpp"

UR_APIEXPORT ur_result_t UR_APICALL urUsmP2PEnablePeerAccessExp(
ur_device_handle_t commandDevice, ur_device_handle_t peerDevice) {

std::ignore = commandDevice;
std::ignore = peerDevice;

urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__);
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
}

UR_APIEXPORT ur_result_t UR_APICALL urUsmP2PDisablePeerAccessExp(
ur_device_handle_t commandDevice, ur_device_handle_t peerDevice) {

std::ignore = commandDevice;
std::ignore = peerDevice;

urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__);
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
}

UR_APIEXPORT ur_result_t UR_APICALL urUsmP2PPeerAccessGetInfoExp(
ur_device_handle_t commandDevice, ur_device_handle_t peerDevice,
ur_exp_peer_info_t propName, size_t propSize, void *pPropValue,
size_t *pPropSizeRet) {

std::ignore = commandDevice;
std::ignore = peerDevice;
std::ignore = propName;

UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet);
// Zero return value indicates that all of the queries currently return false.
return ReturnValue(uint32_t{0});
}

0 comments on commit 0d05bd0

Please sign in to comment.