[clang] [Clang] Add a flag to include GPU startup files (PR #112025)

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 18 05:42:51 PDT 2024


jhuber6 wrote:

> Can you explain again why the compiler isn't providing the C library and the start files implicitly by default, just like it does for non-GPU code?

Because the GPU is not a target that wants to provide a C library and start files by default. This is an edge case where I make the  GPU look like a normal target for unit testing purposes. If you use a GPU this way, you're basically turning your 1000$+ card into a 10$ Raspberry Pi, it's not something people want by default. Kernels cannot be optimized out, and currently 0.001% of GPU applications in the wild define a `main` function on the device side so it would cause a linker error.

https://github.com/llvm/llvm-project/pull/112025


More information about the cfe-commits mailing list