-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: performance: use common indefinite test runner function
Use common indefinite test runner function bench_run_indef() for all odp_bench_* applications. Reduces the amount of duplicate code. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
- Loading branch information
Showing
7 changed files
with
47 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* SPDX-License-Identifier: BSD-3-Clause | ||
* Copyright (c) 2023 Nokia | ||
*/ | ||
|
||
#include <odp_api.h> | ||
#include <odp/helper/odph_api.h> | ||
|
||
#include "bench_common.h" | ||
|
||
#include <stdint.h> | ||
|
||
void bench_run_indef(bench_info_t *info, odp_atomic_u32_t *exit_thread) | ||
{ | ||
const char *desc; | ||
|
||
desc = info->desc != NULL ? info->desc : info->name; | ||
|
||
printf("Running odp_%s test indefinitely\n", desc); | ||
|
||
while (!odp_atomic_load_u32(exit_thread)) { | ||
int ret; | ||
|
||
if (info->init != NULL) | ||
info->init(); | ||
|
||
ret = info->run(); | ||
|
||
if (info->term != NULL) | ||
info->term(); | ||
|
||
if (!ret) | ||
ODPH_ABORT("Benchmark %s failed\n", desc); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters