CUDA: keep registered input arrays alive in Python bindings
Build on RHEL8 / build (push) Successful in 3m55s
Build on RHEL9 / build (push) Successful in 4m12s
Run tests using data on local RHEL8 / build (push) Failing after 56s

- Prevent `del data` from freeing the buffer while it is still registered with CUDA.
This commit is contained in:
Khalil Ferjaoui committed 2026-10-06 17:23:15 +02:00
1 parent 62d73c67d0
commit b0c6c01566
2 files changed
+2

No files matched your search

+1
View File
@@ -313,6 +313,7 @@ sqrt(max(sum2/n - mean^2, 0)). Counterpart to `noise` for the device pedestal.)"
info.ptr, static_cast<size_t>(info.size) *
static_cast<size_t>(info.itemsize));
},
py::keep_alive<1, 2>(),
R"(Pin a numpy array as a locked host buffer so that
find_clusters_batched transfers it at full DMA bandwidth
(~22 GB/s) instead of going through the CUDA driver's
@@ -103,6 +103,7 @@ void define_ClusterFinderCUDAGraph(py::module &m, const std::string &typestr) {
info.ptr, static_cast<size_t>(info.size) *
static_cast<size_t>(info.itemsize));
},
py::keep_alive<1, 2>(),
R"(Pin a numpy array as a locked host buffer so that
find_clusters_batched transfers it at full DMA bandwidth.
Call once before the processing loop with the full data array.