Skip to content

Commit

Permalink
Likely fix
Browse files Browse the repository at this point in the history
  • Loading branch information
a1i3nj03 committed May 3, 2018
1 parent 02b51fa commit 55cc221
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions x16r/x16r.cu
Original file line number Diff line number Diff line change
Expand Up @@ -449,18 +449,18 @@ extern "C" int x16r_init(int thr_id, uint32_t max_nonce)
CUDA_CALL_OR_RET_X(cudaMalloc(&d_ark[thr_id], sizeof(int)*16), 0);

// CUDA_SAFE_CALL(cudaMalloc(&d_ark[thr_id], sizeof(int)));
*h_ark[thr_id] = 0;
// *h_ark[thr_id] = 0;
if (thr_id == 0)
{
// CUDA_SAFE_CALL(cudaStreamCreate(&streamx[0]));
// CUDA_SAFE_CALL(cudaStreamCreate(&streamk[0]));
// CUDA_SAFE_CALL(cudaStreamCreateWithPriority(&streamk[0], 0, 0));
CUDA_SAFE_CALL(cudaStreamCreateWithPriority(&streamx[0], cudaStreamNonBlocking, -1));
CUDA_SAFE_CALL(cudaStreamCreateWithPriority(&streamx[thr_id], cudaStreamNonBlocking, -1));
}
else
{
while (h_ark[0] == NULL)
sleep(1);
// while (h_ark[0] == NULL)
// sleep(1);
}
// set_lo << <1, 1 >> >(d_ark[thr_id]);
CUDA_SAFE_CALL(cudaMemcpy(d_ark[thr_id], (int*)h_ark[thr_id], sizeof(int)*16, cudaMemcpyHostToDevice));
Expand Down Expand Up @@ -856,7 +856,7 @@ extern "C" void free_x16r(int thr_id)
// ark_reset(thr_id);
cudaFree(d_hash[thr_id]);
// cudaStreamDestroy(streamk[0]);
cudaStreamDestroy(streamx[0]);
cudaStreamDestroy(streamx[thr_id]);

quark_blake512_cpu_free(thr_id);
quark_groestl512_cpu_free(thr_id);
Expand Down Expand Up @@ -914,7 +914,7 @@ __host__ void ark_switch(int thr_id)
{
*h_ark[thr_id] = 1;
#ifdef A1MIN3R_MOD
CUDA_SAFE_CALL(cudaMemsetAsync(d_ark[thr_id], 1, 1, streamx[0]));
CUDA_SAFE_CALL(cudaMemsetAsync(d_ark[thr_id], 1, 1, streamx[thr_id]));
// CUDA_SAFE_CALL(cudaMemcpyAsync(d_ark[thr_id], (int*)h_ark[thr_id], sizeof(int), cudaMemcpyHostToDevice, streamx[0]));
#endif
}
Expand All @@ -939,7 +939,7 @@ __host__ int ark_reset(int thr_id)
// CUDA_SAFE_CALL(cudaMemcpyToSymbolAsync(d_ark[thr_id], (int*)h_ark[thr_id], sizeof(int), 0, cudaMemcpyHostToDevice, streamx[thr_id]));
*h_ark[thr_id] = 0;
#ifdef A1MIN3R_MOD
CUDA_SAFE_CALL(cudaMemsetAsync(d_ark[thr_id], 0, 1, streamx[0]));
CUDA_SAFE_CALL(cudaMemsetAsync(d_ark[thr_id], 0, 1, streamx[thr_id]));
// CUDA_SAFE_CALL(cudaMemcpyAsync(d_ark[thr_id], (int*)h_ark[thr_id], sizeof(int), cudaMemcpyHostToDevice, 0));
#endif
return 1;
Expand Down

0 comments on commit 55cc221

Please sign in to comment.