[PATCH] D94814: [HIP] Support `__managed__` attribute

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 22 08:23:34 PST 2021


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


================
Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:8245
     "%select{__device__|__global__|__host__|__host__ __device__}0 functions">;
-def err_cuda_nonstatic_constdev: Error<"__constant__ and __device__ are not allowed on non-static local variables">;
+def err_cuda_nonstatic_constdev: Error<"__constant__, __device__, and __managed__ are not allowed on non-static local variables">;
 def err_cuda_ovl_target : Error<
----------------
aaron.ballman wrote:
> Since we're modifying this line anyway, can you wrap it for the 80-col limit?
will fix when committing


================
Comment at: clang/test/SemaCUDA/managed-var.cu:45
+__managed__ A a;
+// expected-error at -1 {{dynamic initialization is not supported for __device__, __constant__, __shared__, and __managed__ variables}}
----------------
aaron.ballman wrote:
> I think you're missing tests that check that the new managed attribute accepts no arguments and that it doesn't apply to things other than variables (like a function declaration).
will add tests when committing


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

https://reviews.llvm.org/D94814



More information about the cfe-commits mailing list