Skip to content

Instantly share code, notes, and snippets.

View monkins1010's full-sized avatar

Chris monkins1010

View GitHub Profile
template<size_t ITERATIONS, uint32_t MEM, uint32_t MASK, xmrig::Algo ALGO, uint8_t VARIANT>
#ifdef XMR_STAK_THREADS
__launch_bounds__( XMR_STAK_THREADS * 4 )
#endif
__global__ void cryptonight_core_gpu_phase2( int threads, int bfactor, int partidx, uint32_t * d_long_state, uint32_t * d_ctx_a, uint32_t * d_ctx_b, uint32_t * d_ctx_state,
uint64_t startNonce, uint32_t * __restrict__ d_input )
{
__shared__ uint32_t sharedMemory[1024];
cn_aes_gpu_init( sharedMemory );
// VARIANT ALTERATIONS
#define VARIANT1_INIT(part) {}
#define VARIANT1_1(p) \
if (VARIANT > 0) { \
const uint8_t tmp1 = ((const uint8_t*)(p))[11]; \
static const uint32_t table1 = 0x86420; \
const uint8_t index1 = (((tmp1 >> 3) & 6) | (tmp1 & 1)) << 1; \
((uint8_t*)(p))[11] = tmp1 ^ ((table1 >> index1) & 0x30); \
}