mirror of
https://github.com/GOSTSec/ccminer
synced 2025-01-22 12:34:17 +00:00
Reduce keccak, deep & anime intensity + handle groestl -i param
default intensity was the max supported by the card, and perf is not really better. I prefer to let it one under for cards with lower memory (1GB)
This commit is contained in:
parent
98451267d8
commit
7a4e1bb327
@ -1,5 +1,5 @@
|
||||
|
||||
ccMiner release 1.4.7-tpruvot (Nov 2014) - "Blake update"
|
||||
ccMiner release 1.4.7-tpruvot (Nov 2014) - "Blake Intensity"
|
||||
---------------------------------------------------------------
|
||||
|
||||
***************************************************************
|
||||
@ -158,6 +158,7 @@ features.
|
||||
Rewrite blake algo
|
||||
Add the -i (gpu threads/intensity parameter)
|
||||
Add some X11 optimisations based on sp_ commits
|
||||
Fix quark reported hashrate and benchmark mode for some algos
|
||||
Update windows prebuilt curl to 7.38.0
|
||||
|
||||
Oct. 26th 2014 v1.4.6
|
||||
|
@ -1090,9 +1090,11 @@ static void *miner_thread(void *userdata)
|
||||
case ALGO_BLAKECOIN:
|
||||
max64 = 0x3ffffffLL;
|
||||
break;
|
||||
case ALGO_JACKPOT:
|
||||
case ALGO_BLAKE:
|
||||
/* based on the 750Ti hashrate (100kH) */
|
||||
case ALGO_DOOM:
|
||||
case ALGO_JACKPOT:
|
||||
case ALGO_KECCAK:
|
||||
case ALGO_LUFFA_DOOM:
|
||||
max64 = 0x1ffffffLL;
|
||||
break;
|
||||
default:
|
||||
|
@ -1,18 +1,25 @@
|
||||
#include "uint256.h"
|
||||
#include "sph/sph_groestl.h"
|
||||
|
||||
#include "cpuminer-config.h"
|
||||
#include "miner.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
#include "cuda_groestlcoin.h"
|
||||
#include <algorithm>
|
||||
#include <openssl/sha.h>
|
||||
|
||||
#include "cuda_groestlcoin.h"
|
||||
|
||||
#define SWAP32(x) \
|
||||
((((x) << 24) & 0xff000000u) | (((x) << 8) & 0x00ff0000u) | \
|
||||
(((x) >> 8) & 0x0000ff00u) | (((x) >> 24) & 0x000000ffu))
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define MIN min
|
||||
#else
|
||||
#define MIN std::min
|
||||
#endif
|
||||
|
||||
void sha256func(unsigned char *hash, const unsigned char *data, int len)
|
||||
{
|
||||
uint32_t S[16], T[16];
|
||||
@ -48,7 +55,6 @@ extern "C" void groestlhash(void *state, const void *input)
|
||||
//these uint512 in the c++ source of the client are backed by an array of uint32
|
||||
uint32_t hashA[16], hashB[16];
|
||||
|
||||
|
||||
sph_groestl512_init(&ctx_groestl[0]);
|
||||
sph_groestl512 (&ctx_groestl[0], input, 80); //6
|
||||
sph_groestl512_close(&ctx_groestl[0], hashA); //7
|
||||
@ -65,15 +71,15 @@ extern bool opt_benchmark;
|
||||
extern "C" int scanhash_groestlcoin(int thr_id, uint32_t *pdata, const uint32_t *ptarget,
|
||||
uint32_t max_nonce, unsigned long *hashes_done)
|
||||
{
|
||||
uint32_t start_nonce = pdata[19]++;
|
||||
uint32_t throughPut = opt_work_size ? opt_work_size : (1 << 19); // 256*2048
|
||||
throughPut = MIN(throughPut, max_nonce - start_nonce);
|
||||
|
||||
uint32_t *outputHash = (uint32_t*)malloc(throughPut * 16 * sizeof(uint32_t));
|
||||
|
||||
if (opt_benchmark)
|
||||
((uint32_t*)ptarget)[7] = 0x000000ff;
|
||||
|
||||
uint32_t start_nonce = pdata[19]++;
|
||||
const uint32_t Htarg = ptarget[7];
|
||||
const uint32_t throughPut = 4096 * 128;
|
||||
//const uint32_t throughPut = 1;
|
||||
uint32_t *outputHash = (uint32_t*)malloc(throughPut * 16 * sizeof(uint32_t));
|
||||
|
||||
// init
|
||||
static bool init[8] = { false, false, false, false, false, false, false, false };
|
||||
if(!init[thr_id])
|
||||
@ -93,6 +99,7 @@ extern "C" int scanhash_groestlcoin(int thr_id, uint32_t *pdata, const uint32_t
|
||||
do {
|
||||
// GPU
|
||||
uint32_t foundNounce = 0xFFFFFFFF;
|
||||
const uint32_t Htarg = ptarget[7];
|
||||
|
||||
groestlcoin_cpu_hash(thr_id, throughPut, pdata[19], outputHash, &foundNounce);
|
||||
|
||||
@ -101,11 +108,11 @@ extern "C" int scanhash_groestlcoin(int thr_id, uint32_t *pdata, const uint32_t
|
||||
uint32_t tmpHash[8];
|
||||
endiandata[19] = SWAP32(foundNounce);
|
||||
groestlhash(tmpHash, endiandata);
|
||||
if (tmpHash[7] <= Htarg &&
|
||||
fulltest(tmpHash, ptarget)) {
|
||||
pdata[19] = foundNounce;
|
||||
*hashes_done = foundNounce - start_nonce;
|
||||
free(outputHash);
|
||||
|
||||
if (tmpHash[7] <= Htarg && fulltest(tmpHash, ptarget)) {
|
||||
pdata[19] = foundNounce;
|
||||
*hashes_done = foundNounce - start_nonce + 1;
|
||||
free(outputHash);
|
||||
return true;
|
||||
} else {
|
||||
applog(LOG_INFO, "GPU #%d: result for nonce $%08X does not validate on CPU!", thr_id, foundNounce);
|
||||
@ -120,7 +127,7 @@ extern "C" int scanhash_groestlcoin(int thr_id, uint32_t *pdata, const uint32_t
|
||||
|
||||
} while (pdata[19] < max_nonce && !work_restart[thr_id].restart);
|
||||
|
||||
*hashes_done = pdata[19] - start_nonce;
|
||||
*hashes_done = pdata[19] - start_nonce + 1;
|
||||
free(outputHash);
|
||||
return 0;
|
||||
}
|
||||
|
@ -44,9 +44,9 @@ extern "C" int scanhash_keccak256(int thr_id, uint32_t *pdata,
|
||||
const uint32_t first_nonce = pdata[19];
|
||||
|
||||
if (opt_benchmark)
|
||||
((uint32_t*)ptarget)[7] = 0x000f;
|
||||
((uint32_t*)ptarget)[7] = 0x0005;
|
||||
|
||||
int throughput = opt_work_size ? opt_work_size : (1 << 22); // 256*256*8*8
|
||||
int throughput = opt_work_size ? opt_work_size : (1 << 21); // 256*256*8*4
|
||||
throughput = min(throughput, max_nonce - first_nonce);
|
||||
|
||||
static bool init[8] = {0,0,0,0,0,0,0,0};
|
||||
|
@ -170,7 +170,7 @@ extern "C" int scanhash_anime(int thr_id, uint32_t *pdata,
|
||||
((uint32_t*)ptarget)[7] = 0x00000f;
|
||||
|
||||
const uint32_t Htarg = ptarget[7];
|
||||
int throughput = opt_work_size ? opt_work_size : (1 << 20); // 256*2048*2
|
||||
int throughput = opt_work_size ? opt_work_size : (1 << 19); // 256*2048
|
||||
throughput = min(throughput, max_nonce - first_nonce);
|
||||
|
||||
static bool init[8] = {0,0,0,0,0,0,0,0};
|
||||
|
@ -62,11 +62,11 @@ extern "C" int scanhash_deep(int thr_id, uint32_t *pdata,
|
||||
const uint32_t first_nonce = pdata[19];
|
||||
static bool init[8] = {0,0,0,0,0,0,0,0};
|
||||
uint32_t endiandata[20];
|
||||
int throughput = opt_work_size ? opt_work_size : (1 << 22); // 256*256*8*8
|
||||
int throughput = opt_work_size ? opt_work_size : (1 << 19); // 256*256*8
|
||||
throughput = min(throughput, max_nonce - first_nonce);
|
||||
|
||||
if (opt_benchmark)
|
||||
((uint32_t*)ptarget)[7] = 0x0000ff;
|
||||
((uint32_t*)ptarget)[7] = 0x0000f;
|
||||
|
||||
if (!init[thr_id])
|
||||
{
|
||||
|
@ -46,7 +46,7 @@ extern "C" int scanhash_doom(int thr_id, uint32_t *pdata,
|
||||
throughput = min(throughput, max_nonce - first_nonce);
|
||||
|
||||
if (opt_benchmark)
|
||||
((uint32_t*)ptarget)[7] = 0x0000ff;
|
||||
((uint32_t*)ptarget)[7] = 0x0000f;
|
||||
|
||||
if (!init[thr_id])
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user