The initial pragma was compiling cleanly, but was triggering a runtime error:
Present table errors:
descP_[:descN_] lives at 0x7ffa9eb66010 size 61447872 partially present in
host:0x7ffa9eb2c010 device:0x7ff858000000 size:61682352 presentcount:0+1 line:469 name:descP_[:descN_] file:/…/tree_build_gpu.hpp
FATAL ERROR: variable in data clause is partially present on the device: name=descP_[:descN_]
Replacing the pragma with three explicit calls to acc_delete() as shown below fixed the problem. Why wouldn’t the pragma work?
@@ -47,2 +47,5 @@
#include <vector>
+#if defined(_OPENACC)
+#include <openacc.h>
+#endif
@@ -473,3 +476,5 @@ class GpuResidentData {
#if defined(_OPENACC)
- #pragma acc exit data delete(descP_[0:descN_], probP_[0:descN_], bdP_[0:bdN_])
+ acc_delete(descP_, descN_ * sizeof(*descP_));
+ acc_delete(probP_, descN_ * sizeof(*probP_));
+ acc_delete(bdP_, bdN_ * sizeof(*bdP_));
#endif
Using nvc++ 25.11 on Linux.