Using --optimize or -O with NVCC Looking for documentation

I’ve been reading through the NVCC documentation and I see that there is an option that can be used at compile time to set the required level of optimization of the code. This is something that I’m really interested in using but I can’t find any further details on how to use it in terms of what levels can be set and what these equate to.

Does anyone have any suggestions as to where I could find documentation or guidance on how to use this? I have tried searching in various places for help but no joy, this post is something of a last resort.

Many thanks in advance for any help.

This option is directly passed through to the host compiler. So see your host compiler’s documentation for further details.

Device code is not influenced by [font=“Courier New”]-O[/font] (It could be set through [font=“Courier New”]-Xopencc=-O[/font], but it already defaults to highest optimization and changing it is not recommended).

Hi tera,

Thanks very much for this it’s very helpful, I’m using GCC on Linux and I’ve found the relevant documentation.