-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathWorkload.hpp
42 lines (34 loc) · 957 Bytes
/
Workload.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef WORKLOAD_HPP
#define WORKLOAD_HPP
#include <cstdint>
#include <cstddef>
#include <vector>
template <typename data_t>
struct Metadata {
public:
size_t size;
data_t minVal;
data_t maxVal;
};
template <typename data_t>
struct Workload {
Metadata<data_t> meta;
std::vector<data_t> data;
public:
size_t size() {return meta.size;}
Metadata<data_t> getMetadata() {return meta;}
std::vector<data_t>& getData() {return &data;}
};
template <typename data_t>
class WorkloadProducer {
public:
static Workload<data_t> get_WL_with_bounds_size(data_t min, data_t max, size_t size, size_t seed = 0);
static Workload<data_t> get_WL_with_bounds(data_t min, data_t max, size_t seed = 0);
static Workload<data_t> get_WL_with_size(size_t size, size_t seed = 0);
};
// template<>
// class WorkloadProducer<float>;
// template<>
// class WorkloadProducer<int32_t>;
#include "Workload_impl.hpp"
#endif /* end of include guard: WORKLOAD_HPP */