2013-11-15 05:52:37 +08:00
|
|
|
// This file is part of Eigen, a lightweight C++ template library
|
|
|
|
// for linear algebra.
|
|
|
|
//
|
2014-10-14 01:04:04 +08:00
|
|
|
// Copyright (C) 2014 Benoit Steiner <benoit.steiner.goog@gmail.com>
|
2013-11-16 07:03:23 +08:00
|
|
|
// Copyright (C) 2013 Christian Seiler <christian@iwakd.de>
|
2013-11-15 05:52:37 +08:00
|
|
|
//
|
|
|
|
// This Source Code Form is subject to the terms of the Mozilla
|
|
|
|
// Public License v. 2.0. If a copy of the MPL was not distributed
|
|
|
|
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
2015-11-24 02:03:53 +08:00
|
|
|
//#ifndef EIGEN_CXX11_TENSOR_MODULE
|
|
|
|
//#define EIGEN_CXX11_TENSOR_MODULE
|
2013-11-15 05:52:37 +08:00
|
|
|
|
2016-04-28 05:05:40 +08:00
|
|
|
#include "../../../Eigen/Core"
|
|
|
|
|
2016-11-17 19:47:13 +08:00
|
|
|
#if defined(EIGEN_USE_SYCL)
|
2016-11-05 02:18:19 +08:00
|
|
|
#undef min
|
|
|
|
#undef max
|
|
|
|
#undef isnan
|
|
|
|
#undef isinf
|
|
|
|
#undef isfinite
|
|
|
|
#include <SYCL/sycl.hpp>
|
2016-11-20 00:09:54 +08:00
|
|
|
#include <iostream>
|
2016-11-06 01:04:42 +08:00
|
|
|
#include <map>
|
|
|
|
#include <memory>
|
|
|
|
#include <utility>
|
2016-11-05 02:18:19 +08:00
|
|
|
#endif
|
|
|
|
|
2015-08-18 20:34:00 +08:00
|
|
|
#include <Eigen/src/Core/util/DisableStupidWarnings.h>
|
2013-11-15 05:52:37 +08:00
|
|
|
|
2016-07-08 17:13:55 +08:00
|
|
|
#include "../SpecialFunctions"
|
2016-04-26 17:20:25 +08:00
|
|
|
#include "src/util/CXX11Meta.h"
|
|
|
|
#include "src/util/MaxSizeVector.h"
|
2013-11-15 05:52:37 +08:00
|
|
|
|
|
|
|
/** \defgroup CXX11_Tensor_Module Tensor Module
|
|
|
|
*
|
|
|
|
* This module provides a Tensor class for storing arbitrarily indexed
|
|
|
|
* objects.
|
|
|
|
*
|
|
|
|
* \code
|
|
|
|
* #include <Eigen/CXX11/Tensor>
|
|
|
|
* \endcode
|
|
|
|
*/
|
|
|
|
|
2016-04-15 04:57:35 +08:00
|
|
|
#include <cmath>
|
2013-11-15 05:52:37 +08:00
|
|
|
#include <cstddef>
|
|
|
|
#include <cstring>
|
2015-12-17 12:45:58 +08:00
|
|
|
|
|
|
|
#ifdef _WIN32
|
2016-10-09 13:56:32 +08:00
|
|
|
typedef __int16 int16_t;
|
|
|
|
typedef unsigned __int16 uint16_t;
|
2015-12-17 12:45:58 +08:00
|
|
|
typedef __int32 int32_t;
|
|
|
|
typedef unsigned __int32 uint32_t;
|
|
|
|
typedef __int64 int64_t;
|
|
|
|
typedef unsigned __int64 uint64_t;
|
2016-12-10 06:52:15 +08:00
|
|
|
#include <windows.h>
|
2015-12-17 12:45:58 +08:00
|
|
|
#else
|
2014-10-14 01:04:04 +08:00
|
|
|
#include <stdint.h>
|
2016-12-10 06:52:15 +08:00
|
|
|
#include <unistd.h>
|
2015-12-17 12:45:58 +08:00
|
|
|
#endif
|
2014-10-14 01:04:04 +08:00
|
|
|
|
2016-03-10 08:03:16 +08:00
|
|
|
#if __cplusplus > 199711 || EIGEN_COMP_MSVC >= 1900
|
2015-01-15 07:43:38 +08:00
|
|
|
#include <random>
|
|
|
|
#endif
|
|
|
|
|
2015-05-28 22:57:28 +08:00
|
|
|
#ifdef _WIN32
|
2015-12-17 12:45:58 +08:00
|
|
|
#include <windows.h>
|
2015-05-28 22:57:28 +08:00
|
|
|
#elif defined(__APPLE__)
|
|
|
|
#include <mach/mach_time.h>
|
|
|
|
#else
|
|
|
|
#include <time.h>
|
|
|
|
#endif
|
|
|
|
|
2016-12-22 04:32:06 +08:00
|
|
|
#if defined(EIGEN_USE_LIBXSMM)
|
|
|
|
#include "libxsmm.h"
|
|
|
|
#endif
|
|
|
|
|
2014-10-14 08:02:09 +08:00
|
|
|
#ifdef EIGEN_USE_THREADS
|
2016-04-15 07:16:42 +08:00
|
|
|
#include "ThreadPool"
|
2014-10-14 08:02:09 +08:00
|
|
|
#endif
|
|
|
|
|
2015-01-15 07:43:38 +08:00
|
|
|
#ifdef EIGEN_USE_GPU
|
2016-02-23 05:59:03 +08:00
|
|
|
#include <iostream>
|
2015-01-15 07:43:38 +08:00
|
|
|
#include <cuda_runtime.h>
|
2016-09-27 02:00:32 +08:00
|
|
|
#if __cplusplus >= 201103L
|
|
|
|
#include <atomic>
|
|
|
|
#include <unistd.h>
|
2014-10-14 01:04:04 +08:00
|
|
|
#endif
|
2015-01-15 07:43:38 +08:00
|
|
|
#endif
|
2013-11-15 05:52:37 +08:00
|
|
|
|
2015-10-15 00:31:37 +08:00
|
|
|
#include "src/Tensor/TensorMacros.h"
|
2015-08-18 20:34:00 +08:00
|
|
|
#include "src/Tensor/TensorForwardDeclarations.h"
|
|
|
|
#include "src/Tensor/TensorMeta.h"
|
2016-05-18 01:25:19 +08:00
|
|
|
#include "src/Tensor/TensorFunctors.h"
|
2016-05-13 05:07:22 +08:00
|
|
|
#include "src/Tensor/TensorCostModel.h"
|
2015-11-21 09:42:50 +08:00
|
|
|
#include "src/Tensor/TensorDeviceDefault.h"
|
|
|
|
#include "src/Tensor/TensorDeviceThreadPool.h"
|
|
|
|
#include "src/Tensor/TensorDeviceCuda.h"
|
2016-09-19 19:44:13 +08:00
|
|
|
#include "src/Tensor/TensorDeviceSycl.h"
|
2015-08-18 20:34:00 +08:00
|
|
|
#include "src/Tensor/TensorIndexList.h"
|
|
|
|
#include "src/Tensor/TensorDimensionList.h"
|
|
|
|
#include "src/Tensor/TensorDimensions.h"
|
|
|
|
#include "src/Tensor/TensorInitializer.h"
|
|
|
|
#include "src/Tensor/TensorTraits.h"
|
2016-10-04 23:38:23 +08:00
|
|
|
#include "src/Tensor/TensorRandom.h"
|
2015-11-20 05:57:27 +08:00
|
|
|
#include "src/Tensor/TensorUInt128.h"
|
2015-08-18 20:34:00 +08:00
|
|
|
#include "src/Tensor/TensorIntDiv.h"
|
2016-06-03 08:04:19 +08:00
|
|
|
#include "src/Tensor/TensorGlobalFunctions.h"
|
2015-08-18 20:34:00 +08:00
|
|
|
|
|
|
|
#include "src/Tensor/TensorBase.h"
|
|
|
|
|
|
|
|
#include "src/Tensor/TensorEvaluator.h"
|
|
|
|
#include "src/Tensor/TensorExpr.h"
|
|
|
|
#include "src/Tensor/TensorReduction.h"
|
2015-11-07 06:54:28 +08:00
|
|
|
#include "src/Tensor/TensorReductionCuda.h"
|
2015-08-31 23:18:53 +08:00
|
|
|
#include "src/Tensor/TensorArgMax.h"
|
2015-08-18 20:34:00 +08:00
|
|
|
#include "src/Tensor/TensorConcatenation.h"
|
2016-01-20 09:22:05 +08:00
|
|
|
#include "src/Tensor/TensorContractionMapper.h"
|
2016-01-23 06:37:26 +08:00
|
|
|
#include "src/Tensor/TensorContractionBlocking.h"
|
2015-08-18 20:34:00 +08:00
|
|
|
#include "src/Tensor/TensorContraction.h"
|
|
|
|
#include "src/Tensor/TensorContractionThreadPool.h"
|
|
|
|
#include "src/Tensor/TensorContractionCuda.h"
|
|
|
|
#include "src/Tensor/TensorConversion.h"
|
|
|
|
#include "src/Tensor/TensorConvolution.h"
|
2015-10-23 07:54:21 +08:00
|
|
|
#include "src/Tensor/TensorFFT.h"
|
2015-08-18 20:34:00 +08:00
|
|
|
#include "src/Tensor/TensorPatch.h"
|
|
|
|
#include "src/Tensor/TensorImagePatch.h"
|
|
|
|
#include "src/Tensor/TensorVolumePatch.h"
|
|
|
|
#include "src/Tensor/TensorBroadcasting.h"
|
|
|
|
#include "src/Tensor/TensorChipping.h"
|
|
|
|
#include "src/Tensor/TensorInflation.h"
|
|
|
|
#include "src/Tensor/TensorLayoutSwap.h"
|
|
|
|
#include "src/Tensor/TensorMorphing.h"
|
|
|
|
#include "src/Tensor/TensorPadding.h"
|
|
|
|
#include "src/Tensor/TensorReverse.h"
|
|
|
|
#include "src/Tensor/TensorShuffling.h"
|
|
|
|
#include "src/Tensor/TensorStriding.h"
|
|
|
|
#include "src/Tensor/TensorCustomOp.h"
|
|
|
|
#include "src/Tensor/TensorEvalTo.h"
|
|
|
|
#include "src/Tensor/TensorForcedEval.h"
|
|
|
|
#include "src/Tensor/TensorGenerator.h"
|
|
|
|
#include "src/Tensor/TensorAssign.h"
|
2016-06-02 20:35:47 +08:00
|
|
|
#include "src/Tensor/TensorScan.h"
|
2015-08-18 20:34:00 +08:00
|
|
|
|
2016-11-05 02:18:19 +08:00
|
|
|
#include "src/Tensor/TensorSycl.h"
|
2015-08-18 20:34:00 +08:00
|
|
|
#include "src/Tensor/TensorExecutor.h"
|
|
|
|
#include "src/Tensor/TensorDevice.h"
|
|
|
|
|
|
|
|
#include "src/Tensor/TensorStorage.h"
|
|
|
|
#include "src/Tensor/Tensor.h"
|
|
|
|
#include "src/Tensor/TensorFixedSize.h"
|
|
|
|
#include "src/Tensor/TensorMap.h"
|
|
|
|
#include "src/Tensor/TensorRef.h"
|
|
|
|
|
|
|
|
#include "src/Tensor/TensorIO.h"
|
|
|
|
|
|
|
|
#include <Eigen/src/Core/util/ReenableStupidWarnings.h>
|
2014-04-29 01:32:27 +08:00
|
|
|
|
2015-11-24 02:03:53 +08:00
|
|
|
//#endif // EIGEN_CXX11_TENSOR_MODULE
|