forked from valar999/x16r
/
gpuminer.go
53 lines (45 loc) · 988 Bytes
/
gpuminer.go
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
package worker
/*
import "github.com/xfong/go2opencl/cl"
//
type GpuMiner struct {
platform *cl.Platform
context *cl.Context
program *cl.Program
devices []*cl.Device // all devices
deviceworkers []*GpuMinerDeviceWorkerContext
// config
openclPath string
rebuild bool
platName string
groupNum int
groupSize int
itemLoop int
emptyFuncTest bool
useOneDeviceBuild bool
}
// 初始化
func NewGpuMiner(
openclPath string,
platName string,
groupSize int,
groupNum int, // 1 ~ 64
itemLoop int, // 20 ~ 100
useOneDeviceBuild bool,
rebuild bool,
emptyFuncTest bool,
) *GpuMiner {
miner := &GpuMiner{
openclPath: openclPath,
platName: platName,
rebuild: rebuild,
emptyFuncTest: emptyFuncTest,
useOneDeviceBuild: useOneDeviceBuild,
groupSize: groupSize,
groupNum: groupNum,
itemLoop: itemLoop,
}
// create success
return miner
}
*/