[PATCH] D145343: [AMDGPU] Emit predefined macro `__AMDGCN_CUMODE_OPTION`

Brian Sumner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 5 19:33:30 PST 2023


b-sumner added a comment.

In D145343#4170305 <https://reviews.llvm.org/D145343#4170305>, @yaxunl wrote:

> In D145343#4170250 <https://reviews.llvm.org/D145343#4170250>, @arsenm wrote:
>
>> I think exposing whether or not the flag was used is weird/broken, as is including _OPTION in the name. Should just define to whether it's enabled or not
>
> I agree. @b-sumner What do you think?

I think applications may need to check if CUMode is enabled at compile time and select code based on that.  But a concern has been raised about compiling such source with an older compiler which is not setting the macro regardless of whether -mcumode was used.   The conservative approach here would be to only define a macro only if -mcumode is used, and define nothing if it is not used.  Then, when using an old compiler, the code will assume -mno-cumode which is always fine to do.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145343/new/

https://reviews.llvm.org/D145343



More information about the cfe-commits mailing list