cms-patatrack / pixeltrack-standalone

Standalone Patatrack pixel tracking
Apache License 2.0
17 stars 35 forks source link

Add missing include files #315

Closed markdewing closed 2 years ago

markdewing commented 2 years ago

[hip] - cstring for std::memcpy and cstddef for size_t [serial] - cstddef for size_t

fwyzard commented 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)
makortel commented 2 years ago

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?

fwyzard commented 2 years ago

The patch is on top of the other CMS / Patatrack changes, so it'll take some effort to upstream everything.

fwyzard commented 2 years ago

I've pushed it to the CMS repository and update the pixeltrack-standalone Makefile (via https://github.com/cms-patatrack/pixeltrack-standalone/pull/319)

fwyzard commented 2 years ago

And the update for CMSSW_12_3_X is in https://github.com/cms-sw/cmsdist/pull/7649 .