MCPcopy Create free account
hub / github.com/brichard19/BitCrack / init

Method init

CudaKeySearchDevice/CudaKeySearchDevice.cpp:61–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61void CudaKeySearchDevice::init(const secp256k1::uint256 &start, int compression, const secp256k1::uint256 &stride)
62{
63 if(start.cmp(secp256k1::N) >= 0) {
64 throw KeySearchException("Starting key is out of range");
65 }
66
67 _startExponent = start;
68
69 _compression = compression;
70
71 _stride = stride;
72
73 cudaCall(cudaSetDevice(_device));
74
75 // Block on kernel calls
76 cudaCall(cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync));
77
78 // Use a larger portion of shared memory for L1 cache
79 cudaCall(cudaDeviceSetCacheConfig(cudaFuncCachePreferL1));
80
81 generateStartingPoints();
82
83 cudaCall(allocateChainBuf(_threads * _blocks * _pointsPerThread));
84
85 // Set the incrementor
86 secp256k1::ecpoint g = secp256k1::G();
87 secp256k1::ecpoint p = secp256k1::multiplyPoint(secp256k1::uint256((uint64_t)_threads * _blocks * _pointsPerThread) * _stride, g);
88
89 cudaCall(_resultList.init(sizeof(CudaDeviceResult), 16));
90
91 cudaCall(setIncrementorPoint(p.x, p.y));
92}
93
94
95void CudaKeySearchDevice::generateStartingPoints()

Callers 1

Calls 4

KeySearchExceptionClass · 0.85
GFunction · 0.85
uint256Class · 0.85
cmpMethod · 0.80

Tested by

no test coverage detected