Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions paddle/fluid/framework/dim.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,13 @@ HOSTDEVICE int64_t& indexer<0>(Dim<0>& dim, int idx) {
#else
PADDLE_ASSERT(false);
#endif
#if (defined __CUDA_ARCH__) && (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;
}

Expand All @@ -184,7 +190,13 @@ HOSTDEVICE int64_t indexer<0>(const Dim<0>& dim, int idx) {
#else
PADDLE_ASSERT(false);
#endif
#if (defined __CUDA_ARCH__) && (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;
}

Expand Down