SWDEV-474617 - Add Peer Device access check for memcpy2D tests and fix for SVM Memory test.
Change-Id: Idff7c02087f99c59f456e0027bbe0bc19cf67059
[ROCm/hip-tests commit: 8b15996041]
Этот коммит содержится в:
коммит произвёл
Rakesh Roy
родитель
2e87246963
Коммит
6470a57dac
+11
-8
@@ -234,16 +234,19 @@ void launch_kernels_and_verify(std::vector<hipStream_t> &streams, unsigned int n
|
||||
* - HIP_VERSION >= 5.7
|
||||
*/
|
||||
TEST_CASE("test_svm_fine_grain_memory_consistency") {
|
||||
int pcieAtomic = 0;
|
||||
HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0));
|
||||
if (!pcieAtomic) {
|
||||
fprintf(stderr, "Device doesn't support pcie atomic, Skipped\n");
|
||||
REQUIRE(true);
|
||||
return;
|
||||
}
|
||||
const int num_elements = 2167;
|
||||
int num_devices = 0;
|
||||
HIP_CHECK(hipGetDeviceCount(&num_devices));
|
||||
|
||||
for(int id = 0; id < num_devices; id++) {
|
||||
int pcieAtomic = 0;
|
||||
HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, id));
|
||||
if (!pcieAtomic) {
|
||||
fprintf(stderr, "Device doesn't support pcie atomic, Skipped\n");
|
||||
REQUIRE(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
const int num_elements = 2167;
|
||||
std::vector<hipStream_t> streams(num_devices);
|
||||
|
||||
for (int d = 0; d < num_devices; d++) {
|
||||
|
||||
@@ -72,12 +72,7 @@ void Memcpy2DDeviceToDeviceShell(F memcpy_func, const hipStream_t kernel_stream
|
||||
const size_t src_cols_mult = GENERATE(1, 2);
|
||||
|
||||
INFO("Src device: " << src_device << ", Dst device: " << dst_device);
|
||||
|
||||
HIP_CHECK(hipSetDevice(src_device));
|
||||
if constexpr (enable_peer_access) {
|
||||
if (src_device == dst_device) {
|
||||
return;
|
||||
}
|
||||
if (device_count > 1) {
|
||||
int can_access_peer = 0;
|
||||
HIP_CHECK(hipDeviceCanAccessPeer(&can_access_peer, src_device, dst_device));
|
||||
if (!can_access_peer) {
|
||||
@@ -86,6 +81,13 @@ void Memcpy2DDeviceToDeviceShell(F memcpy_func, const hipStream_t kernel_stream
|
||||
HipTest::HIP_SKIP_TEST(msg.c_str());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
HIP_CHECK(hipSetDevice(src_device));
|
||||
if constexpr (enable_peer_access) {
|
||||
if (src_device == dst_device) {
|
||||
return;
|
||||
}
|
||||
HIP_CHECK(hipDeviceEnablePeerAccess(dst_device, 0));
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user