From 3e0f1d695a13490fa004a75fb0d166584b105d86 Mon Sep 17 00:00:00 2001 From: xinhui pan Date: Wed, 22 Aug 2018 15:54:54 +0800 Subject: [PATCH] kfdtest: Add some asserts in BigBufferStressTest It should have PASS/FAIL report for the vram allocated size. Change-Id: I546c02c2ed02f1cfb5278e0dfd7b18ade39faafb Signed-off-by: xinhui pan [ROCm/ROCR-Runtime commit: 1076075a1c66991a9e9ca0df5a8c1af2c136878e] --- projects/rocr-runtime/tests/kfdtest/src/KFDMemoryTest.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/projects/rocr-runtime/tests/kfdtest/src/KFDMemoryTest.cpp b/projects/rocr-runtime/tests/kfdtest/src/KFDMemoryTest.cpp index 8b25ad7f8f..878c487afa 100644 --- a/projects/rocr-runtime/tests/kfdtest/src/KFDMemoryTest.cpp +++ b/projects/rocr-runtime/tests/kfdtest/src/KFDMemoryTest.cpp @@ -772,6 +772,12 @@ void KFDMemoryTest::BigBufferVRAM(int defaultGPUNode, HSAuint64 granularityMB, << lastTestedSize << "MB" << std::endl; if (lastSize) *lastSize = lastTestedSize * 1024 * 1024; + + /* Make sure 3/4 vram can be allocated.*/ + EXPECT_GE(lastTestedSize * 4, vramSizeMB * 3); + if (lastTestedSize * 16 < vramSizeMB * 15) + WARN() << "The biggest allocated VRAM buffer size is smaller than the expected " + << vramSizeMB * 15 / 16 << "MB" << std::endl; } /* BigBufferStressTest allocs, maps/unmaps, and frees the biggest possible system