yaxunl added inline comments.
================ Comment at: clang/test/SemaCUDA/device-var-init.cu:404 __host__ __device__ void hd_sema() { static int x = 42; } ---------------- tra wrote: > yaxunl wrote: > > how does this work in device compilation? Is this equivalent to `static > > __device__ int x = 42`? > Correct. so static variable without `__device__/__constant__` attribute in host device function implies `__device__` attribute in device compilation. Is this also true in device function? We need Sema and CodeGen tests for these cases. Also, can we document these changes? It is easily forgotten. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88345/new/ https://reviews.llvm.org/D88345 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits