Skip to content

Commit 3f4219e

Browse files
committed
Preserve EWLayer timing measurements with SYCL backend
1 parent b3e6a85 commit 3f4219e

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

test/single_layer/test_ewlayer.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,10 +310,16 @@ TEST(ewlayer, parallel_for_direct) {
310310
}
311311

312312
for (auto backend : test_support::all_parallel_backends()) {
313+
auto start = std::chrono::high_resolution_clock::now();
313314
parallel::parallel_for(SIZE * SIZE, [&](std::size_t i) {
314315
result[i] = matrix1[i] + matrix2[i];
315316
}, backend);
316317

318+
auto end = std::chrono::high_resolution_clock::now();
319+
auto total_duration =
320+
std::chrono::duration_cast<std::chrono::milliseconds>(end - start);
321+
(void)total_duration;
322+
317323
for (int i = 0; i < SIZE * SIZE; i++) {
318324
ASSERT_EQ(result[i], 2);
319325
}
@@ -330,10 +336,16 @@ TEST(ewlayer, parallel_for_notmatrix) {
330336
}
331337

332338
for (auto backend : test_support::all_parallel_backends()) {
339+
auto start = std::chrono::high_resolution_clock::now();
333340
parallel::parallel_for(SIZE * SIZE, [&](std::size_t i) {
334341
result[i] = matrix1[i] + 1;
335342
}, backend);
336343

344+
auto end = std::chrono::high_resolution_clock::now();
345+
auto total_duration =
346+
std::chrono::duration_cast<std::chrono::milliseconds>(end - start);
347+
(void)total_duration;
348+
337349
for (int i = 0; i < SIZE * SIZE; i++) {
338350
ASSERT_EQ(result[i], 2);
339351
}

0 commit comments

Comments
 (0)