Skip to content

Commit b02e12e

Browse files
authored
Merge pull request #8740 from luotao1/warning
fix warning: statement is unreachable
2 parents 08e9bfa + ac149bc commit b02e12e

File tree

1 file changed

+4
-4
lines changed
  • paddle/fluid/framework

1 file changed

+4
-4
lines changed

paddle/fluid/framework/dim.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,15 @@ HOSTDEVICE int64_t& indexer<0>(Dim<0>& dim, int idx) {
157157
throw std::invalid_argument("Invalid index");
158158
#else
159159
PADDLE_ASSERT(false);
160-
#endif
161-
#if (defined __CUDA_ARCH__) && (CUDA_VERSION < 8000)
160+
#if CUDA_VERSION < 8000
162161
// On CUDA versions previous to 8.0, only __shared__ variables
163162
// could be declared as static in the device code.
164163
int64_t head = 0;
165164
#else
166165
static int64_t head = 0;
167166
#endif
168167
return head;
168+
#endif
169169
}
170170

171171
template <int D>
@@ -189,15 +189,15 @@ HOSTDEVICE int64_t indexer<0>(const Dim<0>& dim, int idx) {
189189
throw std::invalid_argument("Invalid index");
190190
#else
191191
PADDLE_ASSERT(false);
192-
#endif
193-
#if (defined __CUDA_ARCH__) && (CUDA_VERSION < 8000)
192+
#if CUDA_VERSION < 8000
194193
// On CUDA versions previous to 8.0, only __shared__ variables
195194
// could be declared as static in the device code.
196195
int64_t head = 0;
197196
#else
198197
static int64_t head = 0;
199198
#endif
200199
return head;
200+
#endif
201201
}
202202

203203
} // namespace

0 commit comments

Comments
 (0)