[PATCH] D78655: [HIP] Add -fhip-lambda-host-device

2020-05-07 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. In D78655#2020651 , @tra wrote: > Ack. Let's give it a try. I'll test this on our code and see what falls out. > Stay tuned. The patch seems to cause no issues. I've ran it with local changes that enable it unconditionally for

[PATCH] D78655: [HIP] Add -fhip-lambda-host-device

2020-05-05 Thread Paul Fultz II via Phabricator via cfe-commits
pfultz2 added a comment. > A slight variation on that, that might be better: lambdas with no > lambda-capture are implicitly HD; lambdas with any lambda-capture (which must > therefore have an enclosing function) inherit the enclosing function's HDness. Lambdas should already inherit the

[PATCH] D78655: [HIP] Add -fhip-lambda-host-device

2020-05-05 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. > I agree with Richard that just making lambdas HD by default in all modes > seems like the right rule. Ack. Let's give it a try. I'll test this on our code and see what falls out. Stay tuned. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78655/new/

[PATCH] D78655: [HIP] Add -fhip-lambda-host-device

2020-05-04 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. I agree with Richard that just making lambdas HD by default in all modes seems like the right rule. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78655/new/ https://reviews.llvm.org/D78655 ___ cfe-commits mailing

[PATCH] D78655: [HIP] Add -fhip-lambda-host-device

2020-05-04 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. There are two behaviors that seem to make sense: - Treat lambdas as implicitly HD (like constexpr functions) in all CUDA / HIP language modes. I don't think it makes sense for lambdas to become implicitly HD in C++17 simply because they become implicitly `constexpr`,

[PATCH] D78655: [HIP] Add -fhip-lambda-host-device

2020-05-04 Thread Artem Belevich via Phabricator via cfe-commits
tra accepted this revision. tra added a comment. LGTM. Thank you for adding the checks for capturing lambdas and for putting this behind the flag. I've asked @rsmith to chime in in case there's anything else about the lambdas we need to deal with. Please wait a day or two before landing the

[PATCH] D78655: [HIP] Add -fhip-lambda-host-device

2020-05-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 261869. yaxunl added a comment. add one more test CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78655/new/ https://reviews.llvm.org/D78655 Files: clang/include/clang/Basic/LangOptions.def clang/include/clang/Driver/Options.td

[PATCH] D78655: [HIP] Add -fhip-lambda-host-device

2020-05-04 Thread Paul Fultz II via Phabricator via cfe-commits
pfultz2 added a comment. Is it possible to add a test like this? kernel<<<1,1>>>([=](){ auto f = [&]{ hd(); }; f(); }); That should not have a compiler error. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78655/new/ https://reviews.llvm.org/D78655

[PATCH] D78655: [HIP] Add -fhip-lambda-host-device

2020-05-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 261811. yaxunl retitled this revision from "[HIP] Let lambda be host device by default" to "[HIP] Add -fhip-lambda-host-device". yaxunl edited the summary of this revision. yaxunl added a comment. Revised. CHANGES SINCE LAST ACTION