TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Revisiting the Business Card Raytracer

176 点作者 vanni大约 5 年前

11 条评论

bigcheesegs大约 5 年前
&gt; Opening the binary with Binary Ninja revealed that clang had already managed to leverage the SSE registers.<p>X86-64 uses SSE registers for all floating point operations. I&#x27;m not sure that the author realized that they were looking at an -O0 binary. -O0 does not do vectorization (or anything else for that matter).
评论 #23121138 未加载
评论 #23121405 未加载
评论 #23121163 未加载
rwmj大约 5 年前
Is there a mistake in the original code on the right hand side? I get:<p><pre><code> card.cpp:16:2: error: ‘g’ was not declared in this scope 16 | &lt;g;p)t=p,n=v(0,0,1),m=1;for(i k=19;k--;) | ^ </code></pre> Edit: Yes there is. The ‘&lt;g;’ seems like it should have been the single character ‘&lt;’, perhaps a corrupted HTML escape.
评论 #23126532 未加载
评论 #23124319 未加载
danielscrubs大约 5 年前
Well there goes my weekend. :)<p>I also tried to optimise the code, and got great speed increases with just constexpr the vector methods and could quickly see that rand was problematic and then Fabien releases this post with nvcc that are another level. Really great blog post!
ectoplasmaboiii大约 5 年前
A Ray-Tracer in 7 Lines of K: <a href="http:&#x2F;&#x2F;nsl.com&#x2F;k&#x2F;ray&#x2F;ray.k" rel="nofollow">http:&#x2F;&#x2F;nsl.com&#x2F;k&#x2F;ray&#x2F;ray.k</a>
评论 #23124216 未加载
blondin大约 5 年前
i love what fabien is doing with his website!<p>also been experimenting with pure html with an itsy-bitsy amount of css. for months now i wondered how to display code without involving javascript.<p>that textarea is so perfect! and i bet you when you copy and paste into word or your todo list application they won&#x27;t even try to be &quot;smart&quot; about knowing what &quot;rich text&quot; is...<p>that&#x27;s very cool.
评论 #23121319 未加载
评论 #23124126 未加载
评论 #23122898 未加载
rrss大约 5 年前
This was really fun to read, thanks fsanglard.<p>&gt; This is correlated with the warning nvcc issued. Because the raytracer uses recursion, it uses a lot of stacks. So much actually that the SM cannot keep more than a few alive.<p>Stack frame size &#x2F; &quot;local memory&quot; size doesn&#x27;t actually directly limit occupancy. There&#x27;s a list of the limiters here: <a href="https:&#x2F;&#x2F;docs.nvidia.com&#x2F;gameworks&#x2F;content&#x2F;developertools&#x2F;desktop&#x2F;analysis&#x2F;report&#x2F;cudaexperiments&#x2F;kernellevel&#x2F;achievedoccupancy.htm" rel="nofollow">https:&#x2F;&#x2F;docs.nvidia.com&#x2F;gameworks&#x2F;content&#x2F;developertools&#x2F;des...</a>. I&#x27;m not sure why the achieved occupancy went up after removing the recursion, but I&#x27;d guess it was something like the compiler was able to reduce register usage.
fegu大约 5 年前
Almost into passable frame rate territory. Next version could be business card VR:)
ntry大约 5 年前
101,000ms to 150ms is a phenomenal speedup. Props
评论 #23121537 未加载
mianos大约 5 年前
I wonder if the tool-chain would be better under Linux? It is kind if funny the way Windows development has always been a hassle. Mscvars.bat and such has been there for at least 20 years.
tomsmeding大约 5 年前
Nice work on the GPU programming, and the multicore before that, but I&#x27;m mystified why going from -O0 to -O3 is named an &quot;optimisation&quot;. All respect for Fabien, but running code that&#x27;s supposed to run faster than a snail (and if you&#x27;re not debugging and require -O0 for reasonable output) implies -O2 or -O3. (In practice, -O3 often doesn&#x27;t give much performance over -O2, despite increasing compile times.)<p>The initial time is not 101.8 seconds, it&#x27;s 11.6 seconds.
评论 #23123307 未加载
评论 #23123697 未加载
lonk大约 5 年前
If you increase resolution you can put more code on business card :P
评论 #23131593 未加载
评论 #23122333 未加载