[PATCH] D79344: [cuda] Start diagnosing variables with bad target.

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 4 12:54:25 PDT 2020


tra added a comment.

This has a good chance of breaking existing code. It would be great to add an escape hatch option to revert to the old behavior if we run into problems. The change is relatively simple, so reverting it in case something goes wrong should work, too. Up to you.



================
Comment at: clang/test/SemaCUDA/variable-target.cu:6
+
+static int gvar;
+// expected-note at -1{{'gvar' declared here}}
----------------
The current set of tests only verifies access of host variable from device side. We need to check that things work in other direction (i.e. device veriable is not accessible from host). A bit of it is covered in function-overload.cu, but it would make sense to deal with all variable-related things here.

It would be great to add more test cases:
* access of device variable from various host functions.
* test cases to verify that &var and sizeof(var) works for device vars in host functions.




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79344





More information about the cfe-commits mailing list