Skip to content
Snippets Groups Projects
  • Sam Yates's avatar
    Batched sampling. (#347) · a5ce1d3e
    Sam Yates authored
    Collect samples in FVM lowered cells across an integration period, prior to delivery to sampler callbacks.
    
    Fixes #283.
    
    * Make `multi_event_stream` a generic data structure, based on the event type. These are now used for both `deliverable_event` objects and `sample_event` objects.
    * Add generic accessors for event data, separating access to event metadata (cell index, time) from payload (weight, sampling info etc.).
    * Make a flat, CUDA-friendly data structure describing the `multi_event_queue` marked event state, for passing to mechanisms and kernels. This also brings the underlying representations of the `multicore` and `gpu` versions of `multi_event_queue` closer.
    * Implement batched sampling kernel for GPU.
    * Additional utility function: `util::is_sorted_by`.
    
    Overhead of implementation and sampling process is negligible for CPU, and with no samples less than 1% on GPU. Running the miniapp with 10'000 cells and sampling 1% of the somata at 0.01ms adds approximately 10% to simulation time. 
    a5ce1d3e