Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Driver/Tools.cpp | ||
---|---|---|
10707 ↗ | (On Diff #47558) | I think this is would be very surprising to users. -g does not usually have a large performance impact, so -O2 -g does not generally mean "generate slow code," as far as I know. I'm concerned that this will result in people accidentally compiling with ptxas -O0 (which is why I didn't do it like this to begin with). Can we accomplish this in a more explicit way? |
lib/Driver/Tools.cpp | ||
---|---|---|
10707 ↗ | (On Diff #47558) | Other than warning I'm not sure what we can do, we could do that instead and make everyone use O0 that wants debug info in their ptx? |
lib/Driver/Tools.cpp | ||
---|---|---|
10707 ↗ | (On Diff #47558) | I'd rather we refuse to do anything (i.e. produce an error) than silently remove either optimizations or -g. Do we have a way to separately specify the optimization level for host and device code? If not, looks like we should add one. |
lib/Driver/Tools.cpp | ||
---|---|---|
10707 ↗ | (On Diff #47558) | NVCC has -G option to control ptxas' debug options. If it's present, ptxas optimizations are disabled. I could add a similar option. "-gcuda-device" perhaps? |
lib/Driver/Tools.cpp | ||
---|---|---|
10707 ↗ | (On Diff #47558) | @hfinkel: separate option should work. Any suggestions for a good name? -gcuda-device sounds awkward. @echristo: "-O0" is not going to work for everyone in practice due to ptxas limitations. For instance on some thrust files ptxas runs out of memory on all non-inlined functions in unoptimized code. Compiling with -O2 is one way to work around that, but I do want device-side debug info! |
lib/Driver/Tools.cpp | ||
---|---|---|
10707 ↗ | (On Diff #47558) | We can do that, I'd have warned because it doesn't seem like something we should hard error on, but I can see that perspective, i.e. we asked for "incompatible" options. And no, we don't currently have a way to do that. We can try to come up with a driver interface. |
10707 ↗ | (On Diff #47558) | Huh? I'm not sure what you're doing here then with turning off optimizations in the presence of debug info requests. Your commentary made it sound like you can't have both. |
lib/Driver/Tools.cpp | ||
---|---|---|
10707 ↗ | (On Diff #47558) | @echristo: I assumed you were talking about compiler when you said "make everyone use O0". I need compiler to optimize code with -O2, but run ptxas with -g and -O0 which this patch makes possible. I'll update the patch to add an option to control device-side debug info explicitly. |
lib/Driver/Tools.cpp | ||
---|---|---|
10707 ↗ | (On Diff #47558) | OK. |
Added --cuda-noopt-device-debug option to control ptxas' debug info generation.
The idea was to make it painfully obvious that unlike regular -g this option 8s going to affect performance of device-side code.
The option name is a mouthful, so feel free to suggest better alternatives.
lib/Driver/Tools.cpp | ||
---|---|---|
10696 ↗ | (On Diff #47680) | Nit: ignore the compiler's |