-
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 data types
Utilize common data types among 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
6 changed files
with
93 additions
and
122 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,70 @@ | ||
/* SPDX-License-Identifier: BSD-3-Clause | ||
* Copyright (c) 2023 Nokia | ||
*/ | ||
|
||
#ifndef BENCH_COMMON_H | ||
#define BENCH_COMMON_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#include <odp_api.h> | ||
#include <odp/helper/odph_api.h> | ||
|
||
#include <stdint.h> | ||
|
||
/** | ||
* Check benchmark preconditions | ||
* | ||
* @retval !0 test enabled | ||
*/ | ||
typedef int (*bench_cond_fn_t)(void); | ||
|
||
/** | ||
* Initialize benchmark resources | ||
*/ | ||
typedef void (*bench_init_fn_t)(void); | ||
|
||
/** | ||
* Run benchmark | ||
* | ||
* @retval >0 on success | ||
*/ | ||
typedef int (*bench_run_fn_t)(void); | ||
|
||
/** | ||
* Release benchmark resources | ||
*/ | ||
typedef void (*bench_term_fn_t)(void); | ||
|
||
/* Benchmark test data */ | ||
typedef struct { | ||
/* Default test name */ | ||
const char *name; | ||
|
||
/* Optional alternate test description */ | ||
const char *desc; | ||
|
||
/* Optional precondition to run test */ | ||
bench_cond_fn_t cond; | ||
|
||
/* Optional test initializer function */ | ||
bench_init_fn_t init; | ||
|
||
/* Test function to run */ | ||
bench_run_fn_t run; | ||
|
||
/* Optional test terminate function */ | ||
bench_term_fn_t term; | ||
|
||
/* Optional test specific limit for rounds (tuning for slow implementations) */ | ||
uint32_t max_rounds; | ||
|
||
} bench_info_t; | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
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