Skip to content

Commit

Permalink
[CUDA] Use camelCase always (applied to usm_p2p.cpp). (#1311)
Browse files Browse the repository at this point in the history
* Use camelCase always.

Also return caught UR error directly.

Signed-off-by: JackAKirk <jack.kirk@codeplay.com>

* Revert non camelCase format changes.

From previous commit.

Signed-off-by: JackAKirk <jack.kirk@codeplay.com>

---------

Signed-off-by: JackAKirk <jack.kirk@codeplay.com>
  • Loading branch information
JackAKirk authored Feb 6, 2024
1 parent f086f36 commit 5b89ee8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions source/adapters/cuda/usm_p2p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,25 @@ UR_APIEXPORT ur_result_t UR_APICALL urUsmP2PPeerAccessGetInfoExp(
UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet);

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

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

0 comments on commit 5b89ee8

Please sign in to comment.