Skip to content

Commit

Permalink
Merge pull request #8740 from luotao1/warning
Browse files Browse the repository at this point in the history
fix warning: statement is unreachable
  • Loading branch information
luotao1 committed Mar 5, 2018
2 parents 08e9bfa + ac149bc commit b02e12e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions paddle/fluid/framework/dim.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,15 @@ HOSTDEVICE int64_t& indexer<0>(Dim<0>& dim, int idx) {
throw std::invalid_argument("Invalid index");
#else
PADDLE_ASSERT(false);
#endif
#if (defined __CUDA_ARCH__) && (CUDA_VERSION < 8000)
#if CUDA_VERSION < 8000
// On CUDA versions previous to 8.0, only __shared__ variables
// could be declared as static in the device code.
int64_t head = 0;
#else
static int64_t head = 0;
#endif
return head;
#endif
}

template <int D>
Expand All @@ -189,15 +189,15 @@ HOSTDEVICE int64_t indexer<0>(const Dim<0>& dim, int idx) {
throw std::invalid_argument("Invalid index");
#else
PADDLE_ASSERT(false);
#endif
#if (defined __CUDA_ARCH__) && (CUDA_VERSION < 8000)
#if CUDA_VERSION < 8000
// On CUDA versions previous to 8.0, only __shared__ variables
// could be declared as static in the device code.
int64_t head = 0;
#else
static int64_t head = 0;
#endif
return head;
#endif
}

} // namespace
Expand Down

0 comments on commit b02e12e

Please sign in to comment.