kfdtest: change Largest Buffer search algorithm

The old Largest Buffer search algorithm is using Binary Search
algorithm to find last successful memory allocation. But each
successful memory allocation takes times. Since the unsuccessful
memory allocation returns very quick. Changing the search algorithm
to find first successful memory allocation starting from MAX, each
testing step with granularity interval will speed up this test.

Change-Id: I07daea05423c33e72a483f0013e8ea1b5dabf989
Signed-off-by: James Zhu <James.Zhu@amd.com>
This commit is contained in:
James Zhu
2024-01-10 12:33:29 -05:00
parent 0accd17b6e
commit f75fddb9bd
2 changed files with 14 additions and 20 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ class KFDMemoryTest : public KFDBaseComponentTest {
virtual void TearDown();
protected:
void BinarySearchLargestBuffer(int allocNode, const HsaMemFlags &memFlags,
void SearchLargestBuffer(int allocNode, const HsaMemFlags &memFlags,
HSAuint64 highMB, int nodeToMap,
HSAuint64 *lastSizeMB);
void AcquireReleaseTestRunCPU(HSAuint32 acquireNode, bool scalar);