<div dir="ltr"><div class="gmail_extra"><div><div class="gmail_signature">On Mon, Dec 14, 2015 at 4:50 PM, Vedran Miletić <span dir="ltr">&lt;<a href="mailto:rivanvx@gmail.com" target="_blank">rivanvx@gmail.com</a>&gt;</span> wrote:<br></div></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Excellent. This segfaults on my Caicos (probably due to missing<br>
atomics), and runs correctly on my Bonaire. Tonga is completely broken<br>
at the moment [1].<br>
<br>
I will try to modify this example to make it fail instruction<br>
selection like GROMACS does.<br></blockquote><div><br></div><div>Strange that it segfaults, that would mean that it generated code which should not happen if the instruction is not supported, should it?</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
Regards,<br>
Vedran<br>
<br>
[1] <a href="https://bugs.freedesktop.org/show_bug.cgi?id=93264" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=93264</a><br>
<div class=""><div class="h5"><br>
2015-12-14 14:37 GMT+01:00 Szilárd Páll &lt;<a href="mailto:pall.szilard@gmail.com">pall.szilard@gmail.com</a>&gt;:<br>
&gt; Hi,<br>
&gt;<br>
&gt; Last night I grabbed a trivial OpenCL sample code that does vector addition<br>
&gt; (source [1]) and threw in an atomic add on floats: <a href="https://pastee.org/8jtbj" rel="noreferrer" target="_blank">https://pastee.org/8jtbj</a><br>
&gt; Would this work as a starting point?<br>
&gt;<br>
&gt; If this is too trivial, one option for extending it is to e.g. generate a<br>
&gt; trivial neighbor list (e.g. a random list of index pairs into a coordinate<br>
&gt; array) that the kernel looks over and calculate a distance (or some simple<br>
&gt; pair potential-like function).<br>
&gt;<br>
&gt; Cheers,<br>
&gt; --<br>
&gt; Szilárd<br>
&gt;<br>
&gt; [1] <a href="https://www.olcf.ornl.gov/tutorials/opencl-vector-addition/#vecAdd.c" rel="noreferrer" target="_blank">https://www.olcf.ornl.gov/tutorials/opencl-vector-addition/#vecAdd.c</a><br>
&gt;<br>
&gt;<br>
&gt; On Thu, Dec 10, 2015 at 4:56 PM, Szilárd Páll &lt;<a href="mailto:pall.szilard@gmail.com">pall.szilard@gmail.com</a>&gt;<br>
&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Vedran,<br>
&gt;&gt;<br>
&gt;&gt; Unfortunately, don&#39;t think I will have enough time at least in the coming<br>
&gt;&gt; 1-2 weeks. I could help composing the kernel, but that&#39;s likely going to be<br>
&gt;&gt; little effort and I am quite inexperienced with OpenCL, especially with the<br>
&gt;&gt; API &quot;glue&quot; code needed to just have a small test kernel running.<br>
&gt;&gt;<br>
&gt;&gt; I could pith in with putting together the kernel, but if the goal is to<br>
&gt;&gt; have a simple test for global memory atomic addition on floats, perhaps the<br>
&gt;&gt; best idea is to strip down an SDK example* like a float vector addition (or<br>
&gt;&gt; reduction) and replace the regular global memory writes with the<br>
&gt;&gt; atomicAdd_g_f() function implemented in<br>
&gt;&gt; src/gromacs/mdlib/nbnxn_ocl/vectype_ops.clh.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; * Both the AMD SDK and NVIDIA&#39;s ancient OpenCL SDK should have ready code,<br>
&gt;&gt; but having checked briefly, a slight stripping down may be needed to remove<br>
&gt;&gt; certain optimizations and avoid utility functions.<br>
&gt;&gt;<br>
&gt;&gt; Cheers,<br>
&gt;&gt; --<br>
&gt;&gt; Szilárd<br>
&gt;&gt;<br>
&gt;&gt; On Wed, Dec 9, 2015 at 10:30 AM, Vedran Miletić &lt;<a href="mailto:rivanvx@gmail.com">rivanvx@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; 2015-12-04 18:13 GMT+01:00 Szilárd Páll &lt;<a href="mailto:pall.szilard@gmail.com">pall.szilard@gmail.com</a>&gt;:<br>
&gt;&gt;&gt; &gt; Sounds good, is there anything on our side we can help with?<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; Cheers,<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; --<br>
&gt;&gt;&gt; &gt; Szilárd<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Szilard,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; actually, there is something that would be very useful, as I am<br>
&gt;&gt;&gt; struggling with testing my changes at the moment. It would be great to<br>
&gt;&gt;&gt; have minimal self-contained OpenCL example programs covering a<br>
&gt;&gt;&gt; spectrum of features we use. As a start, I could use a minimal atomic<br>
&gt;&gt;&gt; compare and swap example that would crash in the same way GROMACS does<br>
&gt;&gt;&gt; now.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; LLVM requires tests for all patches [1]. So I would certainly reuse<br>
&gt;&gt;&gt; these.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Is this doable? I can try to make them myself, but you mentioned you<br>
&gt;&gt;&gt; are familiar with the code so I&#39;m hoping you could make them quicker.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Regards,<br>
&gt;&gt;&gt; Vedran<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; [1] <a href="http://llvm.org/docs/DeveloperPolicy.html" rel="noreferrer" target="_blank">http://llvm.org/docs/DeveloperPolicy.html</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; --<br>
&gt;&gt;&gt; Vedran Miletić<br>
&gt;&gt;&gt; <a href="http://vedranmileti.ch/" rel="noreferrer" target="_blank">http://vedranmileti.ch/</a><br>
&gt;&gt;&gt; --<br>
&gt;&gt;&gt; Gromacs Developers mailing list<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; * Please search the archive at<br>
&gt;&gt;&gt; <a href="http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List" rel="noreferrer" target="_blank">http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List</a> before<br>
&gt;&gt;&gt; posting!<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; * Can&#39;t post? Read <a href="http://www.gromacs.org/Support/Mailing_Lists" rel="noreferrer" target="_blank">http://www.gromacs.org/Support/Mailing_Lists</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; * For (un)subscribe requests visit<br>
&gt;&gt;&gt; <a href="https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers" rel="noreferrer" target="_blank">https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers</a><br>
&gt;&gt;&gt; or send a mail to <a href="mailto:gmx-developers-request@gromacs.org">gmx-developers-request@gromacs.org</a>.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Gromacs Developers mailing list<br>
&gt;<br>
&gt; * Please search the archive at<br>
&gt; <a href="http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List" rel="noreferrer" target="_blank">http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List</a> before<br>
&gt; posting!<br>
&gt;<br>
&gt; * Can&#39;t post? Read <a href="http://www.gromacs.org/Support/Mailing_Lists" rel="noreferrer" target="_blank">http://www.gromacs.org/Support/Mailing_Lists</a><br>
&gt;<br>
&gt; * For (un)subscribe requests visit<br>
&gt; <a href="https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers" rel="noreferrer" target="_blank">https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers</a> or<br>
&gt; send a mail to <a href="mailto:gmx-developers-request@gromacs.org">gmx-developers-request@gromacs.org</a>.<br>
<br>
<br>
<br>
--<br>
Vedran Miletić<br>
<a href="http://vedranmileti.ch/" rel="noreferrer" target="_blank">http://vedranmileti.ch/</a><br>
--<br>
Gromacs Developers mailing list<br>
<br>
* Please search the archive at <a href="http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List" rel="noreferrer" target="_blank">http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List</a> before posting!<br>
<br>
* Can&#39;t post? Read <a href="http://www.gromacs.org/Support/Mailing_Lists" rel="noreferrer" target="_blank">http://www.gromacs.org/Support/Mailing_Lists</a><br>
<br>
* For (un)subscribe requests visit<br>
<a href="https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers" rel="noreferrer" target="_blank">https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers</a> or send a mail to <a href="mailto:gmx-developers-request@gromacs.org">gmx-developers-request@gromacs.org</a>.</div></div></blockquote></div><br></div></div>