aboutsummaryrefslogtreecommitdiffstats
path: root/native/include/rw-blocking.h
blob: 7dceabf991b32d44ddcffc12257dbfda1faff599 (plain) (blame)
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
#ifndef RW_BLOCKING_H
#define RW_BLOCKING_H

void split_by_type(const ContentionSet& requests,
		   ContentionSet& reads,
		   ContentionSet& writes);
void split_by_type(const Resources& resources,
		   Resources &reads,
		   Resources &writes);
void split_by_type(const ClusterResources& per_cluster,
		   ClusterResources &reads);
void split_by_type(const ClusterResources& per_cluster,
		   ClusterResources &reads,
		   ClusterResources &writes);

struct RWCount {
	unsigned int res_id;
	unsigned int num_reads;
	unsigned int num_writes;
	unsigned int rlength;
	unsigned int wlength;

	RWCount(unsigned int id) : res_id(id),
				   num_reads(0),
				   num_writes(0),
				   rlength(0),
				   wlength(0)
	{}
};

typedef std::vector<RWCount> RWCounts;

void merge_rw_requests(const TaskInfo &tsk, RWCounts &counts);

#endif