mirror of
https://github.com/JayDDee/cpuminer-opt.git
synced 2025-09-17 23:44:27 +00:00
v3.5.6
This commit is contained in:
@@ -2,13 +2,15 @@
|
||||
#include "miner.h"
|
||||
#include "algo-gate-api.h"
|
||||
#include "lyra2.h"
|
||||
#include "avxdefs.h"
|
||||
|
||||
__thread uint64_t* zoin_wholeMatrix;
|
||||
|
||||
void zoin_hash(void *state, const void *input, uint32_t height)
|
||||
{
|
||||
|
||||
uint32_t _ALIGN(256) hash[16];
|
||||
|
||||
LYRA2Z(hash, 32, input, 80, input, 80, 2, 330, 256);
|
||||
LYRA2Z( zoin_wholeMatrix, hash, 32, input, 80, input, 80, 2, 330, 256);
|
||||
|
||||
memcpy(state, hash, 32);
|
||||
}
|
||||
@@ -53,22 +55,45 @@ void zoin_set_target( struct work* work, double job_diff )
|
||||
{
|
||||
work_set_target( work, job_diff / (256.0 * opt_diff_factor) );
|
||||
}
|
||||
|
||||
/*
|
||||
bool zoin_get_work_height( struct work* work, struct stratum_ctx* sctx )
|
||||
{
|
||||
work->height = sctx->bloc_height;
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
|
||||
bool zoin_thread_init()
|
||||
{
|
||||
const int64_t ROW_LEN_INT64 = BLOCK_LEN_INT64 * 256; // nCols
|
||||
const int64_t ROW_LEN_BYTES = ROW_LEN_INT64 * 8;
|
||||
|
||||
int i = (int64_t)ROW_LEN_BYTES * 330; // nRows;
|
||||
zoin_wholeMatrix = _mm_malloc( i, 64 );
|
||||
|
||||
if ( zoin_wholeMatrix == NULL )
|
||||
return false;
|
||||
|
||||
#if defined (__AVX2__)
|
||||
memset_zero_m256i( (__m256i*)zoin_wholeMatrix, i/32 );
|
||||
#elif defined(__AVX__)
|
||||
memset_zero_m128i( (__m128i*)zoin_wholeMatrix, i/16 );
|
||||
#else
|
||||
memset( zoin_wholeMatrix, 0, i );
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
bool register_zoin_algo( algo_gate_t* gate )
|
||||
{
|
||||
gate->optimizations = SSE2_OPT | AES_OPT | AVX_OPT | AVX2_OPT;
|
||||
gate->miner_thread_init = (void*)&zoin_thread_init;
|
||||
gate->scanhash = (void*)&scanhash_zoin;
|
||||
gate->hash = (void*)&zoin_hash;
|
||||
gate->hash_alt = (void*)&zoin_hash;
|
||||
gate->get_max64 = (void*)&get_max64_0xffffLL;
|
||||
gate->set_target = (void*)&zoin_set_target;
|
||||
gate->prevent_dupes = (void*)&zoin_get_work_height;
|
||||
// gate->prevent_dupes = (void*)&zoin_get_work_height;
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user