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] Generate attribute for kernel name of device stubs #1317

Merged
merged 1 commit into from
Feb 10, 2025

Conversation

AdUhTkJm
Copy link
Contributor

@AdUhTkJm AdUhTkJm commented Feb 7, 2025

Now a __global__ function on host will be generated to a device stub, with an attribute recording the corresponding kernel name (mangled name on device of the same function). The dynamic registration phase will be implemented in LLVM lowering.

For example, CIR generated for __global__ void global_fn(); looks like

#fn_attr1 = #cir<extra({cuda_kernel_name = #cir.cuda_kernel_name<_Z9global_fnv>})>
cir.func private @_Z24__device_stub__global_fnv() extra(#fn_attr1)

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.

Awesome, some comments inline

@bcardosolopes bcardosolopes merged commit 2294d5f into llvm:main Feb 10, 2025
6 checks passed
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