Skip to content

Commit

Permalink
bug corrections
Browse files Browse the repository at this point in the history
*correct a bug which was causing brutal gpu usage loss after finding a
share on stratum
* add a uint32 method xandor in cuda_helper to be used in sha256 (faster
than the uint64 original designed for sha512)
  • Loading branch information
djm34 committed May 16, 2015
1 parent 40e79ec commit 821ea07
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ccminer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1283,7 +1283,7 @@ static void *miner_thread(void *userdata)

if (have_stratum) {
uint32_t sleeptime = 0;
while (!work_done && time(NULL) >= (g_work_time + opt_scantime)) {
while (!work_done && time(NULL) >= (g_work_time + 60)) {
usleep(100*1000);
if (sleeptime > 4) {
extrajob = true;
Expand Down
15 changes: 15 additions & 0 deletions cuda_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,21 @@ uint64_t xandx(uint64_t a, uint64_t b, uint64_t c)
return result;
}

__device__ __forceinline__
uint32_t xandx(uint32_t a, uint32_t b, uint32_t c)
{
uint32_t result;
asm("{\n\t"
".reg .u32 n;\n\t"
"xor.b32 %0, %2, %3;\n\t"
"and.b32 n, %0, %1;\n\t"
"xor.b32 %0, n, %3;"
"}\n"
: "=r"(result) : "r"(a), "r"(b), "r"(c));
return result;
}


// device asm for x17
__device__ __forceinline__
uint64_t sph_t64(uint64_t x)
Expand Down

0 comments on commit 821ea07

Please sign in to comment.