Remove unroll access for Drupal for NV gpus
[hashcat.git] / include / kernel_vendor.h
1 /**
2 * Author......: Jens Steube <jens.steube@gmail.com>
3 * License.....: MIT
4 */
5
6 #pragma OPENCL EXTENSION cl_khr_int64_base_atomics : enable
7 #pragma OPENCL EXTENSION cl_khr_byte_addressable_store : enable
8
9 /**
10 * device type
11 */
12
13 #define DEVICE_TYPE_CPU 2
14 #define DEVICE_TYPE_GPU 4
15 #define DEVICE_TYPE_ACCEL 8
16
17 #if DEVICE_TYPE == DEVICE_TYPE_CPU
18 #define IS_CPU
19 #elif DEVICE_TYPE == DEVICE_TYPE_GPU
20 #define IS_GPU
21 #elif DEVICE_TYPE == DEVICE_TYPE_ACCEL
22 #define IS_ACCEL
23 #endif
24
25 /**
26 * vendor specific
27 */
28
29 #if VENDOR_ID == (1 << 0)
30 #define IS_AMD
31 #elif VENDOR_ID == (1 << 6)
32 #define IS_NV
33 #else
34 #define IS_GENERIC
35 #endif
36
37 /**
38 * AMD specific
39 */
40
41 #ifdef IS_AMD
42 #pragma OPENCL EXTENSION cl_amd_media_ops : enable
43 #pragma OPENCL EXTENSION cl_amd_media_ops2 : enable
44 #endif
45
46 /**
47 * Unrolling is generally enabled, for all device types and hash modes
48 * There's a few exception when it's better not to unroll
49 */
50
51 // Some algorithms run into too much register pressure due to loop unrolling
52
53 #ifdef IS_NV
54 #ifdef IS_GPU
55
56 #if KERN_TYPE == 1500
57 #undef _unroll
58 #endif
59 #if KERN_TYPE == 1800
60 #undef _unroll
61 #endif
62 #if KERN_TYPE == 3000
63 #undef _unroll
64 #endif
65 #if KERN_TYPE == 6221
66 #undef _unroll
67 #endif
68 #if KERN_TYPE == 6222
69 #undef _unroll
70 #endif
71 #if KERN_TYPE == 6223
72 #undef _unroll
73 #endif
74 #if KERN_TYPE == 6500
75 #undef _unroll
76 #endif
77 #if KERN_TYPE == 7100
78 #undef _unroll
79 #endif
80 #if KERN_TYPE == 7400
81 #undef _unroll
82 #endif
83 #if KERN_TYPE == 7900
84 #undef _unroll
85 #endif
86 #if KERN_TYPE == 8200
87 #undef _unroll
88 #endif
89 #if KERN_TYPE == 10400
90 #undef _unroll
91 #endif
92 #if KERN_TYPE == 10500
93 #undef _unroll
94 #endif
95 #if KERN_TYPE == 10700
96 #undef _unroll
97 #endif
98 #if KERN_TYPE == 12300
99 #undef _unroll
100 #endif
101 #if KERN_TYPE == 12400
102 #undef _unroll
103 #endif
104
105 #endif
106 #endif
107
108 #ifdef IS_AMD
109 #ifdef IS_GPU
110
111 #if KERN_TYPE == 3200
112 #undef _unroll
113 #endif
114 #if KERN_TYPE == 5200
115 #undef _unroll
116 #endif
117 #if KERN_TYPE == 6100
118 #undef _unroll
119 #endif
120 #if KERN_TYPE == 6221
121 #undef _unroll
122 #endif
123 #if KERN_TYPE == 6222
124 #undef _unroll
125 #endif
126 #if KERN_TYPE == 6223
127 #undef _unroll
128 #endif
129 #if KERN_TYPE == 6400
130 #undef _unroll
131 #endif
132 #if KERN_TYPE == 6500
133 #undef _unroll
134 #endif
135 #if KERN_TYPE == 6800
136 #undef _unroll
137 #endif
138 #if KERN_TYPE == 7100
139 #undef _unroll
140 #endif
141 #if KERN_TYPE == 7400
142 #undef _unroll
143 #endif
144 #if KERN_TYPE == 8000
145 #undef _unroll
146 #endif
147 #if KERN_TYPE == 8200
148 #undef _unroll
149 #endif
150 #if KERN_TYPE == 10900
151 #undef _unroll
152 #endif
153 #if KERN_TYPE == 11600
154 #undef _unroll
155 #endif
156 #if KERN_TYPE == 12300
157 #undef _unroll
158 #endif
159 #if KERN_TYPE == 12800
160 #undef _unroll
161 #endif
162 #if KERN_TYPE == 12900
163 #undef _unroll
164 #endif
165 #if KERN_TYPE == 13000
166 #undef _unroll
167 #endif
168
169 #endif
170 #endif
171
172 // Some algorithms break due to loop unrolling, it's unknown why, probably compiler bugs
173 // Can overlap with above cases
174
175 #ifdef IS_AMD
176 #ifdef IS_GPU
177
178 #if KERN_TYPE == 1750
179 #undef _unroll
180 #endif
181 #if KERN_TYPE == 1760
182 #undef _unroll
183 #endif
184 #if KERN_TYPE == 6500
185 #undef _unroll
186 #endif
187 #if KERN_TYPE == 7100
188 #undef _unroll
189 #endif
190 #if KERN_TYPE == 9600
191 #undef _unroll
192 #endif
193 #if KERN_TYPE == 12200
194 #undef _unroll
195 #endif
196 #if KERN_TYPE == 12300
197 #undef _unroll
198 #endif
199
200 #endif
201 #endif