Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
ngraph
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ngraph
Commits
d9b7f989
Commit
d9b7f989
authored
Mar 28, 2019
by
Sang Ik Lee
Committed by
Scott Cyphers
Mar 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use official Eigen repo. (#2662)
parent
beddf528
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
2 deletions
+68
-2
eigen.patch
cmake/eigen.patch
+65
-0
external_eigen.cmake
cmake/external_eigen.cmake
+3
-2
No files found.
cmake/eigen.patch
0 → 100644
View file @
d9b7f989
diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h
index 8927bd404..f2e3c1152 100644
--- a/Eigen/src/Core/util/Macros.h
+++ b/Eigen/src/Core/util/Macros.h
@@ -523,9 +523,13 @@
#if EIGEN_COMP_MSVC || EIGEN_COMP_ICC
#define EIGEN_STRONG_INLINE __forceinline
#else
+#if EIGEN_COMP_CLANG
+#define EIGEN_STRONG_INLINE inline __attribute__((always_inline))
+#else
#define EIGEN_STRONG_INLINE inline
#endif
#endif
+#endif
// EIGEN_ALWAYS_INLINE is the stronget, it has the effect of making the function inline and adding every possible
// attribute to maximize inlining. This should only be used when really necessary: in particular,
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorCostModel.h b/unsupported/Eigen/CXX11/src/Tensor/TensorCostModel.h
index bb63baee2..1c3155b74 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorCostModel.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorCostModel.h
@@ -164,9 +164,9 @@ class TensorCostModel {
static const int kDeviceCyclesPerComputeCycle = 1;
// Costs in device cycles.
- static const int kStartupCycles = 100000;
- static const int kPerThreadCycles = 100000;
- static const int kTaskSize = 40000;
+ static const int kStartupCycles = 5000;
+ static const int kPerThreadCycles = 5000;
+ static const int kTaskSize = 5000;
// Returns the number of threads in [1:max_threads] to use for
// evaluating an expression with the given output size and cost per
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h
index ca9ba402e..5e3fe21ad 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h
@@ -234,6 +234,7 @@ struct ThreadPoolDevice {
}
}
+#if !defined(EIGEN_OPENMP)
// Recursively divide size into halves until we reach block_size.
// Division code rounds mid to block_size, so we are guaranteed to get
// block_count leaves that do actual computations.
@@ -253,6 +254,17 @@ struct ThreadPoolDevice {
};
handleRange(0, n);
barrier.Wait();
+#else
+ auto blocks = static_cast<unsigned int>(divup(n, block_size));
+ #pragma omp parallel for
+ for (unsigned int i = 0; i < blocks; i++) {
+ auto first = (block_size * i);
+ auto last = first + block_size;
+ if (n <= last)
+ last = n;
+ f(first, last);
+ }
+#endif
}
// Convenience wrapper for parallelFor that does not align blocks.
cmake/external_eigen.cmake
View file @
d9b7f989
...
...
@@ -17,8 +17,8 @@
# Enable ExternalProject CMake module
include
(
ExternalProject
)
set
(
EIGEN_GIT_TAG
patched
)
set
(
EIGEN_GIT_URL https://github.com/
NervanaSystems/eigen
)
set
(
EIGEN_GIT_TAG
ded1e7b4960f0074fa147a8ed1c9926174958092
)
set
(
EIGEN_GIT_URL https://github.com/
eigenteam/eigen-git-mirror
)
#------------------------------------------------------------------------------
# Download Eigen
...
...
@@ -30,6 +30,7 @@ ExternalProject_Add(
GIT_REPOSITORY
${
EIGEN_GIT_URL
}
GIT_TAG
${
EIGEN_GIT_TAG
}
UPDATE_COMMAND
""
PATCH_COMMAND git apply --ignore-space-change --ignore-whitespace
${
CMAKE_SOURCE_DIR
}
/cmake/eigen.patch
CONFIGURE_COMMAND
""
BUILD_COMMAND
""
INSTALL_COMMAND
""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment