| 54 | } |
| 55 | |
| 56 | float run(unsigned kind, unsigned call, size_t threads_number, |
| 57 | size_t alloc_size, unsigned mem_operations_num) |
| 58 | { |
| 59 | TaskFactory task_factory; |
| 60 | std::vector<Thread *> threads; |
| 61 | std::vector<Task *> tasks; |
| 62 | TypesConf func_calls; |
| 63 | TypesConf allocator_types; |
| 64 | |
| 65 | func_calls.enable_type(FunctionCalls::FREE); |
| 66 | func_calls.enable_type(call); |
| 67 | allocator_types.enable_type(kind); |
| 68 | |
| 69 | TaskConf conf = { |
| 70 | mem_operations_num, //number of memory operations |
| 71 | { |
| 72 | mem_operations_num, //number of memory operations |
| 73 | alloc_size, //min. size of single allocation |
| 74 | alloc_size //max. size of single allocatioion |
| 75 | }, |
| 76 | func_calls, //enable function calls |
| 77 | allocator_types, //enable allocators |
| 78 | 11, //random seed |
| 79 | false, //does not log memory operations and statistics to csv file |
| 80 | }; |
| 81 | |
| 82 | for (int i=0; i<threads_number; i++) { |
| 83 | Task *task = task_factory.create(conf); |
| 84 | tasks.push_back(task); |
| 85 | threads.push_back(new Thread(task)); |
| 86 | conf.seed += 1; |
| 87 | } |
| 88 | |
| 89 | ThreadsManager threads_manager(threads); |
| 90 | threads_manager.start(); |
| 91 | threads_manager.barrier(); |
| 92 | |
| 93 | TimeStats time_stats; |
| 94 | for (int i=0; i<tasks.size(); i++) { |
| 95 | time_stats += tasks[i]->get_results(); |
| 96 | } |
| 97 | |
| 98 | return time_stats.stats[kind][call].total_time; |
| 99 | } |
| 100 | |
| 101 | void run_test(unsigned kind, unsigned call, size_t threads_number, |
| 102 | size_t alloc_size, unsigned mem_operations_num) |
nothing calls this directly
no test coverage detected