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

2021-03-10 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. Herald added a subscriber: dexonsmith. FYI there has been a related spec change that makes this functionality optional in the offline compilation: https://github.com/KhronosGroup/OpenCL-Docs/pull/522/files CHANGES SINCE LAST ACTION

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

2020-04-28 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. Herald added a project: LLVM. Herald added a subscriber: llvm-commits. The current solution seems very specific and doesn't provide generic uniform mechanisms for the targets. Would something based on a triple component not work? CHANGES SINCE LAST ACTION

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

2020-04-16 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D77923#1987795 , @jvesely wrote: > will this trigger extra warnings for the user? No. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77923/new/ https://reviews.llvm.org/D77923

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

2020-04-16 Thread Jan Vesely via Phabricator via cfe-commits
jvesely added a comment. In 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

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

2020-04-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. 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

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

2020-04-15 Thread Matt Arsenault via Phabricator via cfe-commits
arsenm updated this revision to Diff 257684. arsenm added a comment. Attach correct diff CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77923/new/ https://reviews.llvm.org/D77923 Files: clang/include/clang/Basic/TargetInfo.h clang/lib/Basic/Targets/AMDGPU.cpp

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

2020-04-15 Thread Matt Arsenault via Phabricator via cfe-commits
arsenm updated this revision to Diff 257681. arsenm added a comment. Check triple for support. Report 2.0 for -amdhsa and -amdpal with flat support, but 1.2 for clover/-mesa3d. Also require targets to explicitly set a value to define, rather than defaulting. CHANGES SINCE LAST ACTION

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

2020-04-14 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D77923#1981698 , @jvesely wrote: > does passing `-U__OPENCL_VERSION__ -D __OPENCL_VERSION__=x.y` on the > commadline work as well? the header trick was my fallback path. Yes the command line option -U or -D override

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

2020-04-14 Thread Jan Vesely via Phabricator via cfe-commits
jvesely added a comment. In D77923#1981398 , @arsenm wrote: > In D77923#1979286 , @jvesely wrote: > > > > In D77923#1976497 , @jvesely > > > wrote: > > > > > >>

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

2020-04-14 Thread Matt Arsenault via Phabricator via cfe-commits
arsenm added a comment. In D77923#1979286 , @jvesely wrote: > > In D77923#1976497 , @jvesely wrote: > > > >> OPENCL_VERSION is something that should be really set by the opencl driver > >> rather than the

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

2020-04-14 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. As for OpenCL C spec we should ideally add `__OPENCL_VERSION__` but I feel it should be taken from architecture or OS type... I think there were other cases where we needed something like an OpenCL runtime version in the triple too but I can't remember this now. I

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

2020-04-13 Thread Jan Vesely via Phabricator via cfe-commits
jvesely added a comment. > In D77923#1976497 , @jvesely wrote: > >> OPENCL_VERSION is something that should be really set by the opencl driver >> rather than the compiler. >> coarse-grained SVM can be done without FEATURE_FLAT_ADDRESS_SPACE, so those

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

2020-04-13 Thread Brian Sumner via Phabricator via cfe-commits
b-sumner added a comment. In my opinion, for on-line compile for OpenCL, the platform is responsible for setting `__OPENCL_VERSION__`. Also, it should be the platform's choice as to how to respond the image support query and how `__IMAGE_SUPPORT__` is set. For offline compile, it doesn't

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

2020-04-13 Thread Scott Linder via Phabricator via cfe-commits
scott.linder added a comment. In D77923#1978261 , @arsenm wrote: > In D77923#1978172 , @scott.linder > wrote: > > > https://www.khronos.org/registry/OpenCL/sdk/2.0/docs/man/xhtml/preprocessorDirectives.html > >

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

2020-04-13 Thread Matt Arsenault via Phabricator via cfe-commits
arsenm added a comment. In D77923#1978172 , @scott.linder wrote: > https://www.khronos.org/registry/OpenCL/sdk/2.0/docs/man/xhtml/preprocessorDirectives.html > describes `__OPENCL_VERSION__` as "an integer reflecting the version number > of the OpenCL

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

2020-04-13 Thread Scott Linder via Phabricator via cfe-commits
scott.linder added a comment. https://www.khronos.org/registry/OpenCL/sdk/2.0/docs/man/xhtml/preprocessorDirectives.html describes `__OPENCL_VERSION__` as "an integer reflecting the version number of the OpenCL supported by the OpenCL device." as contrasted with `__OPENCL_C_VERSION__` which is

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

2020-04-13 Thread Matt Arsenault via Phabricator via cfe-commits
arsenm added a comment. In D77923#1976497 , @jvesely wrote: > OPENCL_VERSION is something that should be really set by the opencl driver > rather than the compiler. > coarse-grained SVM can be done without FEATURE_FLAT_ADDRESS_SPACE, so those > gpus

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

2020-04-11 Thread Jan Vesely via Phabricator via cfe-commits
jvesely added a comment. OPENCL_VERSION sounds like something that should be really set by the opencl driver rather than the compiler. coarse-grained SVM can be done without FEATURE_FLAT_ADDRESS_SPACE, so those gpus can get over 1.2, while the compiler can be used in an implementation that

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

2020-04-10 Thread Matt Arsenault via Phabricator via cfe-commits
arsenm created this revision. arsenm added reviewers: Anastasia, yaxunl, scott.linder. Herald added subscribers: kerbowa, hiraditya, nhaehnle, wdng, jvesely. Some of the device specific standard predefines were missing. __IMAGE_SUPPORT__ was only hardcoded for SPIR. __OPENCL_VERSION__