[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.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user