-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon.h
More file actions
64 lines (53 loc) · 1.57 KB
/
Copy pathcommon.h
File metadata and controls
64 lines (53 loc) · 1.57 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// Copyright (c) 2019 Vicente Romero Calero. All rights reserved.
// Licensed under the MIT License.
// See LICENSE file in the project root for full license information.
#ifndef INTCOMPBENCH_COMMON_H_
#define INTCOMPBENCH_COMMON_H_
#include <string>
#include <vector>
#include "benchmark/include/benchmark/benchmark.h"
#include "SIMDCompressionAndIntersection/include/codecs.h"
#include "SIMDCompressionAndIntersection/include/variablebyte.h"
struct GlobalState {
static std::string dataDirectory;
};
class CompressionStats {
private:
benchmark::State& _state;
public:
CompressionStats(benchmark::State& state);
void SetInputLengthInBytes(size_t len);
void UpdateInputLengthInBytes(size_t len);
void ResetInputLengthInBytes();
void SetEncodedLengthInBytes(size_t len);
void UpdateEncodedLengthInBytes(size_t len);
void ResetEncodedLengthInBytes();
void SetFinalStats();
void Reset();
};
class SIMDCompressionUtil {
private:
SIMDCompressionLib::VByte<true> _fallbackCodec;
SIMDCompressionLib::IntegerCODEC& _codec;
std::vector<uint32_t>& _data;
size_t _inputLength;
size_t _inputLength1;
size_t _inputLength2;
std::vector<uint32_t> _copyOfData;
std::vector<uint32_t> _encoded;
size_t _encodedLength1;
size_t _encodedLength2;
std::vector<uint32_t> _decoded;
public:
SIMDCompressionUtil(
SIMDCompressionLib::IntegerCODEC& codec,
size_t blockSize,
std::vector<uint32_t>& data);
void Reset();
void Encode();
void Decode();
size_t InputLength();
size_t EncodedLength();
void EqualityCheck();
};
#endif // INTCOMPBENCH_COMMON_H_