@@ -233,9 +233,9 @@ TEST_F(
233
233
EXPECT_EQ (ZE_RESULT_SUCCESS,
234
234
zeDeviceGetProperties (device, &deviceProperties));
235
235
if (deviceProperties.flags & ZE_DEVICE_PROPERTY_FLAG_SUBDEVICE) {
236
- std::cout << " test subdevice id " << deviceProperties.subdeviceId ;
236
+ LOG_DEBUG << " test sub-device id: " << deviceProperties.subdeviceId ;
237
237
} else {
238
- std::cout << " test device is a root device" << std::endl ;
238
+ LOG_DEBUG << " test device is a root device" ;
239
239
}
240
240
241
241
// Allocate device memory for workload
@@ -258,10 +258,10 @@ TEST_F(
258
258
259
259
// Get initial bandwidth counters
260
260
auto bandwidth_before = lzt::get_mem_bandwidth (mem_handle);
261
- EXPECT_LT (bandwidth_before.readCounter , UINT64_MAX);
262
- EXPECT_LT (bandwidth_before. writeCounter , UINT64_MAX) ;
263
- EXPECT_LT (bandwidth_before.maxBandwidth , UINT64_MAX);
264
- EXPECT_LT (bandwidth_before. timestamp , UINT64_MAX) ;
261
+ EXPECT_GT (bandwidth_before.maxBandwidth , 0 )
262
+ << " Max bandwidth is not greater than zero " ;
263
+ EXPECT_GT (bandwidth_before.timestamp , 0 )
264
+ << " Timestamp is not greater than zero " ;
265
265
// Run the workload
266
266
ze_result_t result = copy_workload (device, &device_desc, src_ptr, dst_ptr,
267
267
static_cast <int32_t >(buffer_size));
@@ -271,24 +271,25 @@ TEST_F(
271
271
auto bandwidth_after = lzt::get_mem_bandwidth (mem_handle);
272
272
273
273
// Validate that read/write counters have increased after workload
274
- EXPECT_GE (bandwidth_after.readCounter , bandwidth_before.readCounter )
274
+ EXPECT_GT (bandwidth_after.readCounter , bandwidth_before.readCounter )
275
275
<< " Read counter did not increase after workload" ;
276
- EXPECT_GE (bandwidth_after.writeCounter , bandwidth_before.writeCounter )
276
+ EXPECT_GT (bandwidth_after.writeCounter , bandwidth_before.writeCounter )
277
277
<< " 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_GT (bandwidth_after.timestamp , bandwidth_before.timestamp )
279
+ << " Timestamp did not increase after workload" ;
280
+ double percentage_bandwidth =
281
+ 1000000.0 *
283
282
((bandwidth_after.readCounter - bandwidth_before.readCounter ) +
284
283
(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 )));
287
287
// Validate that percentage bandwidth is greater than zero
288
288
LOG_INFO << " Percentage Bandwidth: " << percentage_bandwidth << " %" ;
289
289
EXPECT_GT (percentage_bandwidth, 0.0 )
290
290
<< " 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%" ;
292
293
}
293
294
// Free device memory
294
295
lzt::free_memory (src_ptr);
0 commit comments