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

[CIR][CUDA] Add initial support for name-mangling CUDA declarations #1305

Closed
wants to merge 1 commit into from

Conversation

AdUhTkJm
Copy link
Contributor

The name-mangling for normal CUDA device/host functions are typically the same as normal C++ functions.

However, special care is taken when -fgpu-rdc is specified, which requires __device__ function names to be unique across complication unit in order to avoid symbol collisions.

Copy link
Member

@bcardosolopes bcardosolopes left a comment

Choose a reason for hiding this comment

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

This is missing a testcase. See clang/test/CIR for examples

@AdUhTkJm
Copy link
Contributor Author

AdUhTkJm commented Feb 1, 2025

Thank you. However, as there is no CUDA support yet, when I specify -fcuda-is-device, clang will crash after AST is parsed. In this case, how should I test the mangled name?

@bcardosolopes
Copy link
Member

... as there is no CUDA support yet, when I specify -fcuda-is-device, clang will crash after AST is parsed. In this case, how should I test the mangled name?

One strategy is to first focus on getting an empty file to build with all the flags you need, once that lands you resume this PR (so that you can finally check for the mangled name output).

@AdUhTkJm
Copy link
Contributor Author

AdUhTkJm commented Feb 5, 2025

I accidentally overwrote the branch of this PR, and I couldn't change it back. Sorry for that, I'll close this one and open up another PR when I'm ready.

@AdUhTkJm AdUhTkJm closed this Feb 5, 2025
@AdUhTkJm AdUhTkJm deleted the dev branch February 5, 2025 22:26
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.

2 participants