You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Math] Migrate from VecCore and Vc to std::experimental::simd
Use `std::experimental::simd` for the vectorized TMath and vectorized
TFormula backend if available. We assume it's available if ROOT is
compiled with C++20 or later on Linux. In reality, it is avialble for
new-enough Clang and GCC compilers (GCC >= 11), but it is not worth it
at this point to check the compiler version explicitly, to keep things
simple. People who build with C++20 are also expected to use new
compilers.
The fact that ROOT C++17 users lose the vectorized TMath and TFormula
features is an acceptable collateral damage of this migration, as the
features are rarely used and the code/build system simplification is
significant. If users really relied on these niche features, they are
expected to build with C++20.
Windows and Apple silicon users are unaffected by this migration. The
VecCore+Vc combination did not compile on Windows before anyway, and Vc
does not support Apple silicon as Vc didn't support vectorization on ARM
via Neon (it was [in developement](https://github.com/VcDevel/Vc?tab=readme-ov-file#vc-portable-zero-overhead-c-types-for-explicitly-data-parallel-programming) but never finished).
As a result of this migration, the `vc`, `veccore`, `builtin_vc`, and
`builtin_veccore` build options are deprecated.
The migration also fixes this long-standing JIRA issue about failing
TFormula vectorization tests, because Vc symbols could not be resolved:
https://its.cern.ch/jira/browse/ROOT-10614
This was a fundamental limitation of the statically-linked Vc library,
as symbols could not be looked up by the interpreter at runtime. This
limitation is gone with the migration to `std::experimental::simd`.
The unit test that checks if GenVector works with Vc types was changed
to use `std::experimental::simd` types instead.
Copy file name to clipboardExpand all lines: README/ReleaseNotes/v640/index.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,6 +71,33 @@ This change affects the following classes: `TFile`, `TMapFile`, `TMemFile`, `TD
71
71
72
72
## Math
73
73
74
+
### Migration from VecCore/Vc to `std::experimental::simd` for Vectorization
75
+
76
+
We have migrated the vectorized backends of **TMath** and **TFormula** from **VecCore/Vc** to `std::experimental::simd`, where available.
77
+
78
+
On Linux, `std::experimental::simd` is assumed to be available when ROOT is compiled with C++20 or later, which in practice corresponds to sufficiently recent GCC and Clang compilers. To keep the build system simple and robust, ROOT does not explicitly check compiler versions: users opting into C++20 are expected to use modern toolchains.
79
+
80
+
**Impact on Linux users**
81
+
82
+
ROOT builds with C++17 on Linux no longer provide vectorized TMath and TFormula.
83
+
This is an intentional and accepted trade-off of the migration. These vectorized features were rarely used, while maintaining them significantly complicated the codebase and build configuration.
84
+
85
+
Users who rely on vectorized **TMath** or the vectorized **TFormula** backend are encouraged to build ROOT with C++20.
86
+
Doing so restores vectorization through `std::experimental::simd`, providing a more robust and future-proof implementation.
87
+
88
+
**Windows and Apple silicon users are unaffected**
89
+
90
+
VecCore/Vc did not work on Windows previously, and Vc never provided production-ready support for ARM/Neon, so Apple silicon did not benefit from vectorization before this change.
91
+
92
+
**Build system changes**
93
+
94
+
As part of this migration, the following build options are deprecated. From ROOT 6.42, setting them will result in configuration errors.
@@ -180,9 +178,7 @@ ROOT_BUILD_OPTION(unfold OFF "Enable the unfold package [GPL]")
180
178
ROOT_BUILD_OPTION(unuran OFF"Enable support for UNURAN (package for generating non-uniform random numbers) [GPL]")
181
179
ROOT_BUILD_OPTION(uring OFF"Enable support for io_uring (requires liburing and Linux kernel >= 5.1)")
182
180
ROOT_BUILD_OPTION(use_gsl_cblas ON"Use the CBLAS library from GSL instead of finding a more optimized BLAS library automatically with FindBLAS (the GSL CBLAS is less performant but more portable)")
183
-
ROOT_BUILD_OPTION(vc OFF"Enable support for Vc (SIMD Vector Classes for C++)")
184
181
ROOT_BUILD_OPTION(vdt ON"Enable support for VDT (fast and vectorisable mathematical functions)")
185
-
ROOT_BUILD_OPTION(veccore OFF"Enable support for VecCore SIMD abstraction library")
186
182
ROOT_BUILD_OPTION(vecgeom OFF"Enable support for VecGeom vectorized geometry library")
187
183
ROOT_BUILD_OPTION(webgui ON"Build Web-based UI components of ROOT")
188
184
ROOT_BUILD_OPTION(win_broken_tests OFF"Enable broken tests on Windows")
@@ -253,9 +249,7 @@ if(all)
253
249
set(tmva-pymva_defvalue ON)
254
250
set(tmva-rmva_defvalue ON)
255
251
set(unuran_defvalue ON)
256
-
set(vc_defvalue ON)
257
252
set(vdt_defvalue ON)
258
-
set(veccore_defvalue ON)
259
253
set(vecgeom_defvalue ON)
260
254
set(x11_defvalue ON)
261
255
set(xml_defvalue ON)
@@ -295,9 +289,7 @@ if(builtin_all)
295
289
set(builtin_png_defvalue ON)
296
290
set(builtin_tbb_defvalue ON)
297
291
# set(builtin_unuran_defvalue ON) (GPL)
298
-
set(builtin_vc_defvalue ON)
299
292
set(builtin_vdt_defvalue ON)
300
-
set(builtin_veccore_defvalue ON)
301
293
set(builtin_xrootd_defvalue ON)
302
294
set(builtin_xxhash_defvalue ON)
303
295
set(builtin_zeromq_defvalue ON)
@@ -415,6 +407,14 @@ if(DEFINED rpath)
415
407
"") # empty line at the end to make the deprecation message more visible
message(DEPRECATION ">>> Option '${opt}' is deprecated and ignored."
413
+
"ROOT now uses std::experimental::simd for the vectorized TFormula and TMath classes when available (on Linux when compiling with C++20 or higher)."
414
+
"Using this option will result in configuration errors in ROOT 6.42.")
415
+
endif()
416
+
endforeach()
417
+
418
418
foreach(opt minuit2_mpi)
419
419
if(${opt})
420
420
message(WARNING "The option '${opt}' can only be used to minimise thread-safe functions in Minuit2. It cannot be used for Histogram/Graph fitting and for RooFit. If you want to use Minuit2 with MPI support, it is better to build Minuit2 as a standalone library.")
0 commit comments