]> pd.if.org Git - liblfds/blob - liblfds/liblfds7.1.0/test_and_benchmark/libbenchmark/src/libbenchmark_benchmarkinstance/libbenchmark_benchmarkinstance_init.c
Initial import (all versions, including the new 7.1.0)
[liblfds] / liblfds / liblfds7.1.0 / test_and_benchmark / libbenchmark / src / libbenchmark_benchmarkinstance / libbenchmark_benchmarkinstance_init.c
1 /***** includes *****/
2 #include "libbenchmark_benchmarkinstance_internal.h"
3
4
5
6
7
8 /****************************************************************************/
9 void libbenchmark_benchmarkinstance_init( struct libbenchmark_benchmarkinstance_state *bs,
10                                           enum libbenchmark_datastructure_id datastructure_id,
11                                           enum libbenchmark_benchmark_id benchmark_id,
12                                           enum libbenchmark_lock_id lock_id,
13                                           struct libbenchmark_topology_state *ts,
14                                           void (*init_function)( struct libbenchmark_topology_state *ts,
15                                                                  struct lfds710_list_aso_state *logical_processor_set,
16                                                                  struct libshared_memory_state *ms,
17                                                                  enum libbenchmark_topology_numa_mode numa_node,
18                                                                  struct libbenchmark_threadset_state *tsets ),
19                                           void (*cleanup_function)( struct lfds710_list_aso_state *logical_processor_set,
20                                                                     enum libbenchmark_topology_numa_mode numa_node,
21                                                                     struct libbenchmark_results_state *rs,
22                                                                     struct libbenchmark_threadset_state *tsets ) )
23 {
24   LFDS710_PAL_ASSERT( bs != NULL );
25   // TRD : datastructure_id can be any value in its range
26   // TRD : benchmark_id can be any value in its range
27   // TRD : lock_id can be any value in its range
28   LFDS710_PAL_ASSERT( ts != NULL );
29   LFDS710_PAL_ASSERT( init_function != NULL );
30   LFDS710_PAL_ASSERT( cleanup_function != NULL );
31
32   bs->datastructure_id = datastructure_id;
33   bs->benchmark_id = benchmark_id;
34   bs->lock_id = lock_id;
35   bs->ts = ts;
36   bs->init_function = init_function;
37   bs->cleanup_function = cleanup_function;
38
39   return;
40 }
41