Browse Source

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)
2upstream
Tanguy Pruvot 10 years ago
parent
commit
7a4e1bb327
  1. 3
      README.txt
  2. 6
      cpu-miner.c
  3. 37
      groestlcoin.cpp
  4. 4
      keccak/keccak256.cu
  5. 2
      quark/animecoin.cu
  6. 4
      qubit/deep.cu
  7. 2
      qubit/doom.cu

3
README.txt

@ -1,5 +1,5 @@ @@ -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. @@ -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

6
cpu-miner.c

@ -1090,9 +1090,11 @@ static void *miner_thread(void *userdata) @@ -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:

37
groestlcoin.cpp

@ -1,18 +1,25 @@ @@ -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) @@ -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; @@ -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)
{
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 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;
// 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 @@ -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 @@ -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 @@ -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;
}

4
keccak/keccak256.cu

@ -44,9 +44,9 @@ extern "C" int scanhash_keccak256(int thr_id, uint32_t *pdata, @@ -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};

2
quark/animecoin.cu

@ -170,7 +170,7 @@ extern "C" int scanhash_anime(int thr_id, uint32_t *pdata, @@ -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};

4
qubit/deep.cu

@ -62,11 +62,11 @@ extern "C" int scanhash_deep(int thr_id, uint32_t *pdata, @@ -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])
{

2
qubit/doom.cu

@ -46,7 +46,7 @@ extern "C" int scanhash_doom(int thr_id, uint32_t *pdata, @@ -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…
Cancel
Save