|
|
|
@ -22,6 +22,7 @@ extern void cuda_check_cpu_setTarget(const void *ptarget);
@@ -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_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 void cudaReportHardwareFailure(int thr_id, cudaError_t error, const char* func); |
|
|
|
|
|
|
|
|
|
extern __device__ __device_builtin__ void __syncthreads(void); |
|
|
|
|
|
|
|
|
@ -122,17 +123,34 @@ __device__ __forceinline__ uint64_t cuda_swab64(uint64_t x)
@@ -122,17 +123,34 @@ __device__ __forceinline__ uint64_t cuda_swab64(uint64_t x)
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
/*********************************************************************/ |
|
|
|
|
// Macro to catch CUDA errors in CUDA runtime calls
|
|
|
|
|
// Macros to catch CUDA errors in CUDA runtime calls
|
|
|
|
|
|
|
|
|
|
#define CUDA_SAFE_CALL(call) \ |
|
|
|
|
do { \ |
|
|
|
|
cudaError_t err = call; \ |
|
|
|
|
if (cudaSuccess != err) { \ |
|
|
|
|
fprintf (stderr, "Cuda error in file '%s' in line %i : %s.\n",\ |
|
|
|
|
__FILE__, __LINE__, cudaGetErrorString(err) ); \ |
|
|
|
|
fprintf(stderr, "Cuda error in func '%s' at line %i : %s.\n", \ |
|
|
|
|
__FUNCTION__, __LINE__, cudaGetErrorString(err) ); \ |
|
|
|
|
exit(EXIT_FAILURE); \ |
|
|
|
|
} \ |
|
|
|
|
} 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 |
|
|
|
|
#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
@@ -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; |
|
|
|
|
} |
|
|
|
|
#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 |
|
|
|
|
|
|
|
|
|
// device asm for x17
|
|
|
|
|