forked from mhssamadani/Autolykos2_AMD_Miner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
clMining.h
executable file
·54 lines (47 loc) · 963 Bytes
/
clMining.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
#pragma once
#include "definitions.h"
#include "cl_warpper.h"
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
class MiningClass
{
CLWarpper *cl ;
cl_kernel kernel;
std::shared_ptr<CLProgram> program;
public:
MiningClass(CLWarpper *cll);
~MiningClass();
// unfinalized hash of message
void InitMining(
// context
ctx_t * ctx,
// message
const cl_uint * mes,
// message length in bytes
const cl_uint meslen
);
// block mining iteration
void hBlockMining(
// boundary for puzzle
cl_mem bound,
// data: mes
cl_mem mes,
// nonce base
const cl_ulong base,
const cl_ulong endNonce,
// block height
const cl_uint height,
// precalculated hashes
cl_mem hashes,
// indices of valid solutions
cl_mem valid,
cl_mem vCount,
uint64_t N_LEN,
cl_mem BHashes = NULL
);
};