[gmx-developers] GROMACS OpenCL on Gallium

Szilárd Páll pall.szilard at gmail.com
Mon Dec 14 14:37:07 CET 2015


Hi,

Last night I grabbed a trivial OpenCL sample code that does vector addition
(source [1]) and threw in an atomic add on floats: https://pastee.org/8jtbj
Would this work as a starting point?

If this is too trivial, one option for extending it is to e.g. generate a
trivial neighbor list (e.g. a random list of index pairs into a coordinate
array) that the kernel looks over and calculate a distance (or some simple
pair potential-like function).

Cheers,
--
Szilárd

[1] https://www.olcf.ornl.gov/tutorials/opencl-vector-addition/#vecAdd.c


On Thu, Dec 10, 2015 at 4:56 PM, Szilárd Páll <pall.szilard at gmail.com>
wrote:

> Vedran,
>
> Unfortunately, don't think I will have enough time at least in the coming
> 1-2 weeks. I could help composing the kernel, but that's likely going to be
> little effort and I am quite inexperienced with OpenCL, especially with the
> API "glue" code needed to just have a small test kernel running.
>
> I could pith in with putting together the kernel, but if the goal is to
> have a simple test for global memory atomic addition on floats, perhaps the
> best idea is to strip down an SDK example* like a float vector addition (or
> reduction) and replace the regular global memory writes with
> the atomicAdd_g_f() function implemented
> in src/gromacs/mdlib/nbnxn_ocl/vectype_ops.clh.
>
>
> * Both the AMD SDK and NVIDIA's ancient OpenCL SDK should have ready code,
> but having checked briefly, a slight stripping down may be needed to remove
> certain optimizations and avoid utility functions.
>
> Cheers,
> --
> Szilárd
>
> On Wed, Dec 9, 2015 at 10:30 AM, Vedran Miletić <rivanvx at gmail.com> wrote:
>
>> 2015-12-04 18:13 GMT+01:00 Szilárd Páll <pall.szilard at gmail.com>:
>> > Sounds good, is there anything on our side we can help with?
>> >
>> > Cheers,
>> >
>> > --
>> > Szilárd
>> >
>>
>> Szilard,
>>
>> actually, there is something that would be very useful, as I am
>> struggling with testing my changes at the moment. It would be great to
>> have minimal self-contained OpenCL example programs covering a
>> spectrum of features we use. As a start, I could use a minimal atomic
>> compare and swap example that would crash in the same way GROMACS does
>> now.
>>
>> LLVM requires tests for all patches [1]. So I would certainly reuse these.
>>
>> Is this doable? I can try to make them myself, but you mentioned you
>> are familiar with the code so I'm hoping you could make them quicker.
>>
>> Regards,
>> Vedran
>>
>> [1] http://llvm.org/docs/DeveloperPolicy.html
>>
>> --
>> Vedran Miletić
>> http://vedranmileti.ch/
>> --
>> Gromacs Developers mailing list
>>
>> * Please search the archive at
>> http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List before
>> posting!
>>
>> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
>>
>> * For (un)subscribe requests visit
>> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers
>> or send a mail to gmx-developers-request at gromacs.org.
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-developers/attachments/20151214/701edc2f/attachment.html>


More information about the gromacs.org_gmx-developers mailing list