Skip to content
Snippets Groups Projects
Unverified Commit b5d38909 authored by fireice-uk's avatar fireice-uk Committed by GitHub
Browse files

Merge pull request #1821 from psychocrypt/topic-simplefyMultihashImplementation_defines

unify cpu cryptonight implementations
parents 23375bb8 931bd5fe
No related branches found
No related tags found
No related merge requests found
......@@ -252,7 +252,7 @@ void minethd::work_main()
*(uint32_t*)(bWorkBlob + 39) = results[i];
hash_fun(bWorkBlob, oWork.iWorkSize, bResult, cpu_ctx);
hash_fun(bWorkBlob, oWork.iWorkSize, bResult, &cpu_ctx);
if ( (*((uint64_t*)(bResult + 24))) < oWork.iTarget)
executor::inst()->push_event(ex_event(job_result(oWork.sJobID, results[i], bResult, iThreadNo, miner_algo), oWork.iPoolId));
else
......
......@@ -24,7 +24,7 @@ public:
static bool init_gpus();
private:
typedef void (*cn_hash_fun)(const void*, size_t, void*, cryptonight_ctx*);
typedef void (*cn_hash_fun)(const void*, size_t, void*, cryptonight_ctx**);
minethd(miner_work& pWork, size_t iNo, GpuContext* ctx, const jconf::thd_cfg cfg);
......
This diff is collapsed.
This diff is collapsed.
......@@ -22,7 +22,7 @@ public:
static std::vector<iBackend*> thread_starter(uint32_t threadOffset, miner_work& pWork);
static bool self_test();
typedef void (*cn_hash_fun)(const void*, size_t, void*, cryptonight_ctx*);
typedef void (*cn_hash_fun)(const void*, size_t, void*, cryptonight_ctx**);
static cn_hash_fun func_selector(bool bHaveAes, bool bNoPrefetch, xmrstak_algo algo);
static bool thd_setaffinity(std::thread::native_handle_type h, uint64_t cpu_id);
......@@ -30,8 +30,9 @@ public:
static cryptonight_ctx* minethd_alloc_ctx();
private:
typedef void (*cn_hash_fun_multi)(const void*, size_t, void*, cryptonight_ctx**);
static cn_hash_fun_multi func_multi_selector(size_t N, bool bHaveAes, bool bNoPrefetch, xmrstak_algo algo);
template<size_t N>
static cn_hash_fun func_multi_selector(bool bHaveAes, bool bNoPrefetch, xmrstak_algo algo);
minethd(miner_work& pWork, size_t iNo, int iMultiway, bool no_prefetch, int64_t affinity);
......
......@@ -300,7 +300,7 @@ void minethd::work_main()
*(uint32_t*)(bWorkBlob + 39) = foundNonce[i];
hash_fun(bWorkBlob, oWork.iWorkSize, bResult, cpu_ctx);
hash_fun(bWorkBlob, oWork.iWorkSize, bResult, &cpu_ctx);
if ( (*((uint64_t*)(bResult + 24))) < oWork.iTarget)
executor::inst()->push_event(ex_event(job_result(oWork.sJobID, foundNonce[i], bResult, iThreadNo, miner_algo), oWork.iPoolId));
else
......
......@@ -28,7 +28,7 @@ public:
static bool self_test();
private:
typedef void (*cn_hash_fun)(const void*, size_t, void*, cryptonight_ctx*);
typedef void (*cn_hash_fun)(const void*, size_t, void*, cryptonight_ctx**);
minethd(miner_work& pWork, size_t iNo, const jconf::thd_cfg& cfg);
void start_mining();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment