Skip to content

Commit

Permalink
Revert unrelated cuda changes.
Browse files Browse the repository at this point in the history
These changes will be made in separate PRs.

Signed-off-by: JackAKirk <jack.kirk@codeplay.com>
  • Loading branch information
JackAKirk committed Feb 6, 2024
1 parent 12de78a commit 4217a2d
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions source/adapters/cuda/usm_p2p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,28 @@

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

ur_result_t result = UR_RESULT_SUCCESS;
try {
ScopedContext active(commandDevice->getContext());
UR_CHECK_ERROR(cuCtxEnablePeerAccess(peerDevice->getContext(), 0));
} catch (ur_result_t err) {
return err;
result = err;
}
return UR_RESULT_SUCCESS;
return result;
}

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

ur_result_t result = UR_RESULT_SUCCESS;
try {
ScopedContext active(commandDevice->getContext());
UR_CHECK_ERROR(cuCtxDisablePeerAccess(peerDevice->getContext()));
} catch (ur_result_t err) {
return err;
result = err;
}
return UR_RESULT_SUCCESS;
return result;
}

UR_APIEXPORT ur_result_t UR_APICALL urUsmP2PPeerAccessGetInfoExp(
Expand All @@ -41,25 +45,25 @@ UR_APIEXPORT ur_result_t UR_APICALL urUsmP2PPeerAccessGetInfoExp(
UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet);

int value;
CUdevice_P2PAttribute cuAttr;
CUdevice_P2PAttribute cu_attr;
try {
ScopedContext active(commandDevice->getContext());
switch (propName) {
case UR_EXP_PEER_INFO_UR_PEER_ACCESS_SUPPORTED: {
cuAttr = CU_DEVICE_P2P_ATTRIBUTE_ACCESS_SUPPORTED;
cu_attr = CU_DEVICE_P2P_ATTRIBUTE_ACCESS_SUPPORTED;
break;
}
case UR_EXP_PEER_INFO_UR_PEER_ATOMICS_SUPPORTED: {
cuAttr = CU_DEVICE_P2P_ATTRIBUTE_NATIVE_ATOMIC_SUPPORTED;
cu_attr = CU_DEVICE_P2P_ATTRIBUTE_NATIVE_ATOMIC_SUPPORTED;
break;
}
default: {
return UR_RESULT_ERROR_INVALID_ENUMERATION;
}
}

UR_CHECK_ERROR(cuDeviceGetP2PAttribute(&value, cuAttr, commandDevice->get(),
peerDevice->get()));
UR_CHECK_ERROR(cuDeviceGetP2PAttribute(
&value, cu_attr, commandDevice->get(), peerDevice->get()));
} catch (ur_result_t err) {
return err;
}
Expand Down

0 comments on commit 4217a2d

Please sign in to comment.