From e23be58d91a2c3f22e2eaf42308d0a739e77b03a Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Wed, 7 Jun 2017 15:23:37 +0530 Subject: [PATCH] p2p_copy_coherency test: gracefully handle single gpu case Change-Id: I216663f67ef58c673136332635dab8b57079b909 [ROCm/clr commit: a7dc938ec0f2c0ed04a900128b9a735127662446] --- .../tests/src/runtimeApi/memory/p2p_copy_coherency.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/projects/clr/hipamd/tests/src/runtimeApi/memory/p2p_copy_coherency.cpp b/projects/clr/hipamd/tests/src/runtimeApi/memory/p2p_copy_coherency.cpp index 459c0054c9..6bc6235454 100644 --- a/projects/clr/hipamd/tests/src/runtimeApi/memory/p2p_copy_coherency.cpp +++ b/projects/clr/hipamd/tests/src/runtimeApi/memory/p2p_copy_coherency.cpp @@ -156,7 +156,13 @@ int main(int argc, char *argv[]) int dev0 = 0; int dev1 = 1; - // TODO - only works on multi-GPU system: + int numDevices; + HIPCHECK(hipGetDeviceCount(&numDevices)); + if (numDevices == 1) { + printf("warning : test requires atleast two gpus\n"); + passed(); + } + if (enablePeers(dev0,dev1) == -1) { printf ("warning : could not find peer gpus\n"); return -1;