Skip to content

Commit ea8142f

Browse files
committed
test(Sysman): Test to validate memory bandwidth counters with workload
Related-To: VLCLJ-2505 Signed-off-by: Aviral Nigam <[email protected]>
1 parent ec18ff9 commit ea8142f

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

conformance_tests/sysman/test_sysman_memory/src/test_sysman_memory.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -275,20 +275,21 @@ TEST_F(
275275
<< "Read counter did not increase after workload";
276276
EXPECT_GE(bandwidth_after.writeCounter, bandwidth_before.writeCounter)
277277
<< "Write counter did not increase after workload";
278-
EXPECT_GE(bandwidth_after.maxBandwidth, bandwidth_before.maxBandwidth)
279-
<< "Max bandwidth did not increase after workload";
280-
281-
auto percentage_bandwidth =
282-
1000000 *
278+
EXPECT_GE(bandwidth_after.timestamp, bandwidth_before.timestamp)
279+
<< "Timestamp did not increase after workload";
280+
double percentage_bandwidth =
281+
1000000.0 *
283282
((bandwidth_after.readCounter - bandwidth_before.readCounter) +
284283
(bandwidth_after.writeCounter - bandwidth_before.writeCounter)) /
285-
(bandwidth_after.maxBandwidth *
286-
(bandwidth_after.timestamp - bandwidth_before.timestamp));
284+
(static_cast<double>(bandwidth_after.maxBandwidth) *
285+
(static_cast<double>(bandwidth_after.timestamp) -
286+
static_cast<double>(bandwidth_before.timestamp)));
287287
// Validate that percentage bandwidth is greater than zero
288288
LOG_INFO << "Percentage Bandwidth: " << percentage_bandwidth << "%";
289289
EXPECT_GT(percentage_bandwidth, 0.0)
290290
<< "Percentage bandwidth is not greater than zero";
291-
EXPECT_LT(percentage_bandwidth, 100.0);
291+
EXPECT_LE(percentage_bandwidth, 100.0)
292+
<< "Percentage bandwidth is greater than 100%";
292293
}
293294
// Free device memory
294295
lzt::free_memory(src_ptr);

0 commit comments

Comments
 (0)