3 ms·
Good question. For your first point, Terracuda doesn't do anything particularly intelligent with movement between host/device memories--it's mostly there just t
by wcrichto 11y ago
Good question. For your first point, Terracuda doesn't do anything particularly intelligent with movement between host/device memories--it's mostly there just to hide that away from you. However, empirically, if your baseline is Lua or Python, almost anything you write in CUDA is going to be more efficient so long as you have enough data to parallelize over.
As for the second point, that is still mostly left to the programmer. GPU code doesn't necessarily preclude complex data structures, however. For one of my benchmarks, we used a software renderer that generates a quadtree on the fly and accesses that during the shading phase (https://github.com/willcrichton/terracuda/blob/master/renderer/cuda_renderer.t https://github.com/willcrichton/terracuda/blob/master/render...).
- w0utert 11y agoOn typical consumer hardware you really want to batch up your processing in a way that gives you the best computation/data ratio to prevent performance being killed by data latencies, I don't think any kind of solution exists that can do that for you automatically/transparently. For the usual suspects like signal processing stuff and such, these problems are relatively easy to overcome because you typically have large amounts of data that can be processed at once or in in blocks. What would make your project even more interesting is to see how it would perform on an heterogeneous system architecture (HSA), ie: what AMD is working towards. In an HSA, the CPU and GPU share the same memory and address space and a program can basically move processing between the two at close to no cost (no memory ever needs to be copied or mapped in/out GPU address space). For problems that allow some kind of pipelining to absorb start-up latencies caused by data dependencies, a combination of Lua + Terracuda would be pretty awesome, allowing you to move even small/short-running computational tasks to the GPU.