File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -158,7 +158,13 @@ HOSTDEVICE int64_t& indexer<0>(Dim<0>& dim, int idx) {
158
158
#else
159
159
PADDLE_ASSERT (false );
160
160
#endif
161
+ #if (defined __CUDA_ARCH__) && (CUDA_VERSION < 8000)
162
+ // On CUDA versions previous to 8.0, only __shared__ variables
163
+ // could be declared as static in the device code.
164
+ int64_t head = 0 ;
165
+ #else
161
166
static int64_t head = 0 ;
167
+ #endif
162
168
return head;
163
169
}
164
170
@@ -184,7 +190,13 @@ HOSTDEVICE int64_t indexer<0>(const Dim<0>& dim, int idx) {
184
190
#else
185
191
PADDLE_ASSERT (false );
186
192
#endif
193
+ #if (defined __CUDA_ARCH__) && (CUDA_VERSION < 8000)
194
+ // On CUDA versions previous to 8.0, only __shared__ variables
195
+ // could be declared as static in the device code.
196
+ int64_t head = 0 ;
197
+ #else
187
198
static int64_t head = 0 ;
199
+ #endif
188
200
return head;
189
201
}
190
202
You can’t perform that action at this time.
0 commit comments