r/cpp • u/User_Deprecated • May 02 '26
CppCon CppCon 2025: Can Standard C++ Replace CUDA for GPU Acceleration? - Elmar Westphal
https://www.youtube.com/watch?v=EOvukoCyW7A
27
Upvotes
r/cpp • u/User_Deprecated • May 02 '26
23
u/James20k P2005R0 May 02 '26
The problem with approaches like this is that they work ok for simple problems, but when you run into anything even remotely advanced, the whole model breaks down entirely. And that's when you realise that you've fundamentally invested into a dead end technologically, and you have to rewrite your entire GPU offloading process to use a proper gpu language + api
If you're writing new code, there's no real reason to use the standard library for your GPU offloading, because in the long term you'll just make your life more complicated. C++ simply doesn't have the correct tools to be able to offload in a high performance way
11
u/JuanAG May 02 '26
Intersting to see comments disabled on the YT
I have left some critic ones on some videos (that got deleted/censored) when i think it was needed but i really didnt know that i was just one of many and they opted for the easy solution being no more comments no matter what
I never had any issue with NDC conf (same at Google I/O or whatever it is called now) and i am the same level of critic, if the speaker say non sense i will share my point of view about that later, sometimes they give me the "heart" so they took the feedback as a way to improve and maybe translate to the speaker
5
u/victotronics May 02 '26
Just based on the screenshot: this works if the amount of computation is big enough to swamp the data transfer. If not, you need some way to express asynchronous transfer, and C++ has no concept of affinity, NUMA, all that architecture stuff. Basically, C++ lives in a Von Neumann world, which hasn't existed since 1990 or so.
3
u/LiliumAtratum May 02 '26
I think a language good for GPU-like architectures shoudn't just abstract out the notion of location of memory (host memory, device memory, on-chip shared memory, etc...). Quite the opposite, the programmer should be exposed to it, but in some convenient, uniform matter.
Currently you either accept the abstraction out, or you have to play with tedious function calls that make the transfers.
Same goes with mapping of execution onto the hardware. There needs to be a convenient, uniform way to specify how and where the code should execute. Single-threaded CPU or maybe spliced onto SIMD lanes? Executed on GPU in a single threaded way (slow, but sometimes useful for short control code), split onto single Multiprocessor, or MP cluster or whole grid/hardware? For all those cases you need an entirely different implementation that ultimately does the same thing. Do not abstract it out, but make it convenient to specify or change. std::execution is not the solution for me. It abstracts too much, gives too little control.