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|HIP] Removes special handling for CUDA|HIP global function #1339

Closed
wants to merge 1 commit into from

Conversation

koparasy
Copy link
Contributor

The GetAddrOfFunction returns now the host address.

@koparasy
Copy link
Contributor Author

koparasy commented Feb 12, 2025

@AdUhTkJm I think we should remove the special handling over here. Earlier you had this but that never evaluates to true on cuda, cause lang.HIP && lang.CUDA always is false when building nvCuda. On #1333 I was rigorous and checked whether the function is a definition.

This removes the special case completely and continues to CodeGen, in which you fill in the global body with the stub.

@AdUhTkJm
Copy link
Contributor

AdUhTkJm commented Feb 12, 2025

The OG says whenever we refer to the device stub in HIP, we need to use the handle address instead. So I think this special case is indeed necessary, and should be implemented along with the generation of handles.

It was my fault to write langOpts.HIP && langOpts.CUDA. It should be the change that you suggested in your previous PR, (langOpts.HIP || langOpts.CUDA) && hasAttr<GlobalAttr> && IsForDefinition. The same branch is present in OG.

@koparasy
Copy link
Contributor Author

Just letting you know that I am working on this.

@koparasy koparasy closed this Feb 13, 2025
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