Description: Upstream_e489b600f388ae345387881a85368af3cd373ba2_cuDNN_build_failure_with_GCC_6
 Replace tuple<int,int,int> for version info with a class in DnnSupportr::GetVersion() (#18434)
 .
 Replace tuple<int,int,int> for version info with a class
 .
 Removed clang-format modifications on non-edited code
 .
 Update dnn.h
 .
 python-tensorflow-cuda (1.8.0-1) unstable; urgency=medium
 .
   * New upstream release.
   * Refresh patches.
   * Update configure-expect.sh to answer No to download of clang compiler.
Author: Adam Cecile <acecile@le-vert.net>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: upstream, https://github.com/tensorflow/tensorflow/commit/e489b600f388ae345387881a85368af3cd373ba2
Bug: https://github.com/tensorflow/tensorflow/issues/18402
Forwarded: not-needed
Reviewed-By: TensorFlow upstream
Last-Update: 2018-10-03

--- python-tensorflow-cuda-1.8.0.orig/tensorflow/compiler/xla/service/gpu/cudnn_convolution_algorithm_picker.cc
+++ python-tensorflow-cuda-1.8.0/tensorflow/compiler/xla/service/gpu/cudnn_convolution_algorithm_picker.cc
@@ -99,9 +99,9 @@ bool ShouldIncludeWinogradNonfusedAlgo(c
                                        const ConvolutionDimensionNumbers& dnums,
                                        se::StreamExecutor* stream_exec) {
   // Skip this check for cudnn7 and newer.
-  se::port::StatusOr<std::tuple<int, int, int>> version =
+  auto version =
       stream_exec->AsDnn()->GetVersion();
-  if (version.ok() && std::get<0>(version.ValueOrDie()) >= 7) {
+  if (version.ok() && version.ValueOrDie().major_version() >= 7) {
     return true;
   }
 
--- python-tensorflow-cuda-1.8.0.orig/tensorflow/stream_executor/cuda/cuda_dnn.cc
+++ python-tensorflow-cuda-1.8.0/tensorflow/stream_executor/cuda/cuda_dnn.cc
@@ -477,11 +477,12 @@ port::Status CudnnSupport::Init() {
                                    ToString(status))};
 }
 
-port::StatusOr<std::tuple<int, int, int>> CudnnSupport::GetVersion() {
+port::StatusOr<perftools::gputools::dnn::VersionInfo>
+CudnnSupport::GetVersion() {
   CudnnVersion version;
   TF_RETURN_IF_ERROR(GetLoadedCudnnVersion(&version));
-  return std::make_tuple(version.major_version, version.minor_version,
-                         version.patch_level);
+  return perftools::gputools::dnn::VersionInfo(
+      version.major_version, version.minor_version, version.patch_level);
 }
 
 // Turns a BatchDescriptor structure into a cudnn tensor handle within a scope.
--- python-tensorflow-cuda-1.8.0.orig/tensorflow/stream_executor/cuda/cuda_dnn.h
+++ python-tensorflow-cuda-1.8.0/tensorflow/stream_executor/cuda/cuda_dnn.h
@@ -46,7 +46,7 @@ class CudnnSupport : public dnn::DnnSupp
   ~CudnnSupport() override;
 
   port::Status Init() override;
-  port::StatusOr<std::tuple<int, int, int>> GetVersion() override;
+  port::StatusOr<perftools::gputools::dnn::VersionInfo> GetVersion() override;
 
   port::StatusOr<std::unique_ptr<dnn::RnnDescriptor>> createRnnDescriptor(
       int num_layers, int hidden_size, int input_size,
--- python-tensorflow-cuda-1.8.0.orig/tensorflow/stream_executor/dnn.h
+++ python-tensorflow-cuda-1.8.0/tensorflow/stream_executor/dnn.h
@@ -876,6 +876,22 @@ enum class ElementwiseOperation { kAdd,
 
 string ElementwiseOperationString(ElementwiseOperation op);
 
+// A simple class representing the version of the backing library, to 
+// workaround the "too perfect forwarding" issue in gcc6+ compilers. 
+// See PR#16309 and issue #18402 for links discussing the issue.
+class VersionInfo {
+ public:
+  VersionInfo(int major = 0, int minor = 0, int patch = 0)
+      : major_(major), minor_(minor), patch_(patch) {}
+  int major_version() { return major_; }
+  int minor_version() { return minor_; }
+  int patch() { return patch_; }
+ private:
+  int major_;
+  int minor_;
+  int patch_;
+};
+
 // Suite of operations typically used for implementing Deep/Convolutional Neural
 // Nets. Note: A false return value of an operation indicates the
 // implementation is not available.
@@ -886,8 +902,8 @@ class DnnSupport {
 
   virtual port::Status Init() = 0;
 
-  // Gets the version of the backing library, as a {major, minor, patch} tuple.
-  virtual port::StatusOr<std::tuple<int, int, int>> GetVersion() {
+  // Gets the version of the backing library, as a VersionInfo object.
+  virtual port::StatusOr<VersionInfo> GetVersion() {
     return port::UnimplementedError(
         "DnnSupport::GetVersion not implemented on this platform.");
   }
