[llvm] [Offload] Store kernel name in GenericKernelTy (PR #142799)

Ross Brunton via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 1 05:34:08 PDT 2025


================
@@ -277,7 +282,7 @@ struct GenericKernelTy {
                            AsyncInfoWrapperTy &AsyncInfoWrapper) const = 0;
 
   /// Get the kernel name.
-  const char *getName() const { return Name; }
+  const char *getName() const { return Name.data(); }
----------------
RossBrunton wrote:

We have code in several places like this:

```c++
    Res = cuModuleGetFunction(&Func, CUDAImage.getModule(), getName());
    if (auto Err = Plugin::check(Res, "error in cuModuleGetFunction('%s'): %s",
                                 getName()))
      return Err;
```

Which expect getName() to return a c-string.

https://github.com/llvm/llvm-project/pull/142799


More information about the llvm-commits mailing list