forked from slakov/zcash-gpu-miner
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
69 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
'use strict' | ||
|
||
const blake2 = require('blake2') | ||
|
||
let eh_index | ||
let eh_trunc | ||
|
||
var Equihash = function (N, K) { | ||
var IndicesPerHashOutput = 512/N | ||
var HashOutput = IndicesPerHashOutput*N/8 | ||
var CollisionBitLength = N/(K+1) | ||
var CollisionByteLength = (CollisionBitLength+7)/8 | ||
var HashLength = (K+1)*CollisionByteLength | ||
// figure out sizeof(eh_index) | ||
var FullWidth = 2*CollisionByteLength+eh_index.length*(1 << (K-1)) | ||
// figure out max | ||
var TrunctatedWidth = max(HashLength+sizeof(eh_trunc), 2*CollisionByteLength+sizeof(eh_trunc)*(1 << (K-1))) | ||
var FinalTruncatedWidth = max(HashLength+sizeof(eh_trunc), 2*CollisionByteLength+sizeof(eh_trunc)*(1 << (K))) | ||
var SolutionWidth = (1 << K)*(CollisionBitLength+1)/8 | ||
|
||
|
||
|
||
Equihash.prototype.InitializeState = (base_state) => { | ||
|
||
} | ||
|
||
Equihash.prototype.BasicSolve = () => { | ||
|
||
} | ||
|
||
exports.Equihash = Equihash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
'use strict' | ||
|
||
const nooocl = require('nooocl') | ||
const CLHost = nooocl.CLHost | ||
const CLContext = nooocl.CLContext | ||
const CLCommandQueue = nooocl.CLCommandQueue | ||
const clCreateProgramWithSource = nooocl.clCreateProgramWithSource | ||
const NDRange = nooocl.NDRange | ||
const CLBuffer = nooocl.CLBuffer | ||
|
||
let device | ||
|
||
var opencl = function () { | ||
|
||
} | ||
|
||
opencl.prototype.connect = (device) => { | ||
if (device === undefined) { | ||
this.device = 'gpu' | ||
} | ||
|
||
var host = CLHost.createV12() | ||
host = new CLHost(1.2) | ||
|
||
var platform = host.getPlatforms()[0] | ||
|
||
if(this.device === 'gpu') { | ||
this.device = platform.gpuDevices()[0] | ||
} else { | ||
this.device = platform.cpuDevices()[0] | ||
} | ||
|
||
} | ||
|
||
exports.opencl = opencl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters