Blame test/allocator_perf_tool/ScenarioWorkload.h
|
Packit Service |
7f3b24 |
// SPDX-License-Identifier: BSD-2-Clause
|
|
Packit Service |
7f3b24 |
/* Copyright (C) 2015 - 2020 Intel Corporation. */
|
|
Packit |
345191 |
#pragma once
|
|
Packit |
345191 |
#include "Workload.hpp"
|
|
Packit |
345191 |
#include "FunctionCalls.hpp"
|
|
Packit |
345191 |
#include "Allocator.hpp"
|
|
Packit |
345191 |
#include "AllocatorFactory.hpp"
|
|
Packit |
345191 |
|
|
Packit |
345191 |
#include <string.h>
|
|
Packit |
345191 |
|
|
Packit |
345191 |
class ScenarioWorkload :
|
|
Packit |
345191 |
public Workload
|
|
Packit |
345191 |
{
|
|
Packit |
345191 |
public:
|
|
Packit |
345191 |
ScenarioWorkload(VectorIterator<Allocator *> *a, VectorIterator<size_t> *as,
|
|
Packit |
345191 |
VectorIterator<int> *fc);
|
|
Packit |
345191 |
~ScenarioWorkload(void);
|
|
Packit |
345191 |
|
|
Packit |
345191 |
double get_time_costs();
|
|
Packit |
345191 |
|
|
Packit |
345191 |
const std::vector<memory_operation> &get_allocations_info() const
|
|
Packit |
345191 |
{
|
|
Packit |
345191 |
return allocations;
|
|
Packit |
345191 |
}
|
|
Packit |
345191 |
|
|
Packit |
345191 |
bool run();
|
|
Packit |
345191 |
|
|
Packit |
345191 |
memory_operation *get_allocated_memory();
|
|
Packit |
345191 |
|
|
Packit |
345191 |
void enable_touch_memory_on_allocation(bool enable)
|
|
Packit |
345191 |
{
|
|
Packit |
345191 |
touch_memory_on_allocation = enable;
|
|
Packit |
345191 |
}
|
|
Packit |
345191 |
|
|
Packit |
345191 |
void post_allocation_check(const memory_operation &data);
|
|
Packit |
345191 |
|
|
Packit |
345191 |
private:
|
|
Packit |
345191 |
AllocatorFactory allocator_factory;
|
|
Packit |
345191 |
std::vector<memory_operation> allocations;
|
|
Packit |
345191 |
|
|
Packit |
345191 |
bool touch_memory_on_allocation;
|
|
Packit |
345191 |
|
|
Packit |
345191 |
VectorIterator<int> *func_calls;
|
|
Packit |
345191 |
VectorIterator<size_t> *alloc_sizes;
|
|
Packit |
345191 |
VectorIterator<Allocator *> *allocators;
|
|
Packit |
345191 |
};
|
|
Packit |
345191 |
|