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

Hip updates main #511

Merged
merged 3 commits into from
Feb 12, 2024
Merged

Hip updates main #511

merged 3 commits into from
Feb 12, 2024

Conversation

StewMH
Copy link
Contributor

@StewMH StewMH commented Jan 22, 2024

As proposed by @krasznaa in acts-project/vecmem#261, extend the host and device macros for HIP.

Clang wanted TRACCC_HOST_DEVICE to be added to the function definition as well in a couple of places. I could not get compilation to work with gcc. Wasn't clear to me if this was supported at all.

I now get as far as a puzzling linker error:

[100%] Linking CXX executable ../../../bin/traccc_seeding_example_alpaka
/cvmfs/sft.cern.ch/lcg/releases/binutils/2.39-393d1/x86_64-centos7/bin/ld: CMakeFiles/traccc_seeding_example_alpaka.dir/seeding_example_alpaka.cpp.o: relocation R_X86_64_32S against symbol `_ZTVN6vecmem4copyE' can not be used when making a PIE object; recompile with -fPIE
/cvmfs/sft.cern.ch/lcg/releases/binutils/2.39-393d1/x86_64-centos7/bin/ld: failed to set dynamic section sizes: bad value

but I think this is separate and that these changes are safe.

Copy link
Member

@krasznaa krasznaa left a comment

Choose a reason for hiding this comment

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

I am very surprised about the TRACCC_HOST_DEVICE additions. 😕 These functions are clearly not needed by the CUDA code. (Otherwise that build would've failed.) So how are they needed by Alpaka when using the HIP backend? 😕

I knew for a while already that a couple more "common functions" will need to become TRACCC_HOST_AND_DEVICE from their current TRACCC_DEVICE status when finally we pick those up with Kokkos and Alpaka. But I did not expect any function, which was so far not marked as having to be a "device function" at all, to need such additions.

I guess I'll need to have a closer look at your Alpaka code... 🤔

@StewMH
Copy link
Contributor Author

StewMH commented Jan 31, 2024

Hi Attila,

I can reproduce the host device issue standalone:
https://godbolt.org/z/qcrcM5E85

You can see that rocm needs the declaration to match the definition (i.e. __host__ and __device__ in both), while nvcc does not.

@krasznaa
Copy link
Member

krasznaa commented Feb 5, 2024

Hi Attila,

I can reproduce the host device issue standalone: https://godbolt.org/z/qcrcM5E85

You can see that rocm needs the declaration to match the definition (i.e. __host__ and __device__ in both), while nvcc does not.

Ahh... I didn't appreciate that what you're doing here is to fix the inconsistency between the declaration and implementation of these functions. 🤔 Yes, that's definitely a bug in our current code...

Copy link
Member

@krasznaa krasznaa left a comment

Choose a reason for hiding this comment

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

As long as you run the changes through clang-format, I'll be okay with this. 😉

I.e.

docker run -it --rm -v $PWD:$PWD -w $PWD --user "$(id -u):$(id -g)" ghcr.io/acts-project/format10:v11
./traccc/.github/check_format.sh ./traccc/

@StewMH
Copy link
Contributor Author

StewMH commented Feb 6, 2024

@krasznaa should I merge from main again?

@StewMH
Copy link
Contributor Author

StewMH commented Feb 6, 2024

Merged into main to try out my new CI bridge privileges in any case

@krasznaa
Copy link
Member

krasznaa commented Feb 6, 2024

My own preference is to use rebasing in such cases, but this works fine as well...

Copy link
Contributor

@beomki-yeo beomki-yeo left a comment

Choose a reason for hiding this comment

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

Looks good

@beomki-yeo
Copy link
Contributor

I don't know how to remove the WIP block :(

@beomki-yeo beomki-yeo merged commit d8c8ca7 into acts-project:main Feb 12, 2024
17 checks passed
@StewMH StewMH deleted the hip_updates_main branch February 12, 2024 13:13
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.

3 participants