Browse Source

whirlpool: add algo free function + vstudio

master
Tanguy Pruvot 9 years ago
parent
commit
5f12943de5
  1. 3
      Algo256/blake256.cu
  2. 1
      ccminer.cpp
  3. 1
      ccminer.vcxproj
  4. 3
      ccminer.vcxproj.filters
  5. 18
      x15/whirlpool.cu

3
Algo256/blake256.cu

@ -461,7 +461,8 @@ extern "C" int scanhash_blake256(int thr_id, struct work* work, uint32_t max_non @@ -461,7 +461,8 @@ extern "C" int scanhash_blake256(int thr_id, struct work* work, uint32_t max_non
if (vhashcpu[6] <= Htarg && fulltest(vhashcpu, ptarget)) {
pdata[21] = extra_results[0];
applog(LOG_BLUE, "1:%x 2:%x", foundNonce, extra_results[0]);
work_set_target_ratio(work, vhashcpu);
if (bn_hash_target_ratio(vhashcpu, ptarget) > work->shareratio)
work_set_target_ratio(work, vhashcpu);
rc = 2;
}
extra_results[0] = UINT32_MAX;

1
ccminer.cpp

@ -1543,6 +1543,7 @@ void miner_free_device(int thr_id) @@ -1543,6 +1543,7 @@ void miner_free_device(int thr_id)
free_skeincoin(thr_id);
free_skein2(thr_id);
free_s3(thr_id);
free_whirl(thr_id);
free_whirlx(thr_id);
free_x11(thr_id);
free_x13(thr_id);

1
ccminer.vcxproj

@ -493,6 +493,7 @@ @@ -493,6 +493,7 @@
<CudaCompile Include="x15\x15.cu" />
<CudaCompile Include="x15\cuda_whirlpoolx.cu" />
<CudaCompile Include="x15\whirlpoolx.cu" />
<CudaCompile Include="x15\whirlpool.cu" />
<CudaCompile Include="x17\x17.cu">
</CudaCompile>
<CudaCompile Include="x17\cuda_x17_haval512.cu">

3
ccminer.vcxproj.filters

@ -556,6 +556,9 @@ @@ -556,6 +556,9 @@
<CudaCompile Include="x15\whirlpoolx.cu">
<Filter>Source Files\CUDA\x15</Filter>
</CudaCompile>
<CudaCompile Include="x15\whirlpool.cu">
<Filter>Source Files\CUDA\x15</Filter>
</CudaCompile>
<CudaCompile Include="x17\cuda_x17_haval512.cu">
<Filter>Source Files\CUDA\x17</Filter>
</CudaCompile>

18
x15/whirlpool.cu

@ -13,6 +13,7 @@ static uint32_t *d_hash[MAX_GPUS]; @@ -13,6 +13,7 @@ static uint32_t *d_hash[MAX_GPUS];
extern void x15_whirlpool_cpu_init(int thr_id, uint32_t threads, int mode);
extern void x15_whirlpool_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order);
extern void x15_whirlpool_cpu_free(int thr_id);
extern void whirlpool512_setBlock_80(void *pdata, const void *ptarget);
extern void whirlpool512_cpu_hash_80(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_hash, int order);
@ -118,3 +119,20 @@ extern "C" int scanhash_whirl(int thr_id, struct work* work, uint32_t max_nonce, @@ -118,3 +119,20 @@ extern "C" int scanhash_whirl(int thr_id, struct work* work, uint32_t max_nonce,
*hashes_done = pdata[19] - first_nonce;
return 0;
}
// cleanup
extern "C" void free_whirl(int thr_id)
{
if (!init[thr_id])
return;
cudaSetDevice(device_map[thr_id]);
cudaFree(d_hash[thr_id]);
x15_whirlpool_cpu_free(thr_id);
init[thr_id] = false;
cudaDeviceSynchronize();
}

Loading…
Cancel
Save