Skip to content

Commit

Permalink
Fix nvcc issues related to variadic templates
Browse files Browse the repository at this point in the history
  • Loading branch information
ljanyst committed Jun 22, 2017
1 parent 12f033d commit 830b455
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions tensorflow/core/kernels/batch_norm_op_gpu.cu.cc
Expand Up @@ -16,6 +16,7 @@ limitations under the License.
#if GOOGLE_CUDA

#define EIGEN_USE_GPU
#define EIGEN_HAS_VARIADIC_TEMPLATES 0

#include "tensorflow/core/kernels/batch_norm_op.h"

Expand Down
9 changes: 7 additions & 2 deletions tensorflow/core/kernels/cwise_op_gpu_select.cu.cc
Expand Up @@ -14,6 +14,7 @@ limitations under the License.
==============================================================================*/

#if GOOGLE_CUDA
#define EIGEN_HAS_VARIADIC_TEMPLATES 0

#include "tensorflow/core/kernels/cwise_ops_gpu_common.cu.h"
#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor"
Expand Down Expand Up @@ -65,8 +66,12 @@ struct BatchSelectFunctor<GPUDevice, T> {
const int all_but_batch = then_flat_outer_dims.dimension(1);

#if !defined(EIGEN_HAS_INDEX_LIST)
Eigen::array<int, 2> broadcast_dims{{ 1, all_but_batch }};
Eigen::Tensor<int, 2>::Dimensions reshape_dims{{ batch, 1 }};
Eigen::array<int, 2> broadcast_dims;
broadcast_dims[0] = 1;
broadcast_dims[1] = all_but_batch;
Eigen::Tensor<int, 2>::Dimensions reshape_dims;
reshape_dims[0] = batch;
reshape_dims[1] = 1;
#else
Eigen::IndexList<Eigen::type2index<1>, int> broadcast_dims;
broadcast_dims.set(1, all_but_batch);
Expand Down
1 change: 1 addition & 0 deletions tensorflow/core/kernels/softmax_op_gpu.cu.cc
Expand Up @@ -16,6 +16,7 @@ limitations under the License.
#if GOOGLE_CUDA

#define EIGEN_USE_GPU
#define EIGEN_HAS_VARIADIC_TEMPLATES 0

#include "tensorflow/core/kernels/softmax_op_functor.h"

Expand Down
1 change: 1 addition & 0 deletions tensorflow/core/kernels/sparse_xent_op_gpu.cu.cc
Expand Up @@ -16,6 +16,7 @@ limitations under the License.
#if GOOGLE_CUDA

#define EIGEN_USE_GPU
#define EIGEN_HAS_VARIADIC_TEMPLATES 0

#include "tensorflow/core/kernels/sparse_xent_op.h"

Expand Down

0 comments on commit 830b455

Please sign in to comment.