SWDEV-339742 - Check can access before set device to 1. (#2758)
Change-Id: I5b06f98b0061ee162488e288c3bfac09ff4f94cf
此提交包含在:
@@ -122,10 +122,14 @@ TEST_CASE("Unit_hipPtrGetAttribute_Simple") {
|
||||
|
||||
// HIP_POINTER_ATTRIBUTE_DEVICE_ORDINAL
|
||||
if (numDevices > 1) {
|
||||
HIP_CHECK(hipSetDevice(1));
|
||||
HIP_CHECK(hipPointerGetAttribute(&datatype, HIP_POINTER_ATTRIBUTE_DEVICE_ORDINAL,
|
||||
reinterpret_cast<hipDeviceptr_t>(A_d)));
|
||||
REQUIRE(datatype == 0);
|
||||
int canAccess = -1;
|
||||
HIP_CHECK(hipDeviceCanAccessPeer(&canAccess, 1, 0));
|
||||
if (canAccess == 1) {
|
||||
HIP_CHECK(hipSetDevice(1));
|
||||
HIP_CHECK(hipPointerGetAttribute(&datatype, HIP_POINTER_ATTRIBUTE_DEVICE_ORDINAL,
|
||||
reinterpret_cast<hipDeviceptr_t>(A_d)));
|
||||
REQUIRE(datatype == 0);
|
||||
}
|
||||
}
|
||||
|
||||
// HIP_POINTER_ATTRIBUTE_MAPPED
|
||||
|
||||
新增問題並參考
封鎖使用者