<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Scans on icyveins7's blog</title><link>https://icyveins7.github.io/tags/scans/</link><description>Recent content in Scans on icyveins7's blog</description><generator>Hugo</generator><language>en-us</language><copyright>This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.</copyright><lastBuildDate>Fri, 26 Jun 2026 20:00:00 +0800</lastBuildDate><atom:link href="https://icyveins7.github.io/tags/scans/index.xml" rel="self" type="application/rss+xml"/><item><title>Your left-right boundary search is actually a CUDA-friendly single scan</title><link>https://icyveins7.github.io/posts/2026/06/your-left-right-boundary-search-is-actually-a-cuda-friendly-single-scan/</link><pubDate>Fri, 26 Jun 2026 20:00:00 +0800</pubDate><guid>https://icyveins7.github.io/posts/2026/06/your-left-right-boundary-search-is-actually-a-cuda-friendly-single-scan/</guid><description>&lt;blockquote&gt;&#10;&lt;p&gt;At least, most of the time it is. As long as it fits the 1-2-1 pattern..&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;Many segments can be boiled down to what I call a 1-2-1 pattern. For an array of input elements (I&amp;rsquo;ll just call them pixels, it&amp;rsquo;s shorter for me to type), a naive segment detection is to loop forwards until you hit an &lt;em&gt;activation&lt;/em&gt; pixel. This can internally be any condition you&amp;rsquo;d like; that is, any &lt;code&gt;if (...)&lt;/code&gt; is possible here as long as you operate only on the pixel you&amp;rsquo;re currently at. For simplicity, I&amp;rsquo;ll assume this is the &lt;code&gt;2&lt;/code&gt; pixel:&lt;/p&gt;</description></item></channel></rss>