<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Printf on icyveins7's blog</title><link>https://icyveins7.github.io/tags/printf/</link><description>Recent content in Printf 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>Mon, 23 Mar 2026 20:00:00 +0800</lastBuildDate><atom:link href="https://icyveins7.github.io/tags/printf/index.xml" rel="self" type="application/rss+xml"/><item><title>Avoid being baited by your printf statements in CUDA kernels</title><link>https://icyveins7.github.io/posts/2026/03/avoid-being-baited-by-your-printf-statements-in-cuda-kernels/</link><pubDate>Mon, 23 Mar 2026 20:00:00 +0800</pubDate><guid>https://icyveins7.github.io/posts/2026/03/avoid-being-baited-by-your-printf-statements-in-cuda-kernels/</guid><description>&lt;blockquote&gt;&#10;&lt;p&gt;Behaviour of printf on device is not the same as on host!&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;If you&amp;rsquo;re a &lt;code&gt;printf&lt;/code&gt; aficionado like me, then you use &lt;code&gt;printf&lt;/code&gt; for debugging. A lot. In fact I previously wrote a small logger that uses &lt;code&gt;printf&lt;/code&gt; called &lt;a href="https://github.com/icyveins7/spfLogger"&gt;spfLogger&lt;/a&gt;. I do enjoy the flexibility of tuning every single width/precision with a few characters, and it&amp;rsquo;s something I haven&amp;rsquo;t yet seen C++ be able to emulate with as little irritation.&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;I haven&amp;rsquo;t gotten around to writing code using newer &lt;code&gt;std::format&lt;/code&gt; or &lt;code&gt;println&lt;/code&gt; yet, so the jury&amp;rsquo;s out on that.&lt;/p&gt;</description></item><item><title>Who knew a simple logger class would be this complicated?</title><link>https://icyveins7.github.io/posts/2024/09/who-knew-a-simple-logger-class-would-be-this-complicated/</link><pubDate>Mon, 09 Sep 2024 20:00:00 +0800</pubDate><guid>https://icyveins7.github.io/posts/2024/09/who-knew-a-simple-logger-class-would-be-this-complicated/</guid><description>&lt;blockquote&gt;&#10;&lt;p&gt;Writing a printf-based C++ logger class was more of a journey than I originally thought..&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;I recently had to work with a codebase where the build process was so convoluted it couldn’t be run and debugged from within a Visual Studio instance, &lt;em&gt;despite being a Visual Studio solution&lt;/em&gt;.&lt;/p&gt;&#10;&lt;p&gt;This was primarily because it had a bunch of Java components, which were mainly used for the UI, and that prevented it from being run as a standard C++ application within the debugger (or maybe you could? I couldn’t find a way..)&lt;/p&gt;</description></item></channel></rss>