[clang] [llvm] [Offload] Provide a kernel library useable by the offload runtime (PR #104168)
Johannes Doerfert via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 21 10:02:28 PDT 2024
================
@@ -393,22 +393,17 @@ struct CUDADeviceTy : public GenericDeviceTy {
return Plugin::success();
}
- virtual Error callGlobalConstructors(GenericPluginTy &Plugin,
- DeviceImageTy &Image) override {
- // Check for the presense of global destructors at initialization time. This
- // is required when the image may be deallocated before destructors are run.
- GenericGlobalHandlerTy &Handler = Plugin.getGlobalHandler();
- if (Handler.isSymbolInImage(*this, Image, "nvptx$device$fini"))
- Image.setPendingGlobalDtors();
-
- return callGlobalCtorDtorCommon(Plugin, Image, /*IsCtor=*/true);
+ virtual Expected<StringRef>
+ getGlobalConstructorName(DeviceImageTy &Image) override {
+ if (auto Err = prepareGlobalCtorDtorCommon(Image, /*IsCtor=*/true))
+ return Err;
+ return "nvptx$device$init";
}
-
- virtual Error callGlobalDestructors(GenericPluginTy &Plugin,
- DeviceImageTy &Image) override {
- if (Image.hasPendingGlobalDtors())
- return callGlobalCtorDtorCommon(Plugin, Image, /*IsCtor=*/false);
- return Plugin::success();
+ virtual Expected<StringRef>
+ getGlobalDestructorName(DeviceImageTy &Image) override {
+ if (auto Err = prepareGlobalCtorDtorCommon(Image, /*IsCtor=*/false))
----------------
jdoerfert wrote:
I'll look into it.
https://github.com/llvm/llvm-project/pull/104168
More information about the cfe-commits
mailing list