forked from BeamMW/beam-cuda-miner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Equihash150_5.h
74 lines (65 loc) · 2.53 KB
/
Equihash150_5.h
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
65
66
67
68
69
70
71
72
73
74
#ifndef EQUIHASH150_5_H
#define EQUIHASH150_5_H
static constexpr uint32_t stringCount = 1 << 26;
struct BucketLayout0 {
static constexpr uint32_t bucketCount = 8192;
static constexpr uint32_t maxBucketSize = 8672;
static constexpr uint32_t masking = 8;
static constexpr uint32_t maxBucketSize2 = 1216;
static constexpr uint32_t hastTableSize = 512;
};
struct BucketLayout1 {
static constexpr uint32_t bucketCount = 8192;
static constexpr uint32_t maxBucketSize = 8672;
static constexpr uint32_t masking = 4;
static constexpr uint32_t maxBucketSize2 = 2240;
static constexpr uint32_t hastTableSize = 1024;
};
struct BucketLayout2 {
static constexpr uint32_t bucketCount = 8192;
static constexpr uint32_t maxBucketSize = 8672;
static constexpr uint32_t masking = 4;
static constexpr uint32_t maxBucketSize2 = 2240;
static constexpr uint32_t hastTableSize = 1024;
};
struct BucketLayout3 {
static constexpr uint32_t bucketCount = 8192;
static constexpr uint32_t maxBucketSize = 8672;
static constexpr uint32_t masking = 4;
static constexpr uint32_t maxBucketSize2 = 2240;
static constexpr uint32_t hastTableSize = 1024;
};
struct BucketLayout4 {
static constexpr uint32_t bucketCount = 8192;
static constexpr uint32_t maxBucketSize = 8672;
static constexpr uint32_t masking = 4;
static constexpr uint32_t maxBucketSize2 = 2240;
static constexpr uint32_t hastTableSize = 1024;
static constexpr uint32_t maxCandidateCount = 1024;
};
struct EquihashContext {
static constexpr uint32_t maxSolutionCount = 16;
uint32_t bucketSizes0[BucketLayout0::bucketCount];
uint32_t bucketSizes1[BucketLayout1::bucketCount];
uint32_t bucketSizes2[BucketLayout2::bucketCount];
uint32_t bucketSizes3[BucketLayout3::bucketCount];
uint32_t bucketSizes4[BucketLayout4::bucketCount];
union {
uint8_t buckets0_0[BucketLayout0::bucketCount * BucketLayout0::maxBucketSize * 16];
uint8_t buckets2[BucketLayout2::bucketCount * BucketLayout2::maxBucketSize * 16];
};
union {
uint8_t buckets0_1[BucketLayout0::bucketCount * BucketLayout0::maxBucketSize * 8];
uint8_t buckets4[BucketLayout4::bucketCount * BucketLayout4::maxBucketSize * 16];
};
union {
uint8_t buckets1_0[BucketLayout1::bucketCount * BucketLayout1::maxBucketSize * 16];
uint8_t buckets3[BucketLayout3::bucketCount * BucketLayout3::maxBucketSize * 16];
};
uint8_t buckets1_1[BucketLayout1::bucketCount * BucketLayout1::maxBucketSize * 8];
uint32_t candidateCount;
uint2 candidates[BucketLayout4::maxCandidateCount];
uint32_t solutionCount;
uint32_t solutions[maxSolutionCount * 32];
};
#endif