#2922: CarpetX does not compile with CUDA 12.9
| Reporter: | Steven R. Brandt |
| Status: | new |
| Milestone: | ET_2026_05 |
| Version: | |
| Type: | bug |
| Priority: | major |
| Component: | CarpetX |
Comment (by Steven R. Brandt):
I have already provided the workaround in the hack/vect_any branch, but here it is again:
diff --git a/Arith/src/vect.hxx b/Arith/src/vect.hxx
index 302833da..c547bb46 100644
--- a/Arith/src/vect.hxx
+++ b/Arith/src/vect.hxx
@@ -638,6 +638,12 @@ template <typename T, int D> struct vect {
zero<T>()(), x);
}
+ friend constexpr ARITH_INLINE ARITH_DEVICE ARITH_HOST auto /*bool*/
+ vect_any(const vect &x) {
+ return fold([](const T &a, const T &b) ARITH_INLINE { return a || b; },
+ zero<T>()(), x);
+ }
+
friend constexpr ARITH_INLINE ARITH_DEVICE ARITH_HOST auto /*bool*/
allisfinite(const vect &x) {
return all(
diff --git a/CarpetX/src/io_openpmd.cxx b/CarpetX/src/io_openpmd.cxx
index 536a0749..a84bcbdb 100644
--- a/CarpetX/src/io_openpmd.cxx
+++ b/CarpetX/src/io_openpmd.cxx
@@ -284,7 +284,7 @@ struct carpetx_openpmd_t {
constexpr friend bool operator!=(const box_t &x, const box_t &y) {
return !(x == y);
}
- constexpr bool empty() const { return any(hi < lo); }
+ constexpr bool empty() const { return vect_any(hi < lo); }
constexpr Arith::vect<T, D> shape() const {
Arith::vect<T, D> sh;
for (std::size_t d = 0; d < D; ++d)
@@ -1248,7 +1248,7 @@ void carpetx_openpmd_t::InputOpenPMD(const cGH *const cctkGH,
for (int j = extbox.lo[1]; j < extbox.hi[1]; ++j) {
for (int i = extbox.lo[0]; i < extbox.hi[0]; ++i) {
--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2922/carpetx-does-not-compile-with-cuda-129