1 #ifndef THIRD_PARTY_EIGEN3_TENSOR_BENCHMARKS_H_ 2 #define THIRD_PARTY_EIGEN3_TENSOR_BENCHMARKS_H_ 5 #define EIGEN_DEFAULT_DENSE_INDEX_TYPE int 7 #include "unsupported/Eigen/CXX11/Tensor" 10 #define BENCHMARK_RANGE(bench, lo, hi) \ 11 BENCHMARK(bench)->Range(lo, hi) 49 if (
sizeof(
T) >=
sizeof(
int)) {
53 sizes[0] =
m_ *
sizeof(
T) /
sizeof(
int);
54 sizes[1] =
k_ *
sizeof(
T) /
sizeof(
int);
100 A.
slice(first_quadrant, quarter_sizes);
101 C.
slice(second_quadrant, quarter_sizes).device(
device_) =
102 B.
slice(second_quadrant, quarter_sizes);
103 C.
slice(third_quadrant, quarter_sizes).device(
device_) =
104 A.
slice(third_quadrant, quarter_sizes);
105 C.
slice(fourth_quadrant, quarter_sizes).device(
device_) =
106 B.
slice(fourth_quadrant, quarter_sizes);
181 #if defined(EIGEN_HAS_INDEX_LIST) 182 Eigen::IndexPairList<Eigen::type2indexpair<0, 0>,
183 Eigen::type2indexpair<2, 1> > paddings;
209 #ifndef EIGEN_HAS_INDEX_LIST 216 Eigen::IndexList<Eigen::type2index<1>, Eigen::type2index<2> > strides;
237 #ifndef EIGEN_HAS_INDEX_LIST 244 Eigen::IndexList<Eigen::type2index<1>,
int>
broadcast;
245 broadcast.set(1,
n_);
267 C.
device(
device_) = A * A.constant(static_cast<T>(3.14)) + B * B.constant(static_cast<T>(2.7));
320 #ifndef EIGEN_HAS_INDEX_LIST 322 sum_along_dim[0] = 0;
326 Eigen::IndexList<Eigen::type2index<0>> sum_along_dim;
350 #ifndef EIGEN_HAS_INDEX_LIST 352 sum_along_dim[0] = 1;
356 Eigen::IndexList<Eigen::type2index<1>> sum_along_dim;
423 kernel_sizes[0] = kernel_x;
424 kernel_sizes[1] = kernel_y;
427 result_sizes[0] =
m_ - kernel_x + 1;
428 result_sizes[1] =
n_ - kernel_y + 1;
441 (
m_ - kernel_x + 1) * (
n_ - kernel_y + 1) * kernel_x * kernel_y * num_iters);
460 #if defined(EIGEN_USE_GPU) && defined(__CUDACC__) 478 #endif // THIRD_PARTY_EIGEN3_TENSOR_BENCHMARKS_H_
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorSlicingOp< const StartIndices, const Sizes, const TensorMap< PlainObjectType, Options_, MakePointer_ > > slice(const StartIndices &startIndices, const Sizes &sizes) const
void algebraicFunc(int num_iters)
void colChip(int num_iters)
void transcendentalFunc(int num_iters)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorShufflingOp< const Shuffle, const TensorMap< PlainObjectType, Options_, MakePointer_ > > shuffle(const Shuffle &shuffle) const
void convolution(int num_iters, int kernel_x, int kernel_y)
std::vector< Array2i > sizes
void fullReduction(int num_iters)
void rowChip(int num_iters)
TensorDevice< TensorMap< PlainObjectType, Options_, MakePointer_ >, DeviceType > device(const DeviceType &device)
iterator iter(handle obj)
void memcpy(int num_iters)
void slicing(int num_iters)
BenchmarkSuite(const Device &device, size_t m)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorChippingOp< DimId, const TensorMap< PlainObjectType, Options_, MakePointer_ > > chip(const Index offset) const
void typeCasting(int num_iters)
void finalizeBenchmark(int64_t num_items)
BenchmarkSuite(const Device &device, size_t m, size_t k, size_t n)
void striding(int num_iters)
A tensor expression mapping an existing array of data.
Tensor< float, 1 >::DimensionPair DimPair
void contraction(int num_iters)
Eigen::Triplet< double > T
void padding(int num_iters)
void colReduction(int num_iters)
Matrix< Scalar, Dynamic, Dynamic > C
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorStridingOp< const Strides, const TensorMap< PlainObjectType, Options_, MakePointer_ > > stride(const Strides &strides) const
void random(int num_iters)
void StartBenchmarkTiming()
void StopBenchmarkTiming()
void rowReduction(int num_iters)
void shuffling(int num_iters)
void SetBenchmarkFlopsProcessed(int64_t)
void coeffWiseOp(int num_iters)
void broadcasting(int num_iters)
broadcast_trivial broadcast(const std::array< buffer_info, N > &buffers, ssize_t &ndim, std::vector< ssize_t > &shape)