From e65685df1953640e263624144bac9cf54b917987 Mon Sep 17 00:00:00 2001 From: shaoyunl Date: Tue, 30 Jul 2019 15:34:41 -0400 Subject: [PATCH] KFDTest: simply P2PBandwidthTest case for specified source/destination Only run the P2P test over the specified source and destination nodes if user already specify them Change-Id: Ia3c0195cead7f46e3e28507f3255d8c59a287ab8 Signed-off-by: shaoyunl --- tests/kfdtest/src/KFDPerformanceTest.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/kfdtest/src/KFDPerformanceTest.cpp b/tests/kfdtest/src/KFDPerformanceTest.cpp index 4d49f392cc..e4f5af2b51 100644 --- a/tests/kfdtest/src/KFDPerformanceTest.cpp +++ b/tests/kfdtest/src/KFDPerformanceTest.cpp @@ -191,6 +191,21 @@ TEST_F(KFDPerformanceTest, P2PBandWidthTest) { std::stringstream msg; char str[64]; + if (isSpecified) { + HSAuint32 n1 = g_TestNodeId; + HSAuint32 n2 = g_TestDstNodeId; + HSAuint64 speed, speed2; + + LOG() << "Copy from node to node by [push, pull]" << std::endl; + snprintf(str, sizeof(str), "[%d -> %d] ", n1, n2); + testNodeToNodes(n1, &n2, 1, OUT, IN, size, &speed, &speed2, &msg); + + LOG() << std::dec << str << (float)speed / 1024 << " - " << + (float)speed2 / 1024 << " GB/s" << std::endl; + goto exit; + + } + for (; s < twoNodesIdx; s++) { LOG() << test_suits_string[s] << std::endl; msg << test_suits_string[s] << std::endl; @@ -270,6 +285,7 @@ TEST_F(KFDPerformanceTest, P2PBandWidthTest) { } } +exit: /* New line.*/ LOG() << std::endl << msg.str() << std::endl;