Added ability to access the cache sizes from the tensor devices

This commit is contained in:
Benoit Steiner
2016-04-14 21:25:06 -07:00
parent 18e6f67426
commit a62e924656
3 changed files with 39 additions and 0 deletions

View File

@@ -128,6 +128,15 @@ struct ThreadPoolDevice {
return num_threads_;
}
EIGEN_STRONG_INLINE size_t firstLevelCacheSize() const {
return l1CacheSize();
}
EIGEN_STRONG_INLINE size_t lastLevelCacheSize() const {
// The l3 cache size is shared between all the cores.
return l3CacheSize() / num_threads_;
}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE int majorDeviceVersion() const {
// Should return an enum that encodes the ISA supported by the CPU
return 1;