-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathGpuKang.h
75 lines (60 loc) · 1.2 KB
/
GpuKang.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
75
// This file is a part of RCKangaroo software
// (c) 2024, RetiredCoder (RC)
// License: GPLv3, see "LICENSE.TXT" file
// https://github.com/RetiredC
#pragma once
#include "Ec.h"
#define STATS_WND_SIZE 16
struct EcJMP
{
EcPoint p;
EcInt dist;
};
//96bytes size
struct TPointPriv
{
u64 x[4];
u64 y[4];
u64 priv[4];
};
class RCGpuKang
{
private:
bool StopFlag;
EcPoint PntToSolve;
int Range; //in bits
int DP; //in bits
Ec ec;
u32* DPs_out;
TKparams Kparams;
EcInt HalfRange;
EcPoint PntHalfRange;
EcPoint NegPntHalfRange;
TPointPriv* RndPnts;
EcJMP* EcJumps1;
EcJMP* EcJumps2;
EcJMP* EcJumps3;
EcPoint PntA;
EcPoint PntB;
int cur_stats_ind;
int SpeedStats[STATS_WND_SIZE];
void GenerateRndDistances();
bool Start();
void Release();
#ifdef DEBUG_MODE
int Dbg_CheckKangs();
#endif
public:
int persistingL2CacheMaxSize;
int CudaIndex; //gpu index in cuda
int mpCnt;
int KangCnt;
bool Failed;
bool IsOldGpu;
int CalcKangCnt();
bool Prepare(EcPoint _PntToSolve, int _Range, int _DP, EcJMP* _EcJumps1, EcJMP* _EcJumps2, EcJMP* _EcJumps3);
void Stop();
void Execute();
u32 dbg[256];
int GetStatsSpeed();
};