[PATCH] D77923: OpenCL: Fix some missing predefined macros

Jan Vesely via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 16 15:37:46 PDT 2020


jvesely added a comment.

In D77923#1983787 <https://reviews.llvm.org/D77923#1983787>, @yaxunl wrote:

> LGTM. The objective of the change is to simplify offline compilation. We want to avoid asking users to add -D if a proper macro can be inferred from triple and cpu. Ideally, users only need to specify triple and cpu with clang driver. In case users want to override the default macros for the triple, they can always override them by -D or -U in command line.


will this trigger extra warnings for the user? 
as long as there's a way to set custom values I'm fine.
I just don't understand why this can' be appended to the command line by the offline compiler distributed with the platform (and based on release if needed).
The platform will need to get the same number + any additional information it wants to report in `clGetDeviceInfo(CL_DEVICE_VERSION)` anyway so having it in one place would be prudent.

> The question is whether the default value of the macro is proper. To me this change maintained the old behavior for spir and other targets and the default value seems fine for amdgcn.




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

https://reviews.llvm.org/D77923





More information about the cfe-commits mailing list