diff options
| author | Ross Brunton <ross@codeplay.com> | 2025-07-02 14:11:05 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-02 14:11:05 +0100 |
| commit | 4f02965ae2462b2ba05426e88ac22845e12295aa (patch) | |
| tree | 8b4e36e04c2b6ada825a071312f9c631fb750691 /offload/plugins-nextgen | |
| parent | e63de82d904c2364c84489894eeb81fb9c08a023 (diff) | |
[Offload] Store kernel name in GenericKernelTy (#142799)
GenericKernelTy has a pointer to the name that was used to create it.
However, the name passed in as an argument may not outlive the kernel.
Instead, GenericKernelTy now contains a std::string, and copies the
name into there.
Diffstat (limited to 'offload/plugins-nextgen')
| -rw-r--r-- | offload/plugins-nextgen/common/include/PluginInterface.h | 4 | ||||
| -rw-r--r-- | offload/plugins-nextgen/common/src/PluginInterface.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/offload/plugins-nextgen/common/include/PluginInterface.h b/offload/plugins-nextgen/common/include/PluginInterface.h index fbc798faec24..b5addc13d664 100644 --- a/offload/plugins-nextgen/common/include/PluginInterface.h +++ b/offload/plugins-nextgen/common/include/PluginInterface.h @@ -317,7 +317,7 @@ struct GenericKernelTy { AsyncInfoWrapperTy &AsyncInfoWrapper) const = 0; /// Get the kernel name. - const char *getName() const { return Name; } + const char *getName() const { return Name.c_str(); } /// Get the kernel image. DeviceImageTy &getImage() const { @@ -413,7 +413,7 @@ private: } /// The kernel name. - const char *Name; + std::string Name; /// The image that contains this kernel. DeviceImageTy *ImagePtr = nullptr; diff --git a/offload/plugins-nextgen/common/src/PluginInterface.cpp b/offload/plugins-nextgen/common/src/PluginInterface.cpp index ac7031b6e881..81b9d423e13d 100644 --- a/offload/plugins-nextgen/common/src/PluginInterface.cpp +++ b/offload/plugins-nextgen/common/src/PluginInterface.cpp @@ -456,7 +456,7 @@ Error GenericKernelTy::init(GenericDeviceTy &GenericDevice, KernelEnvironment = KernelEnvironmentTy{}; DP("Failed to read kernel environment for '%s' Using default Bare (0) " "execution mode\n", - Name); + getName()); } // Max = Config.Max > 0 ? min(Config.Max, Device.Max) : Device.Max; |
