This is an archive of the discontinued LLVM Phabricator instance.

[amdgpu] start documenting amdgpu support by clang
ClosedPublic

Authored by yaxunl on Jun 29 2023, 12:13 PM.

Diff Detail

Event Timeline

yaxunl created this revision.Jun 29 2023, 12:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 29 2023, 12:13 PM
yaxunl requested review of this revision.Jun 29 2023, 12:13 PM
yaxunl updated this revision to Diff 535952.Jun 29 2023, 12:14 PM

remove redundant text

jdoerfert added inline comments.Jun 29 2023, 1:10 PM
clang/docs/AMDGPUSupport.rst
34

FWIW, this arguably confusing use of AMD, and duplication of AMDGPU, should be deprecated and removed. Or at least not advocated...

63

Any reason this one does not end in __?

arsenm added inline comments.Jun 29 2023, 1:16 PM
clang/docs/AMDGPUSupport.rst
55

The fma macro was actually from the opencl spec but never handled in the correct place

yaxunl added inline comments.Jun 29 2023, 1:34 PM
clang/docs/AMDGPUSupport.rst
63

It is my mistake. Did not consider consistency when designing this macro.

yaxunl marked 3 inline comments as done.Jun 29 2023, 2:30 PM
yaxunl added inline comments.
clang/docs/AMDGPUSupport.rst
34

will remove from the documentation.

55

will remove

yaxunl updated this revision to Diff 536004.Jun 29 2023, 2:31 PM
yaxunl marked 2 inline comments as done.

revised by comments

I would recommend to introduce __AMDGCN_WAVEFRONT_SIZE__ as an alias for '__AMDGCN_WAVEFRONT_SIZE and at some point to deprecate the latter.
Otherwise, LGTM

yaxunl added a comment.EditedJun 30 2023, 5:42 AM

I would recommend to introduce __AMDGCN_WAVEFRONT_SIZE__ as an alias for '__AMDGCN_WAVEFRONT_SIZE and at some point to deprecate the latter.
Otherwise, LGTM

Added __AMDGCN_WAVEFRONT_SIZE__ in https://reviews.llvm.org/D154207. will update the documentation

yaxunl updated this revision to Diff 536203.Jun 30 2023, 6:05 AM

added __AMDGCN_WAVEFRONT_SIZE__ and reordered

arsenm added inline comments.Jun 30 2023, 12:12 PM
clang/docs/AMDGPUSupport.rst
21

"on amdgpu target" doesn't sound grammatical

lamb-j added a subscriber: lamb-j.Jun 30 2023, 12:24 PM
lamb-j added inline comments.
clang/docs/AMDGPUSupport.rst
21

"for the amdgpu target"? or
"on AMD GPU targets?"

50

Defined?

yaxunl marked 3 inline comments as done.Jul 3 2023, 1:59 PM
yaxunl added inline comments.
clang/docs/AMDGPUSupport.rst
21

will use "on AMD GPU targets".

50

will fix

yaxunl updated this revision to Diff 536887.Jul 3 2023, 1:59 PM
yaxunl marked 2 inline comments as done.

revised by comments

arsenm accepted this revision.Jul 7 2023, 5:34 AM

Need to start somewhere

This revision is now accepted and ready to land.Jul 7 2023, 5:34 AM
This revision was landed with ongoing or failed builds.Jul 7 2023, 7:36 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 7 2023, 7:36 AM
scchan added inline comments.Jul 7 2023, 9:37 AM
clang/docs/AMDGPUSupport.rst
47

This set of feature macros is tricky. A feature macro is defined only when the corresponding target feature has been explicitly specified during compilation; otherwise it's undefined. Users will have to refer to the target feature table to get the semantic of each state. For example, for xnack, undefined=="any", 1 for xnack+, 0 for xnack-.

Is there a reason we don't support features other than sramecc and xnack?

yaxunl marked an inline comment as done.Jul 7 2023, 10:51 AM
yaxunl added inline comments.
clang/docs/AMDGPUSupport.rst
47

This macro is designed to support Target ID only, therefore it is only emitted when target ID containing the feature is used.

The target ID features are stable since they are used to select code objects from fat binaries.

My understanding is that other features used by amdgpu backend do not have stable feature names, therefore are not suitable to be used as predefined macros for users to condition their code.

scchan added inline comments.Jul 7 2023, 11:35 AM
clang/docs/AMDGPUSupport.rst
47

The current wording seems to imply that a feature macro is always defined if that target feature is supported but that's not the case. For example, the macro amdgcn_feature_xnack is undefined if a user compiles for xnack="any".