Add builtin function __builtin_get_device_side_mangled_name
to get device side manged name for functions and global
variables, which can be used to get symbol address of kernels
or variables by mangled name in dynamically loaded
bundled code objects at run time.
Details
Details
- Reviewers
tra - Commits
- rGcc9477166a53: [CUDA][HIP] add __builtin_get_device_side_mangled_name
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
LGTM with a couple of nits.
clang/include/clang/Basic/Builtins.h | ||
---|---|---|
39 | The issue is common for both CUDA and HIP. | |
clang/include/clang/Basic/DiagnosticSemaKinds.td | ||
8307 | Nit. I'd rephrase it in terms of what makes the argument invalid. E.g. symbol must be a device-side function or global variable. | |
clang/lib/Basic/Builtins.cpp | ||
78 | Please enable it for CUDA, too. | |
78–84 | Wow! The density of negations in this function is impressive. | |
clang/lib/Sema/SemaChecking.cpp | ||
1980–1983 | return D->hasAttr<CUDAGlobalAttr>() || D->hasAttr<CUDADeviceAttr>() || D->hasAttr<CUDAConstantAttr>() || D->hasAttr<HIPManagedAttr>(); |
The issue is common for both CUDA and HIP.