[ET Trac] #2922: CarpetX does not compile with CUDA 12.9
Steven R. Brandt
trac-noreply at einsteintoolkit.org
Fri Mar 27 10:44:06 CDT 2026
#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) {
const Arith::vect<int, dim> I{i, j, k};
- if (any(I < box.lo || I >= box.hi))
+ if (vect_any(I < box.lo || I >= box.hi))
memcpy(cactus_var_ptr + (cactus_di * i + cactus_dj * j +
cactus_dk * k) *
vartypesize,
```
--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2922/carpetx-does-not-compile-with-cuda-129
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.einsteintoolkit.org/pipermail/trac/attachments/20260327/7f9bfaef/attachment.htm>
More information about the Trac
mailing list