- They need to be preserved even if there's no reference within the device code as the host code may need to initialize them based on the application logic.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/lib/CodeGen/CodeGenModule.cpp | ||
---|---|---|
4441–4443 | we need also do this with variables with HIPManagedAttr and add a test for that |
clang/lib/CodeGen/CodeGenModule.cpp | ||
---|---|---|
4441–4443 | those managed var seems already being marked 'externally_initalized' in lib/CodeGen/CGCUDANV.cpp. Do you have missing places to mark them? |
Comment Actions
LGTM on HIP side. I am not sure whether CUDA needs this.
clang/lib/CodeGen/CodeGenModule.cpp | ||
---|---|---|
4441–4443 | sorry, I fogot. Then it should be OK. We don't have other places to handle managed variables. |
Comment Actions
CUDA lowers texture/surface types into a special handle. I do not think externally_initialized matters for it.
AFAICT this change is a no-op for CUDA.
we need also do this with variables with HIPManagedAttr and add a test for that