Blame memkind-1.10.1/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 Service 7f3b24
#pragma once
Packit Service 7f3b24
#include "Workload.hpp"
Packit Service 7f3b24
#include "FunctionCalls.hpp"
Packit Service 7f3b24
#include "Allocator.hpp"
Packit Service 7f3b24
#include "AllocatorFactory.hpp"
Packit Service 7f3b24
Packit Service 7f3b24
#include <string.h>
Packit Service 7f3b24
Packit Service 7f3b24
class ScenarioWorkload :
Packit Service 7f3b24
    public Workload
Packit Service 7f3b24
{
Packit Service 7f3b24
public:
Packit Service 7f3b24
    ScenarioWorkload(VectorIterator<Allocator *> *a, VectorIterator<size_t> *as,
Packit Service 7f3b24
                     VectorIterator<int> *fc);
Packit Service 7f3b24
    ~ScenarioWorkload(void);
Packit Service 7f3b24
Packit Service 7f3b24
    double get_time_costs();
Packit Service 7f3b24
Packit Service 7f3b24
    const std::vector<memory_operation> &get_allocations_info() const
Packit Service 7f3b24
    {
Packit Service 7f3b24
        return allocations;
Packit Service 7f3b24
    }
Packit Service 7f3b24
Packit Service 7f3b24
    bool run();
Packit Service 7f3b24
Packit Service 7f3b24
    memory_operation *get_allocated_memory();
Packit Service 7f3b24
Packit Service 7f3b24
    void enable_touch_memory_on_allocation(bool enable)
Packit Service 7f3b24
    {
Packit Service 7f3b24
        touch_memory_on_allocation = enable;
Packit Service 7f3b24
    }
Packit Service 7f3b24
Packit Service 7f3b24
    void post_allocation_check(const memory_operation &data);
Packit Service 7f3b24
Packit Service 7f3b24
private:
Packit Service 7f3b24
    AllocatorFactory allocator_factory;
Packit Service 7f3b24
    std::vector<memory_operation> allocations;
Packit Service 7f3b24
Packit Service 7f3b24
    bool touch_memory_on_allocation;
Packit Service 7f3b24
Packit Service 7f3b24
    VectorIterator<int> *func_calls;
Packit Service 7f3b24
    VectorIterator<size_t> *alloc_sizes;
Packit Service 7f3b24
    VectorIterator<Allocator *> *allocators;
Packit Service 7f3b24
};
Packit Service 7f3b24