[PATCH] D68578: [HIP] Fix device stub name

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 9 14:03:35 PDT 2020


yaxunl marked 9 inline comments as done.
yaxunl added inline comments.


================
Comment at: clang/include/clang/AST/GlobalDecl.h:61
     assert(!isa<CXXDestructorDecl>(D) && "Use other ctor with dtor decls!");
+    assert(!D->hasAttr<CUDAGlobalAttr>() && "Use other ctor with HIP kernels!");
 
----------------
tra wrote:
> Wording inconsitency -- we're checking for `CUDAGlobalAttr` but complaining about 'HIP kernels'. Just drop 'HIP' or replace with 'GPU'?
will use GPU kernel


================
Comment at: clang/lib/CodeGen/CGCUDARuntime.h:69
   virtual llvm::Function *makeModuleDtorFunction() = 0;
-
-  /// Construct and return the stub name of a kernel.
-  virtual std::string getDeviceStubName(llvm::StringRef Name) const = 0;
+  virtual std::string getDeviceSideName(const Decl *ND) = 0;
 };
----------------
tra wrote:
> Adding a descriptive comment would be great. Otherwise anyone looking at the function decl without the context of this patch will be puzzled about its meaning and purpose.
> 
> Also, perhaps the argument type should be a `NamedDecl` -- the function is not used on or useful for regular `Decl`. It will save us few casts in other places, too.
done


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68578/new/

https://reviews.llvm.org/D68578





More information about the cfe-commits mailing list