未验证 提交 b02e12e8 编写于 作者: T Tao Luo 提交者: GitHub

Merge pull request #8740 from luotao1/warning

fix warning: statement is unreachable
...@@ -157,8 +157,7 @@ HOSTDEVICE int64_t& indexer<0>(Dim<0>& dim, int idx) { ...@@ -157,8 +157,7 @@ HOSTDEVICE int64_t& indexer<0>(Dim<0>& dim, int idx) {
throw std::invalid_argument("Invalid index"); throw std::invalid_argument("Invalid index");
#else #else
PADDLE_ASSERT(false); PADDLE_ASSERT(false);
#endif #if CUDA_VERSION < 8000
#if (defined __CUDA_ARCH__) && (CUDA_VERSION < 8000)
// On CUDA versions previous to 8.0, only __shared__ variables // On CUDA versions previous to 8.0, only __shared__ variables
// could be declared as static in the device code. // could be declared as static in the device code.
int64_t head = 0; int64_t head = 0;
...@@ -166,6 +165,7 @@ HOSTDEVICE int64_t& indexer<0>(Dim<0>& dim, int idx) { ...@@ -166,6 +165,7 @@ HOSTDEVICE int64_t& indexer<0>(Dim<0>& dim, int idx) {
static int64_t head = 0; static int64_t head = 0;
#endif #endif
return head; return head;
#endif
} }
template <int D> template <int D>
...@@ -189,8 +189,7 @@ HOSTDEVICE int64_t indexer<0>(const Dim<0>& dim, int idx) { ...@@ -189,8 +189,7 @@ HOSTDEVICE int64_t indexer<0>(const Dim<0>& dim, int idx) {
throw std::invalid_argument("Invalid index"); throw std::invalid_argument("Invalid index");
#else #else
PADDLE_ASSERT(false); PADDLE_ASSERT(false);
#endif #if CUDA_VERSION < 8000
#if (defined __CUDA_ARCH__) && (CUDA_VERSION < 8000)
// On CUDA versions previous to 8.0, only __shared__ variables // On CUDA versions previous to 8.0, only __shared__ variables
// could be declared as static in the device code. // could be declared as static in the device code.
int64_t head = 0; int64_t head = 0;
...@@ -198,6 +197,7 @@ HOSTDEVICE int64_t indexer<0>(const Dim<0>& dim, int idx) { ...@@ -198,6 +197,7 @@ HOSTDEVICE int64_t indexer<0>(const Dim<0>& dim, int idx) {
static int64_t head = 0; static int64_t head = 0;
#endif #endif
return head; return head;
#endif
} }
} // namespace } // namespace
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册