53 #ifndef ROCRAND_THREEFRY_COMMON_H_
54 #define ROCRAND_THREEFRY_COMMON_H_
56 #include "rocrand/rocrand_common.h"
59 #define SKEIN_MK_64(hi32, lo32) ((lo32) + (((unsigned long long)(hi32)) << 32))
60 #define SKEIN_KS_PARITY64 SKEIN_MK_64(0x1BD11BDA, 0xA9FC1A22)
61 #define SKEIN_KS_PARITY32 0x1BD11BDA
63 namespace rocrand_device
66 template<
typename value>
67 __forceinline__ __device__ __host__ value rotl(value x,
int d);
70 __forceinline__ __device__ __host__
unsigned long long
71 rotl<unsigned long long>(
unsigned long long x,
int d)
73 return ((x << d) | (x >> (64 - d) & 63));
77 __forceinline__ __device__ __host__
unsigned int rotl<unsigned int>(
unsigned int x,
int d)
79 return (x << (d & 31)) | (x >> ((32 - d) & 31));
82 template<
typename value>
83 __forceinline__ __device__ __host__ value skein_ks_parity();
86 __forceinline__ __device__ __host__
unsigned int skein_ks_parity<unsigned int>()
88 return SKEIN_KS_PARITY32;
92 __forceinline__ __device__ __host__
unsigned long long skein_ks_parity<unsigned long long>()
94 return SKEIN_KS_PARITY64;