<font size=2 face="sans-serif">I do not think it is very difficult. The
experts on the list can correct me if there</font><br><font size=2 face="sans-serif">are some complications involved.</font><br><br><font size=2 face="sans-serif">A reference implementation can always
help the standardization process.<br><br>Kelvin<br></font><br><br><tt><font size=2>David Greene <dag@cray.com> wrote on 2018/10/15
11:08:49 AM:<br><br>> From: David Greene <dag@cray.com></font></tt><br><tt><font size=2>> To: Kelvin Li <kli@ca.ibm.com></font></tt><br><tt><font size=2>> Cc: "cfe-dev@lists.llvm.org" <cfe-dev@lists.llvm.org>,
Openmp-dev <br>> <openmp-dev-bounces@lists.llvm.org>, "openmp-dev@lists.llvm.org"
<br>> <openmp-dev@lists.llvm.org></font></tt><br><tt><font size=2>> Date: 2018/10/15 11:15 AM</font></tt><br><tt><font size=2>> Subject: Re: [Openmp-dev] [OpenMP] Parameter
packs</font></tt><br><tt><font size=2>> <br>> Good to hear. Is it technically difficult to do in clang? If
not,<br>> would an experimental implementation help the committee?<br>> <br>>
-David<br>> <br>> Kelvin Li via Openmp-dev <openmp-dev@lists.llvm.org> writes:<br>> <br>> > The OpenMP specification has the following restriction:<br>> ><br>> > "Variadic parameter packs cannot be expanded into a directive
or its<br>> > clauses except as part of an expression argument to be evaluated
by<br>> > the base language, such as into a function call inside an if
clause."<br>> ><br>> > The language committee has some discussions on it in the last<br>> > face-to-face meeting. We will look into relaxing this restriction
to<br>> > provide better usage with C++ templates.<br>> ><br>> > Kelvin<br>> ><br>> > "Openmp-dev" <openmp-dev-bounces@lists.llvm.org>
wrote on 2018/10/15<br>> > 10:45:30 AM:<br>> ><br>> >> From: David Greene via Openmp-dev <openmp-dev@lists.llvm.org><br>> >> To: "cfe-dev@lists.llvm.org" <cfe-dev@lists.llvm.org>,
"openmp-<br>> >> dev@lists.llvm.org" <openmp-dev@lists.llvm.org><br>> >> Date: 2018/10/15 10:46 AM<br>> >> Subject: [Openmp-dev] [OpenMP] Parameter packs<br>> >> Sent by: "Openmp-dev" <openmp-dev-bounces@lists.llvm.org><br>> >> <br>> >> Should this compile?<br>> >> <br>> >> #include <tuple><br>> >> <br>> >> constexpr std::size_t N = 100;<br>> >> <br>> >> double A[N];<br>> >> <br>> >> template<typename ...Args><br>> >> void loop(Args ...args) {<br>> >> #pragma omp parallel firstprivate(args...)<br>> >> for (std::size_t i = 0; i < N; ++i) {<br>> >> A[i] = (i + ... + args);<br>> >> }<br>> >> }<br>> >> <br>> >> int main(void) {<br>> >> std::apply([] (const auto & ...args) { loop(args...);
},<br>> >> std::tuple<int, double, float>(10, 2.6, 3.4));<br>> >> std::apply([] (const auto & ...args) { loop(args...);
},<br>> >> std::tuple<int, long, char, double, short>(10, 100,<br>> >> 'b', 2.6, 3));<br>> >> return 0;<br>> >> }<br>> >> <br>> >> clang++ errors with:<br>> >> <br>> >> firstprivate.cpp:10:39: error: expected ',' or ')' in 'firstprivate'<br>> > clause<br>> >> #pragma omp parallel firstprivate(args...)<br>> >> ^<br>> >> firstprivate.cpp:10:39: error: expected expression<br>> >> 2 errors generated.<br>> >> <br>> >> g++ gives a similar error. I was not terribly surprised by
this.<br>> >> However, it sure would be nice if it worked.<br>> >> <br>> >> -David<br>> >> _______________________________________________<br>> >> Openmp-dev mailing list<br>> >> Openmp-dev@lists.llvm.org<br>> >> </font></tt><a href=https://urldefense.proofpoint.com/v2/url?><tt><font size=2>https://urldefense.proofpoint.com/v2/url?</font></tt></a><tt><font size=2><br>> >><br>> > <br>> u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_openmp-2Ddev&d=DwIGaQ&c=jf_<br>> > iaSHvJObTbx-<br>> >><br>> > siA1ZOg&r=yebGUrvFJWJ7GtM9woczVA&m=2EY3U33AkbJ5xLUmwJHWUGdi3b2YZ6eYCasI_<br>> > AnITmo&s=5ovzADp3MTFkziuO0pgVRB4f6eqcyYS8Rujz1vEheF0&e=<br>> >> <br>> ><br>> ><br>> > _______________________________________________<br>> > Openmp-dev mailing list<br>> > Openmp-dev@lists.llvm.org<br>> > </font></tt><a href=https://urldefense.proofpoint.com/v2/url?><tt><font size=2>https://urldefense.proofpoint.com/v2/url?</font></tt></a><tt><font size=2><br>> u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_openmp-2Ddev&d=DwIFAw&c=jf_iaSHvJObTbx-<br>> siA1ZOg&r=yebGUrvFJWJ7GtM9woczVA&m=mjlomL7F-<br>> du_g3pBBm4fwgsDuDM41jGNr3ndgflnJfQ&s=gSADVaIIvC4wmZn4vCIKIvoa1jQ9wps2fbpp91-<br>> T25c&e=<br>> <br></font></tt><BR>