Closed markdewing closed 2 years ago
FYI, to build with ROCm 5.0 I need to patch one file in the Eigen external:
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
index 40171eb83..b073ecf7a 100644
--- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h
+++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
@@ -73,13 +73,7 @@ struct CacheSizes {
CacheSizes(): m_l1(-1),m_l2(-1),m_l3(-1) {
int l1CacheSize, l2CacheSize, l3CacheSize;
-#if !defined(EIGEN_CUDA_ARCH)
queryCacheSizes(l1CacheSize, l2CacheSize, l3CacheSize);
-#else
- l1CacheSize = defaultL1CacheSize;
- l2CacheSize = 1572864;
- l3CacheSize = defaultL3CacheSize;
-#endif
m_l1 = manage_caching_sizes_helper(l1CacheSize, defaultL1CacheSize);
m_l2 = manage_caching_sizes_helper(l2CacheSize, defaultL2CacheSize);
m_l3 = manage_caching_sizes_helper(l3CacheSize, defaultL3CacheSize);
@@ -117,7 +111,19 @@ inline void manage_caching_sizes(Action action, std::ptrdiff_t* l1, std::ptrdiff
{
eigen_internal_assert(false);
}
- #else // EIGEN_CUDA_ARCH
+ #elif defined(EIGEN_HIP_DEVICE_COMPILE)
+ if (action==GetAction)
+ {
+ // GCN 5.0 / Radeon Pro WX 9100
+ *l1 = 16 * 1024; // 16 KB per CU
+ *l2 = 4 * 1024 * 1024; // 4 MB
+ *l3 = 0;
+ }
+ else
+ {
+ eigen_internal_assert(false);
+ }
+ #else
static CacheSizes m_cacheSizes;
if(action==SetAction)
I wonder if that patch would work with earlier ROCm versions (say down to 4.3)? Also, if we should look into applying this patch locally (as we did earlier), propagating it to CMS' eigen mirror, or trying to get it into upstream?
The patch is on top of the other CMS / Patatrack changes, so it'll take some effort to upstream everything.
I've pushed it to the CMS repository and update the pixeltrack-standalone Makefile (via https://github.com/cms-patatrack/pixeltrack-standalone/pull/319)
And the update for CMSSW_12_3_X is in https://github.com/cms-sw/cmsdist/pull/7649 .
[hip] - cstring for std::memcpy and cstddef for size_t [serial] - cstddef for size_t