[PATCH] D98193: [CUDA][HIP] Allow non-ODR use of host var in device

2021-04-19 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd8805574c183: [CUDA][HIP] Allow non-ODR use of host var in device (authored by yaxunl). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.ll

[PATCH] D98193: [CUDA][HIP] Allow non-ODR use of host var in device

2021-04-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 338552. yaxunl marked an inline comment as done. yaxunl added a comment. Rebase and fix HIP header bug exposed by this patch. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98193/new/ https://reviews.llvm.org/D98193 Files: clang/lib/Headers/__clang

[PATCH] D98193: [CUDA][HIP] Allow non-ODR use of host var in device

2021-04-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: clang/test/CodeGenCUDA/device-use-host-var.cu:22 + +// CHECK: store i32 1 +// CHECK: store i32 2 tra wrote: > Nit: You may want to add a `CHECK-LABEL: `. It does not make > much o

[PATCH] D98193: [CUDA][HIP] Allow non-ODR use of host var in device

2021-04-19 Thread Artem Belevich via Phabricator via cfe-commits
tra accepted this revision. tra added a comment. This revision is now accepted and ready to land. Small test nit. LGTM otherwise. Comment at: clang/test/CodeGenCUDA/device-use-host-var.cu:22 + +// CHECK: store i32 1 +// CHECK: store i32 2 Nit: You may want to a

[PATCH] D98193: [CUDA][HIP] Allow non-ODR use of host var in device

2021-04-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98193/new/ https://reviews.llvm.org/D98193 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D98193: [CUDA][HIP] Allow non-ODR use of host var in device

2021-04-07 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 335904. yaxunl added a comment. fix test failure on windows. need to specify triple since it affects name mangling. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98193/new/ https://reviews.llvm.org/D98193 Files: clang/lib/Sema/SemaExpr.cpp clan

[PATCH] D98193: [CUDA][HIP] Allow non-ODR use of host var in device

2021-04-06 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 335702. yaxunl added a comment. revised by Richard's comments. Check function-scope static var. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98193/new/ https://reviews.llvm.org/D98193 Files: clang/lib/Sema/SemaExpr.cpp clang/test/CodeGenCUDA/de

[PATCH] D98193: [CUDA][HIP] Allow non-ODR use of host var in device

2021-04-06 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:17050 +auto Target = SemaRef.IdentifyCUDATarget(FD); +if (Var && Var->isFileVarDecl() && !Var->hasAttr() && +!Var->hasAttr() && !Var->hasAttr() && rsmith wrote: > I suspect you

[PATCH] D98193: [CUDA][HIP] Allow non-ODR use of host var in device

2021-03-29 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. In principle this seems reasonable to me. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98193/new/ https://reviews.llvm.org/D98193 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

[PATCH] D98193: [CUDA][HIP] Allow non-ODR use of host var in device

2021-03-29 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:17050 +auto Target = SemaRef.IdentifyCUDATarget(FD); +if (Var && Var->isFileVarDecl() && !Var->hasAttr() && +!Var->hasAttr() && !Var->hasAttr() && I suspect you want `hasGlobalS

[PATCH] D98193: [CUDA][HIP] Allow non-ODR use of host var in device

2021-03-29 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D98193#2656326 , @tra wrote: > I think we also may want to check that we allow `sizeof(host_var)` in the GPU > code. We have tests for that at line 94 of test/SemaCUDA/device-use-host-var.cu CHANGES SINCE LAST ACTION https:

[PATCH] D98193: [CUDA][HIP] Allow non-ODR use of host var in device

2021-03-29 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. I think we also may want to check that we allow `sizeof(host_var)` in the GPU code. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98193/new/ https://reviews.llvm.org/D98193 ___ cfe-commits mailing list cfe-commits@lists.

[PATCH] D98193: [CUDA][HIP] Allow non-ODR use of host var in device

2021-03-29 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98193/new/ https://reviews.llvm.org/D98193 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D98193: [CUDA][HIP] Allow non-ODR use of host var in device

2021-03-10 Thread Artem Belevich via Phabricator via cfe-commits
tra added a reviewer: rsmith. tra added a subscriber: rsmith. tra added a comment. LGTM I've added @rsmith to double check that we're handling it correctly. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98193/new/ https://reviews.llvm.org/D98193 ___

[PATCH] D98193: [CUDA][HIP] Allow non-ODR use of host var in device

2021-03-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 329686. yaxunl added a comment. minor bug fix CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98193/new/ https://reviews.llvm.org/D98193 Files: clang/lib/Sema/SemaExpr.cpp clang/test/CodeGenCUDA/device-use-host-var.cu clang/test/SemaCUDA/device-

[PATCH] D98193: [CUDA][HIP] Allow non-ODR use of host var in device

2021-03-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 329632. yaxunl marked an inline comment as done. yaxunl added a comment. Follow C++ about ODR-use of variables. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98193/new/ https://reviews.llvm.org/D98193 Files: clang/lib/Sema/SemaExpr.cpp clang/tes

[PATCH] D98193: [CUDA][HIP] Allow non-ODR use of host var in device

2021-03-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: clang/test/SemaCUDA/device-use-host-var.cu:41 *out = global_const_var; + *out = global_const_struct_var.x; tra wrote: > I do not think it should be allowed. We end up instant

[PATCH] D98193: [CUDA][HIP] Allow non-ODR use of host var in device

2021-03-08 Thread Artem Belevich via Phabricator via cfe-commits
tra added inline comments. Comment at: clang/test/SemaCUDA/device-use-host-var.cu:41 *out = global_const_var; + *out = global_const_struct_var.x; I do not think it should be allowed. We end up instantiating the variable on device, even though the variable

[PATCH] D98193: [CUDA][HIP] Allow non-ODR use of host var in device

2021-03-08 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. yaxunl requested review of this revision. https://reviews.llvm.org/D98193 Files: clang/lib/Sema/SemaExpr.cpp clang/test/SemaCUDA/device-use-host-var.cu Index: clang/test/SemaCUDA/device-use-host-var.cu ==