We're thinking of using a GPU to peak detect across a "record" (spectra), and I'm looking for recommended approaches. The spectra will contain around 60,000 points, and peaks are likely to be fairly narrow (<20 points), and tall in comparison to the baseline, so a fairly basic peak detect routine would suffice at this stage (although this may change in the future). The kernel should create an array of peak details (width, height, area, location in the record, etc) that would eventually be copied back to the host.
I first thought about chopping the record into small "segments", and run the peak detect kernel on each, but there is a risk of missing any peaks that span the boundary of two segments. I could do a second pass that offsets these segment locations, but this would result in duplicates (although they could be de-duped later). This approach feels clumsy and wasteful though.
We've also discussed being able to pass the kernel an array of start/end positions (e.g. 120-500, 750-1100, 6000-6150, etc) to restrict where to look for peaks, so rather than peak detecting across the whole lot it's more likely to be 10-20% of the overall record. There could be up to 200 of these ranges. So basically interested in thoughts on whether this would be a suitable approach, or even whether peak detection is suitable for a GPU! In my very limited understanding of GPU programming, I believe kernel code doesn't really suit "conditional stuff", something that a peak detection routine is obviously going to be doing a fair bit of.