From 26cf8d399e0596d884d217ba0054c058db6e3434 Mon Sep 17 00:00:00 2001 From: Aaron En Ye Shi Date: Thu, 15 Jul 2021 15:13:28 +0000 Subject: [PATCH] SWDEV-292904 - Extend HIP coherency tests to gfx940 Change-Id: I54d57572d55c302ebaed29c7e11570e3d1b44a8e [ROCm/hip commit: 9fbd19a6759b0ed091562ad286a790783998b88a] --- .../synchronization/cache_coherency_cpu_gpu.cpp | 9 +++++---- .../synchronization/cache_coherency_gpu_gpu.cpp | 12 +++++++----- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/projects/hip/tests/src/runtimeApi/synchronization/cache_coherency_cpu_gpu.cpp b/projects/hip/tests/src/runtimeApi/synchronization/cache_coherency_cpu_gpu.cpp index 5861fa97ca..3e4aec033c 100644 --- a/projects/hip/tests/src/runtimeApi/synchronization/cache_coherency_cpu_gpu.cpp +++ b/projects/hip/tests/src/runtimeApi/synchronization/cache_coherency_cpu_gpu.cpp @@ -118,7 +118,7 @@ cpu_thread(int *A, int *B, int *X, int *Y, size_t N, } } -// This test runs on gfx90a where XGMI enables fine-grained communication +// This test runs on devices where XGMI enables fine-grained communication // between GPUs. This performs a message passing test. // Array A is allocated on Device 0, and remotely on host. // Device 0 also increments atomic ints AA1 and AA2. @@ -142,12 +142,13 @@ bool cpu_to_gpu_coherency() { return false; } - // Skip this test if device is not gfx90a. + // Skip this test if feature is not supported. static int device0 = 0; hipDeviceProp_t props; HIPCHECK(hipGetDeviceProperties(&props, device0)); - if (strncmp(props.gcnArchName, "gfx90a", 6) != 0) { - printf("info: skipping test on non-gfx90a devices.\n"); + if (strncmp(props.gcnArchName, "gfx90a", 6) != 0 && + strncmp(props.gcnArchName, "gfx940", 6) != 0) { + printf("info: skipping test on devices other than gfx90a and gfx940.\n"); return true; } diff --git a/projects/hip/tests/src/runtimeApi/synchronization/cache_coherency_gpu_gpu.cpp b/projects/hip/tests/src/runtimeApi/synchronization/cache_coherency_gpu_gpu.cpp index 539ffb0a73..78863b5351 100644 --- a/projects/hip/tests/src/runtimeApi/synchronization/cache_coherency_gpu_gpu.cpp +++ b/projects/hip/tests/src/runtimeApi/synchronization/cache_coherency_gpu_gpu.cpp @@ -105,7 +105,7 @@ gpu_cache1(int *A,int *B, int *X, int *Y, size_t N, } } -// This test runs on gfx90a where XGMI enables fine-grained communication +// This test runs on devices where XGMI enables fine-grained communication // between GPUs. This performs a message passing test. // Array A is allocated on Device 0, and remotely on Device 1. // Device 0 also increments atomic ints AA1 and AA2. @@ -131,13 +131,15 @@ bool gpu_to_gpu_coherency() { } printf("info: performing this test only on first two GPUs.\n"); - // Skip this test if both devices are not gfx90a. + // Skip this test if either device does not support this feature. hipDeviceProp_t props0, props1; HIPCHECK(hipGetDeviceProperties(&props0, 0)); HIPCHECK(hipGetDeviceProperties(&props1, 1)); - if (strncmp(props0.gcnArchName, "gfx90a", 6) != 0 || - strncmp(props1.gcnArchName, "gfx90a", 6) != 0) { - printf("info: skipping test on non-gfx90a devices.\n"); + if ((strncmp(props0.gcnArchName, "gfx90a", 6) != 0 || + strncmp(props1.gcnArchName, "gfx90a", 6) != 0) && + (strncmp(props0.gcnArchName, "gfx940", 6) != 0 || + strncmp(props1.gcnArchName, "gfx940", 6) != 0)) { + printf("info: skipping test on devices other than gfx90a and gfx940.\n"); return true; }