Skip to content

Commit

Permalink
intensity: sign warnings fixes min(i,u)
Browse files Browse the repository at this point in the history
  • Loading branch information
tpruvot committed Nov 17, 2014
1 parent f5e7745 commit fe4ad36
Show file tree
Hide file tree
Showing 17 changed files with 30 additions and 31 deletions.
2 changes: 1 addition & 1 deletion JHA/jackpotcoin.cu
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ extern "C" int scanhash_jackpot(int thr_id, uint32_t *pdata,
((uint32_t*)ptarget)[7] = 0x000f;

int throughput = opt_work_size ? opt_work_size : (1 << 20); // 256*4096
throughput = min(throughput, max_nonce - first_nonce);
throughput = min(throughput, (int)(max_nonce - first_nonce));

static bool init[8] = {0,0,0,0,0,0,0,0};
if (!init[thr_id])
Expand Down
8 changes: 4 additions & 4 deletions heavy/heavy.cu
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,7 @@ int scanhash_heavy_cpp(int thr_id, uint32_t *pdata,
const uint32_t first_nonce = pdata[19]; /* to check */
// CUDA will process thousands of threads.
int throughput = opt_work_size ? opt_work_size : (1 << 19); // 128*4096
throughput = min(throughput, max_nonce - first_nonce);

if (opt_benchmark)
((uint32_t*)ptarget)[7] = 0x000000ff;
throughput = min(throughput, (int)(max_nonce - first_nonce));

int rc = 0;
uint32_t *hash = NULL;
Expand All @@ -174,6 +171,9 @@ int scanhash_heavy_cpp(int thr_id, uint32_t *pdata,
int nrmCalls[6];
memset(nrmCalls, 0, sizeof(int) * 6);

if (opt_benchmark)
((uint32_t*)ptarget)[7] = 0x000000ff;

// für jeden Hash ein individuelles Target erstellen basierend
// auf dem höchsten Bit, das in ptarget gesetzt ist.
int highbit = findhighbit(ptarget, 8);
Expand Down
2 changes: 1 addition & 1 deletion keccak/keccak256.cu
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ extern "C" int scanhash_keccak256(int thr_id, uint32_t *pdata,
((uint32_t*)ptarget)[7] = 0x0005;

int throughput = opt_work_size ? opt_work_size : (1 << 21); // 256*256*8*4
throughput = min(throughput, max_nonce - first_nonce);
throughput = min(throughput, (int)(max_nonce - first_nonce));

static bool init[8] = {0,0,0,0,0,0,0,0};
if (!init[thr_id]) {
Expand Down
2 changes: 1 addition & 1 deletion pentablake.cu
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ extern "C" int scanhash_pentablake(int thr_id, uint32_t *pdata, const uint32_t *
uint32_t endiandata[20];
int rc = 0;
int throughput = opt_work_size ? opt_work_size : (128 * 2560); // 18.5
throughput = min(throughput, max_nonce - first_nonce);
throughput = min(throughput, (int)(max_nonce - first_nonce));

if (extra_results[0] != MAXU) {
// possible extra result found in previous call
Expand Down
9 changes: 4 additions & 5 deletions quark/animecoin.cu
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,13 @@ extern "C" int scanhash_anime(int thr_id, uint32_t *pdata,
unsigned long *hashes_done)
{
const uint32_t first_nonce = pdata[19];
static bool init[8] = { 0 };
int throughput = opt_work_size ? opt_work_size : (1 << 19); // 256*2048
throughput = min(throughput, (int)(max_nonce - first_nonce));

if (opt_benchmark)
((uint32_t*)ptarget)[7] = 0x00000f;

const uint32_t Htarg = ptarget[7];
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};
if (!init[thr_id])
{
cudaSetDevice(device_map[thr_id]);
Expand Down Expand Up @@ -260,6 +258,7 @@ extern "C" int scanhash_anime(int thr_id, uint32_t *pdata,
if (foundNonce != 0xffffffff)
{
uint32_t vhash64[8];
const uint32_t Htarg = ptarget[7];
be32enc(&endiandata[19], foundNonce);
animehash(vhash64, endiandata);

Expand Down
4 changes: 2 additions & 2 deletions quark/quarkcoin.cu
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ extern "C" int scanhash_quark(int thr_id, uint32_t *pdata,
unsigned long *hashes_done)
{
const uint32_t first_nonce = pdata[19];
static bool init[8] = {0,0,0,0,0,0,0,0};
static bool init[8] = { 0 };

int throughput = opt_work_size ? opt_work_size : (1 << 20); // 256*4096
throughput = min(throughput, max_nonce - first_nonce);
throughput = min(throughput, (int)(max_nonce - first_nonce));

if (opt_benchmark)
((uint32_t*)ptarget)[7] = 0x00F;
Expand Down
2 changes: 1 addition & 1 deletion qubit/deep.cu
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ extern "C" int scanhash_deep(int thr_id, uint32_t *pdata,
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 << 19); // 256*256*8
throughput = min(throughput, max_nonce - first_nonce);
throughput = min(throughput, (int)(max_nonce - first_nonce));

if (opt_benchmark)
((uint32_t*)ptarget)[7] = 0x0000f;
Expand Down
2 changes: 1 addition & 1 deletion qubit/doom.cu
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ extern "C" int scanhash_doom(int thr_id, uint32_t *pdata,
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
throughput = min(throughput, max_nonce - first_nonce);
throughput = min(throughput, (int)(max_nonce - first_nonce));

if (opt_benchmark)
((uint32_t*)ptarget)[7] = 0x0000f;
Expand Down
2 changes: 1 addition & 1 deletion qubit/qubit.cu
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ extern "C" int scanhash_qubit(int thr_id, uint32_t *pdata,
uint32_t endiandata[20];
const uint32_t first_nonce = pdata[19];
int throughput = opt_work_size ? opt_work_size : (1 << 19); // 256*256*8
throughput = min(throughput, max_nonce - first_nonce);
throughput = min(throughput, (int)(max_nonce - first_nonce));

if (opt_benchmark)
((uint32_t*)ptarget)[7] = 0x0000ff;
Expand Down
2 changes: 1 addition & 1 deletion x11/fresh.cu
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ extern "C" int scanhash_fresh(int thr_id, uint32_t *pdata,
uint32_t endiandata[20];

int throughput = opt_work_size ? opt_work_size : (1 << 19); // 256*256*8;
throughput = min(throughput, max_nonce - first_nonce);
throughput = min(throughput, (int) (max_nonce - first_nonce));

if (opt_benchmark)
((uint32_t*)ptarget)[7] = 0x00ff;
Expand Down
10 changes: 5 additions & 5 deletions x11/s3.cu
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ extern "C" int scanhash_s3(int thr_id, uint32_t *pdata,
unsigned long *hashes_done)
{
const uint32_t first_nonce = pdata[19];
static bool init[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };

static bool init[8] = { 0 };
#ifdef WIN32
// reduce a bit the intensity on windows
int throughput = opt_work_size ? opt_work_size : (1 << 19); // 256*256*8;
int intensity = 19; // 256*256*8;
#else
int throughput = opt_work_size ? opt_work_size : (1 << 20); // 256*256*8*2;
int intensity = 20; // 256*256*8*2;
#endif
throughput = min(throughput, max_nonce - first_nonce);
int throughput = opt_work_size ? opt_work_size : (1 << intensity);
throughput = min(throughput, (int)(max_nonce - first_nonce));

if (opt_benchmark)
((uint32_t*)ptarget)[7] = 0xF;
Expand Down
2 changes: 1 addition & 1 deletion x11/x11.cu
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ extern "C" int scanhash_x11(int thr_id, uint32_t *pdata,
static bool init[8] = { 0 };
int intensity = (device_sm[device_map[thr_id]] >= 500) ? 20 : 19;
int throughput = opt_work_size ? opt_work_size : (1 << intensity); // 20=256*256*16;
throughput = min(throughput, max_nonce - first_nonce);
throughput = min(throughput, (int)(max_nonce - first_nonce));

if (opt_benchmark)
((uint32_t*)ptarget)[7] = 0x000f;
Expand Down
2 changes: 1 addition & 1 deletion x13/x13.cu
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ extern "C" int scanhash_x13(int thr_id, uint32_t *pdata,
const uint32_t first_nonce = pdata[19];
static bool init[8] = { 0 };
int throughput = opt_work_size ? opt_work_size : (1 << 19); // 256*256*8;
throughput = min(throughput, max_nonce - first_nonce);
throughput = min(throughput, (int)(max_nonce - first_nonce));

if (opt_benchmark)
((uint32_t*)ptarget)[7] = 0x000f;
Expand Down
2 changes: 1 addition & 1 deletion x15/whirlpool.cu
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ extern "C" int scanhash_whc(int thr_id, uint32_t *pdata,
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 << 19); // 256*256*8;
throughput = min(throughput, max_nonce - first_nonce);
throughput = min(throughput, (int)(max_nonce - first_nonce));

if (opt_benchmark)
((uint32_t*)ptarget)[7] = 0x0000ff;
Expand Down
2 changes: 1 addition & 1 deletion x15/x14.cu
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ extern "C" int scanhash_x14(int thr_id, uint32_t *pdata,
static bool init[8] = { 0 };
uint32_t endiandata[20];
int throughput = opt_work_size ? opt_work_size : (1 << 19); // 256*256*8;
throughput = min(throughput, max_nonce - first_nonce);
throughput = min(throughput, (int)(max_nonce - first_nonce));

if (opt_benchmark)
((uint32_t*)ptarget)[7] = 0x000f;
Expand Down
2 changes: 1 addition & 1 deletion x15/x15.cu
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ extern "C" int scanhash_x15(int thr_id, uint32_t *pdata,
uint32_t endiandata[20];

int throughput = opt_work_size ? opt_work_size : (1 << 19); // 256*256*8;
throughput = min(throughput, max_nonce - first_nonce);
throughput = min(throughput, (int)(max_nonce - first_nonce));

if (opt_benchmark)
((uint32_t*)ptarget)[7] = 0x00FF;
Expand Down
6 changes: 3 additions & 3 deletions x17/x17.cu
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,12 @@ extern "C" int scanhash_x17(int thr_id, uint32_t *pdata,
unsigned long *hashes_done)
{
const uint32_t first_nonce = pdata[19];
static bool init[8] = {0,0,0,0,0,0,0,0};
static bool init[8] = { 0 };
int throughput = opt_work_size ? opt_work_size : (1 << 19); // 256*256*8;
throughput = min(throughput, max_nonce - first_nonce);
throughput = min(throughput, (int)(max_nonce - first_nonce));

if (opt_benchmark)
((uint32_t*)ptarget)[7] = 0x00FF;
((uint32_t*)ptarget)[7] = 0x00ff;

if (!init[thr_id])
{
Expand Down

0 comments on commit fe4ad36

Please sign in to comment.