From ac149bc948046b8baf0155f483193ed7f409b6eb Mon Sep 17 00:00:00 2001
From: Luo Tao <luotao02@baidu.com>
Date: Mon, 5 Mar 2018 14:46:20 +0800
Subject: [PATCH] fix warning: statement is unreachable

---
 paddle/fluid/framework/dim.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/paddle/fluid/framework/dim.h b/paddle/fluid/framework/dim.h
index 58b75ba4b5..73f92fa389 100644
--- a/paddle/fluid/framework/dim.h
+++ b/paddle/fluid/framework/dim.h
@@ -157,8 +157,7 @@ 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;
@@ -166,6 +165,7 @@ HOSTDEVICE int64_t& indexer<0>(Dim<0>& dim, int idx) {
   static int64_t head = 0;
 #endif
   return head;
+#endif
 }
 
 template <int D>
@@ -189,8 +189,7 @@ 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;
@@ -198,6 +197,7 @@ HOSTDEVICE int64_t indexer<0>(const Dim<0>& dim, int idx) {
   static int64_t head = 0;
 #endif
   return head;
+#endif
 }
 
 }  // namespace