Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation error when using HIP with RDC #4553

Merged
merged 1 commit into from
Nov 30, 2021
Merged

Conversation

Rombur
Copy link
Member

@Rombur Rombur commented Nov 24, 2021

With this PR and ROCm 4.5, RDC works.

Comment on lines 57 to 63
#ifndef KOKKOS_ENABLE_HIP_RELOCATABLE_DEVICE_CODE
__attribute__((noinline))
#else
inline
#endif
void
hip_abort(char const *msg) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm... can't you just do

Suggested change
#ifndef KOKKOS_ENABLE_HIP_RELOCATABLE_DEVICE_CODE
__attribute__((noinline))
#else
inline
#endif
void
hip_abort(char const *msg) {
[[noreturn]] __device__ __attribute__((noinline)) inline void hip_abort(
char const *msg) {

Is there a problem declaring the function always inline?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We decided not to inline because the compiler was generating poor code if you inline the printf. I don't know if the problem has been fixed or not.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I didn't argue about __attribute__((noinline)) but was asking about inline.

@dalg24
Copy link
Member

dalg24 commented Nov 25, 2021

Do you want to add a RDC build on the Jenkins CI?

@Rombur
Copy link
Member Author

Rombur commented Nov 29, 2021

Retest this please

@Rombur
Copy link
Member Author

Rombur commented Nov 29, 2021

Do you want to add a RDC build on the Jenkins CI?

Ideally yes but we need ROCm 4.5 and linking with RDC is still very slow :/

@crtrott crtrott merged commit aebba2e into kokkos:develop Nov 30, 2021
@Rombur Rombur deleted the rdc branch November 30, 2021 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants