Browse Source

groestl: tabs to space + arch check

master
Tanguy Pruvot 10 years ago
parent
commit
be478bd725
  1. 13
      cuda_groestlcoin.cu

13
cuda_groestlcoin.cu

@ -4,9 +4,9 @@ @@ -4,9 +4,9 @@
#include <memory.h>
#include "cuda_helper.h"
#include <host_defines.h>
// globaler Speicher für alle HeftyHashes aller Threads
#include "miner.h"
__constant__ uint32_t pTarget[8]; // Single GPU
__constant__ uint32_t groestlcoin_gpu_msg[32];
@ -96,13 +96,15 @@ void groestlcoin_gpu_hash_quad(uint32_t threads, uint32_t startNounce, uint32_t @@ -96,13 +96,15 @@ void groestlcoin_gpu_hash_quad(uint32_t threads, uint32_t startNounce, uint32_t
__host__
void groestlcoin_cpu_init(int thr_id, uint32_t threads)
{
// to check if the binary supports SM3+
cuda_get_arch(thr_id);
cudaMalloc(&d_resultNonce[thr_id], sizeof(uint32_t));
}
__host__
void groestlcoin_cpu_setBlock(int thr_id, void *data, void *pTargetIn)
{
// Nachricht expandieren und setzen
uint32_t msgBlock[32];
memset(msgBlock, 0, sizeof(uint32_t) * 32);
@ -143,9 +145,10 @@ void groestlcoin_cpu_hash(int thr_id, uint32_t threads, uint32_t startNounce, vo @@ -143,9 +145,10 @@ void groestlcoin_cpu_hash(int thr_id, uint32_t threads, uint32_t startNounce, vo
// Größe des dynamischen Shared Memory Bereichs
size_t shared_size = 0;
if (device_sm[device_map[thr_id]] < 300) {
int dev_id = device_map[thr_id];
if (device_sm[dev_id] < 300 || cuda_arch[dev_id] < 300) {
printf("Sorry, This algo is not supported by this GPU arch (SM 3.0 required)");
return;
proper_exit(EXIT_CODE_CUDA_ERROR);
}
cudaMemset(d_resultNonce[thr_id], 0xFF, sizeof(uint32_t));

Loading…
Cancel
Save