diff --git a/image_analysis/spot_finding/AdaptiveSpotFinderGPU.cu b/image_analysis/spot_finding/AdaptiveSpotFinderGPU.cu index a20caa01..8ec5328f 100644 --- a/image_analysis/spot_finding/AdaptiveSpotFinderGPU.cu +++ b/image_analysis/spot_finding/AdaptiveSpotFinderGPU.cu @@ -191,6 +191,12 @@ AdaptiveSpotFinderGPU::AdaptiveSpotFinderGPU(const AzimuthalIntegrationMapping & prof_sum(nbins), prof_sum2(nbins), prof_count(nbins), + host_sum_reg(host_sum), + host_sum2_reg(host_sum2), + host_count_reg(host_count), + prof_sum_reg(prof_sum), + prof_sum2_reg(prof_sum2), + prof_count_reg(prof_count), extractor(static_cast(in_mapping.GetWidth()), static_cast(in_mapping.GetHeight()), std::move(in_stream)), last_profile(in_mapping) { diff --git a/image_analysis/spot_finding/AdaptiveSpotFinderGPU.h b/image_analysis/spot_finding/AdaptiveSpotFinderGPU.h index 5eecba20..f4beaa5b 100644 --- a/image_analysis/spot_finding/AdaptiveSpotFinderGPU.h +++ b/image_analysis/spot_finding/AdaptiveSpotFinderGPU.h @@ -80,6 +80,18 @@ class AdaptiveSpotFinderGPU : public ImageSpotFinder { std::vector prof_sum2; // plain corrected sum^2 } std::vector prof_count; // plain pixel count } + // Every per-ring array above is a device-to-host copy once per frame. A D2H copy into PAGEABLE + // memory blocks the host until it completes, whatever stream it was issued on - which would stall + // Detect() between the plain pass and the clip passes, with the device then idle while the host + // enqueues them. Pinning the destinations makes the copies genuinely asynchronous, as the + // azimuthal-integration engine already does with its own. + CudaRegisteredVector host_sum_reg; + CudaRegisteredVector host_sum2_reg; + CudaRegisteredVector host_count_reg; + CudaRegisteredVector prof_sum_reg; + CudaRegisteredVector prof_sum2_reg; + CudaRegisteredVector prof_count_reg; + SpotExtractorGPU extractor; // builds the spots from gpu_strong without it leaving the device AzimuthalIntegrationProfile last_profile; // filled every Run(), retrievable via GetProfile()