mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2026-10-31 14:01:27 +01:00
CUDA: keep registered input arrays alive in Python bindings
- Prevent `del data` from freeing the buffer while it is still registered with CUDA.
This commit is contained in:
1 parent
62d73c67d0
commit
b0c6c01566
2 files changed
+2
No files matched your search
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user