From 1b0373ae10687ecc51ad9a0bfd46aa4ee116ade1 Mon Sep 17 00:00:00 2001 From: Eugene Zhulenev Date: Wed, 1 Aug 2018 15:55:46 -0700 Subject: Replace all using declarations with typedefs in Tensor ops --- unsupported/Eigen/CXX11/src/Tensor/TensorBlock.h | 20 +++++------ .../Eigen/CXX11/src/Tensor/TensorBroadcasting.h | 17 +++++---- .../Eigen/CXX11/src/Tensor/TensorChipping.h | 16 +++++---- .../Eigen/CXX11/src/Tensor/TensorExecutor.h | 40 ++++++++++++---------- .../Eigen/CXX11/src/Tensor/TensorImagePatch.h | 7 ++-- .../Eigen/CXX11/src/Tensor/TensorMorphing.h | 22 +++++++----- .../Eigen/CXX11/src/Tensor/TensorReduction.h | 14 ++++---- .../Eigen/CXX11/src/Tensor/TensorShuffling.h | 16 +++++---- 8 files changed, 88 insertions(+), 64 deletions(-) (limited to 'unsupported/Eigen/CXX11/src') diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorBlock.h b/unsupported/Eigen/CXX11/src/Tensor/TensorBlock.h index 33c4ef5b7..1db8d6124 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorBlock.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorBlock.h @@ -152,11 +152,11 @@ struct TensorBlockCopyOp { const Scalar* src_base = &src_data[src_index]; Scalar* dst_base = &dst_data[dst_index]; - using Src = const Eigen::Array; - using Dst = Eigen::Array; + typedef const Eigen::Array Src; + typedef Eigen::Array Dst; - using SrcMap = Eigen::Map>; - using DstMap = Eigen::Map>; + typedef Eigen::Map> SrcMap; + typedef Eigen::Map> DstMap; const SrcMap src(src_base, num_coeff_to_copy, InnerStride<>(src_stride)); DstMap dst(dst_base, num_coeff_to_copy, InnerStride<>(dst_stride)); @@ -401,13 +401,13 @@ struct TensorBlockCwiseBinaryOp { const StorageIndex left_stride, const LeftScalar* left_data, const StorageIndex right_index, const StorageIndex right_stride, const RightScalar* right_data) { - using Lhs = const Eigen::Array; - using Rhs = const Eigen::Array; - using Out = Eigen::Array; + typedef const Eigen::Array Lhs; + typedef const Eigen::Array Rhs; + typedef Eigen::Array Out; - using LhsMap = Eigen::Map>; - using RhsMap = Eigen::Map>; - using OutMap = Eigen::Map>; + typedef Eigen::Map> LhsMap; + typedef Eigen::Map> RhsMap; + typedef Eigen::Map> OutMap; const LeftScalar* lhs_base = &left_data[left_index]; const RightScalar* rhs_base = &right_data[right_index]; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorBroadcasting.h b/unsupported/Eigen/CXX11/src/Tensor/TensorBroadcasting.h index cca14aafd..a4d750885 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorBroadcasting.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorBroadcasting.h @@ -115,16 +115,21 @@ struct TensorEvaluator, Device> RawAccess = false }; - using ScalarNoConst = typename internal::remove_const::type; + typedef typename internal::remove_const::type ScalarNoConst; // Block based access to the XprType (input) tensor. - using TensorBlock = internal::TensorBlock; - using TensorBlockReader = internal::TensorBlockReader; + typedef internal::TensorBlock + TensorBlock; + typedef internal::TensorBlockReader + TensorBlockReader; + // We do block based broadcasting using a trick with 2x tensor rank and 0 // strides. See block method implementation for details. - using BroadcastDimensions = DSizes; - using BroadcastTensorBlock = internal::TensorBlock; - using BroadcastTensorBlockReader = internal::TensorBlockReader; + typedef DSizes BroadcastDimensions; + typedef internal::TensorBlock + BroadcastTensorBlock; + typedef internal::TensorBlockReader + BroadcastTensorBlockReader; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorEvaluator(const XprType& op, const Device& device) diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h index aca2ead12..b4c4162ef 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h @@ -152,10 +152,12 @@ struct TensorEvaluator, Device> RawAccess = false }; - using ScalarNoConst = typename internal::remove_const::type; + typedef typename internal::remove_const::type ScalarNoConst; - using InputTensorBlock = internal::TensorBlock; - using OutputTensorBlock = internal::TensorBlock; + typedef internal::TensorBlock + InputTensorBlock; + typedef internal::TensorBlock + OutputTensorBlock; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorEvaluator(const XprType& op, const Device& device) : m_impl(op.expression(), device), m_dim(op.dim()), m_device(device), m_offset(op.offset()) @@ -426,10 +428,12 @@ struct TensorEvaluator, Device> RawAccess = false }; - using ScalarNoConst = typename internal::remove_const::type; + typedef typename internal::remove_const::type ScalarNoConst; - using InputTensorBlock = internal::TensorBlock; - using OutputTensorBlock = internal::TensorBlock; + typedef internal::TensorBlock + InputTensorBlock; + typedef internal::TensorBlock + OutputTensorBlock; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorEvaluator(const XprType& op, const Device& device) : Base(op, device) diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h b/unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h index 17008917a..f11241f83 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h @@ -36,7 +36,7 @@ template class TensorExecutor { public: - using StorageIndex = typename Expression::Index; + typedef typename Expression::Index StorageIndex; EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(const Expression& expr, @@ -60,7 +60,7 @@ template class TensorExecutor { public: - using StorageIndex = typename Expression::Index; + typedef typename Expression::Index StorageIndex; EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(const Expression& expr, @@ -102,21 +102,22 @@ template class TensorExecutor { public: - using Scalar = typename traits::Scalar; - using ScalarNoConst = typename remove_const::type; + typedef typename traits::Scalar Scalar; + typedef typename remove_const::type ScalarNoConst; - using Evaluator = TensorEvaluator; - using StorageIndex = typename traits::Index; + typedef TensorEvaluator Evaluator; + typedef typename traits::Index StorageIndex; static const int NumDims = traits::NumDimensions; EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(const Expression& expr, const DefaultDevice& device = DefaultDevice()) { - using TensorBlock = - TensorBlock; - using TensorBlockMapper = TensorBlockMapper; + typedef TensorBlock + TensorBlock; + typedef TensorBlockMapper + TensorBlockMapper; Evaluator evaluator(expr, device); Index total_size = array_prod(evaluator.dimensions()); @@ -221,7 +222,7 @@ struct EvalRange { template class TensorExecutor { public: - using StorageIndex = typename Expression::Index; + typedef typename Expression::Index StorageIndex; static EIGEN_STRONG_INLINE void run(const Expression& expr, const ThreadPoolDevice& device) { @@ -249,20 +250,21 @@ class TensorExecutor { template class TensorExecutor { public: - using Scalar = typename traits::Scalar; - using ScalarNoConst = typename remove_const::type; + typedef typename traits::Scalar Scalar; + typedef typename remove_const::type ScalarNoConst; - using Evaluator = TensorEvaluator; - using StorageIndex = typename traits::Index; + typedef TensorEvaluator Evaluator; + typedef typename traits::Index StorageIndex; static const int NumDims = traits::NumDimensions; static EIGEN_STRONG_INLINE void run(const Expression& expr, const ThreadPoolDevice& device) { - using TensorBlock = - TensorBlock; - using TensorBlockMapper = - TensorBlockMapper; + typedef TensorBlock + TensorBlock; + typedef TensorBlockMapper + TensorBlockMapper; Evaluator evaluator(expr, device); StorageIndex total_size = array_prod(evaluator.dimensions()); diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorImagePatch.h b/unsupported/Eigen/CXX11/src/Tensor/TensorImagePatch.h index a8247be90..2b2f4a650 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorImagePatch.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorImagePatch.h @@ -252,7 +252,8 @@ struct TensorEvaluator, Device> RawAccess = false }; - using OutputTensorBlock = internal::TensorBlock; + typedef internal::TensorBlock + OutputTensorBlock; #ifdef __SYCL_DEVICE_ONLY__ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorEvaluator( const XprType op, const Device& device) @@ -557,8 +558,8 @@ struct TensorEvaluator, Device> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void block( OutputTensorBlock* output_block) const { - using ImagePatchCopyOp = internal::ImagePatchCopyOp; - using ImagePatchPaddingOp = internal::ImagePatchPaddingOp; + typedef internal::ImagePatchCopyOp ImagePatchCopyOp; + typedef internal::ImagePatchPaddingOp ImagePatchPaddingOp; // Calculate loop limits and various input/output dim sizes. const DSizes& block_sizes = output_block->block_sizes(); diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h b/unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h index 6ddded0bd..d5b0c1237 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h @@ -123,11 +123,15 @@ struct TensorEvaluator, Device> RawAccess = TensorEvaluator::RawAccess }; - using ScalarNoConst = typename internal::remove_const::type; + typedef typename internal::remove_const::type ScalarNoConst; - using InputTensorBlock = internal::TensorBlock; - using OutputTensorBlock = internal::TensorBlock; - using OutputTensorBlockReader = internal::TensorBlockReader; + typedef internal::TensorBlock + InputTensorBlock; + typedef internal::TensorBlock + OutputTensorBlock; + typedef internal::TensorBlockReader + OutputTensorBlockReader; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorEvaluator(const XprType& op, const Device& device) : m_impl(op.expression(), device), m_dimensions(op.dimensions()) @@ -512,9 +516,10 @@ struct TensorEvaluator, Devi RawAccess = false }; - using ScalarNoConst = typename internal::remove_const::type; + typedef typename internal::remove_const::type ScalarNoConst; - using TensorBlock = internal::TensorBlock; + typedef internal::TensorBlock + TensorBlock; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorEvaluator(const XprType& op, const Device& device) : m_impl(op.expression(), device), m_device(device), m_dimensions(op.sizes()), m_offsets(op.startIndices()) @@ -787,9 +792,10 @@ struct TensorEvaluator, Device> RawAccess = (NumDims == 1) & TensorEvaluator::RawAccess }; - using ScalarNoConst = typename internal::remove_const::type; + typedef typename internal::remove_const::type ScalarNoConst; - using TensorBlock = internal::TensorBlock; + typedef internal::TensorBlock + TensorBlock; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorEvaluator(const XprType& op, const Device& device) : Base(op, device) diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h b/unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h index 73675e7dd..80f179ba4 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h @@ -483,10 +483,12 @@ struct TensorEvaluator, RawAccess = false }; - using ScalarNoConst = typename internal::remove_const::type; + typedef typename internal::remove_const::type ScalarNoConst; - using OutputTensorBlock = internal::TensorBlock; - using InputTensorBlock = internal::TensorBlock; + typedef internal::TensorBlock + OutputTensorBlock; + typedef internal::TensorBlock + InputTensorBlock; static const bool ReducingInnerMostDims = internal::are_inner_most_dims::value; static const bool PreservingInnerMostDims = internal::preserve_inner_most_dims::value; @@ -901,9 +903,9 @@ struct TensorEvaluator, new (&reducers[i]) BlockReducer(m_reducer); } - using TensorSliceBlockMapper = - internal::TensorSliceBlockMapper; + typedef internal::TensorSliceBlockMapper + TensorSliceBlockMapper; // TODO(andydavis) Consider removing 'input_block_stride_order' if we // find that scattered reads are not worth supporting in diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h index f94c1380d..fbe69aabc 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h @@ -119,10 +119,12 @@ struct TensorEvaluator, Device> RawAccess = false }; - using ScalarNoConst = typename internal::remove_const::type; + typedef typename internal::remove_const::type ScalarNoConst; - using TensorBlock = internal::TensorBlock; - using TensorBlockReader = internal::TensorBlockReader; + typedef internal::TensorBlock + TensorBlock; + typedef internal::TensorBlockReader + TensorBlockReader; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorEvaluator(const XprType& op, const Device& device) @@ -417,10 +419,12 @@ struct TensorEvaluator, Device> RawAccess = false }; - using ScalarNoConst = typename internal::remove_const::type; + typedef typename internal::remove_const::type ScalarNoConst; - using TensorBlock = internal::TensorBlock; - using TensorBlockWriter = internal::TensorBlockWriter; + typedef internal::TensorBlock + TensorBlock; + typedef internal::TensorBlockWriter + TensorBlockWriter; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorEvaluator(const XprType& op, const Device& device) : Base(op, device) -- cgit v1.2.3