|
|
@ -22,6 +22,7 @@ extern void cuda_check_cpu_setTarget(const void *ptarget); |
|
|
|
extern uint32_t cuda_check_cpu_hash_64(int thr_id, int threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_inputHash, int order); |
|
|
|
extern uint32_t cuda_check_cpu_hash_64(int thr_id, int threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_inputHash, int order); |
|
|
|
extern uint32_t cuda_check_hash_fast(int thr_id, int threads, uint32_t startNounce, uint32_t *d_inputHash, int order); |
|
|
|
extern uint32_t cuda_check_hash_fast(int thr_id, int threads, uint32_t startNounce, uint32_t *d_inputHash, int order); |
|
|
|
extern cudaError_t MyStreamSynchronize(cudaStream_t stream, int situation, int thr_id); |
|
|
|
extern cudaError_t MyStreamSynchronize(cudaStream_t stream, int situation, int thr_id); |
|
|
|
|
|
|
|
extern void cudaReportHardwareFailure(int thr_id, cudaError_t error, const char* func); |
|
|
|
|
|
|
|
|
|
|
|
extern __device__ __device_builtin__ void __syncthreads(void); |
|
|
|
extern __device__ __device_builtin__ void __syncthreads(void); |
|
|
|
|
|
|
|
|
|
|
@ -122,17 +123,34 @@ __device__ __forceinline__ uint64_t cuda_swab64(uint64_t x) |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
/*********************************************************************/ |
|
|
|
/*********************************************************************/ |
|
|
|
// Macro to catch CUDA errors in CUDA runtime calls
|
|
|
|
// Macros to catch CUDA errors in CUDA runtime calls
|
|
|
|
|
|
|
|
|
|
|
|
#define CUDA_SAFE_CALL(call) \ |
|
|
|
#define CUDA_SAFE_CALL(call) \ |
|
|
|
do { \ |
|
|
|
do { \ |
|
|
|
cudaError_t err = call; \ |
|
|
|
cudaError_t err = call; \ |
|
|
|
if (cudaSuccess != err) { \ |
|
|
|
if (cudaSuccess != err) { \ |
|
|
|
fprintf (stderr, "Cuda error in file '%s' in line %i : %s.\n",\ |
|
|
|
fprintf(stderr, "Cuda error in func '%s' at line %i : %s.\n", \ |
|
|
|
__FILE__, __LINE__, cudaGetErrorString(err) ); \ |
|
|
|
__FUNCTION__, __LINE__, cudaGetErrorString(err) ); \ |
|
|
|
exit(EXIT_FAILURE); \ |
|
|
|
exit(EXIT_FAILURE); \ |
|
|
|
} \ |
|
|
|
} \ |
|
|
|
} while (0) |
|
|
|
} while (0) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define CUDA_CALL_OR_RET(call) do { \ |
|
|
|
|
|
|
|
cudaError_t err = call; \ |
|
|
|
|
|
|
|
if (cudaSuccess != err) { \ |
|
|
|
|
|
|
|
cudaReportHardwareFailure(thr_id, err, __FUNCTION__); \ |
|
|
|
|
|
|
|
return; \ |
|
|
|
|
|
|
|
} \ |
|
|
|
|
|
|
|
} while (0) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define CUDA_CALL_OR_RET_X(call, ret) do { \ |
|
|
|
|
|
|
|
cudaError_t err = call; \ |
|
|
|
|
|
|
|
if (cudaSuccess != err) { \ |
|
|
|
|
|
|
|
cudaReportHardwareFailure(thr_id, err, __FUNCTION__); \ |
|
|
|
|
|
|
|
return ret; \ |
|
|
|
|
|
|
|
} \ |
|
|
|
|
|
|
|
} while (0) |
|
|
|
|
|
|
|
|
|
|
|
/*********************************************************************/ |
|
|
|
/*********************************************************************/ |
|
|
|
#ifdef _WIN64 |
|
|
|
#ifdef _WIN64 |
|
|
|
#define USE_XOR_ASM_OPTS 0 |
|
|
|
#define USE_XOR_ASM_OPTS 0 |
|
|
@ -185,7 +203,7 @@ uint64_t xor8(uint64_t a, uint64_t b, uint64_t c, uint64_t d,uint64_t e,uint64_t |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
#else |
|
|
|
#else |
|
|
|
#define xor8(a,b,c,d,e,f,g,h) (a^b^c^d^e^f^g^h) |
|
|
|
#define xor8(a,b,c,d,e,f,g,h) ((a^b)^(c^d)^(e^f)^(g^h)) |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
// device asm for x17
|
|
|
|
// device asm for x17
|
|
|
|