-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathdefs.h
97 lines (76 loc) · 2.02 KB
/
defs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
// This file is a part of RCKangaroo software
// (c) 2024, RetiredCoder (RC)
// License: GPLv3, see "LICENSE.TXT" file
// https://github.com/RetiredC
#pragma once
#pragma warning(disable : 4996)
typedef unsigned long long u64;
typedef long long i64;
typedef unsigned int u32;
typedef int i32;
typedef unsigned short u16;
typedef short i16;
typedef unsigned char u8;
typedef char i8;
#define MAX_GPU_CNT 32
//must be divisible by MD_LEN
#define STEP_CNT 1000
#define JMP_CNT 512
//use different options for cards older than RTX 40xx
#ifdef __CUDA_ARCH__
#if __CUDA_ARCH__ < 890
#define OLD_GPU
#endif
#ifdef OLD_GPU
#define BLOCK_SIZE 512
//can be 8, 16, 24, 32, 40, 48, 56, 64
#define PNT_GROUP_CNT 64
#else
#define BLOCK_SIZE 256
//can be 8, 16, 24, 32
#define PNT_GROUP_CNT 24
#endif
#else //CPU, fake values
#define BLOCK_SIZE 512
#define PNT_GROUP_CNT 64
#endif
// kang type
#define TAME 0 // Tame kangs
#define WILD1 1 // Wild kangs1
#define WILD2 2 // Wild kangs2
#define GPU_DP_SIZE 48
#define MAX_DP_CNT (256 * 1024)
#define JMP_MASK (JMP_CNT-1)
#define DPTABLE_MAX_CNT 16
#define MAX_CNT_LIST (512 * 1024)
#define DP_FLAG 0x8000
#define INV_FLAG 0x4000
#define JMP2_FLAG 0x2000
#define MD_LEN 10
//#define DEBUG_MODE
//gpu kernel parameters
struct TKparams
{
u64* Kangs;
u32 KangCnt;
u32 BlockCnt;
u32 BlockSize;
u32 GroupCnt;
u64* L2;
u64 DP;
u32* DPs_out;
u64* Jumps1; //x(32b), y(32b), d(32b)
u64* Jumps2; //x(32b), y(32b), d(32b)
u64* Jumps3; //x(32b), y(32b), d(32b)
u64* JumpsList; //list of all performed jumps, grouped by warp(32) every 8 groups (from PNT_GROUP_CNT). Each jump is 2 bytes: 10bit jump index + flags: INV_FLAG, DP_FLAG, JMP2_FLAG
u32* DPTable;
u32* L1S2;
u64* LastPnts;
u64* LoopTable;
u32* dbg_buf;
u32* LoopedKangs;
bool IsGenMode; //tames generation mode
u32 KernelA_LDS_Size;
u32 KernelB_LDS_Size;
u32 KernelC_LDS_Size;
};