alpaka-group / alpaka

Abstraction Library for Parallel Kernel Acceleration :llama:
https://alpaka.readthedocs.io
Mozilla Public License 2.0
338 stars 69 forks source link

Example idea: Monte Carlo #610

Open sbastrakov opened 5 years ago

sbastrakov commented 5 years ago

Since alpaka has support for both random number generators and atomic operations, it should be easy to make an example implementing Monte Carlo. To me two applications seem most fitting:

The purpose of such an example would be, firstly, to illustrate an implementation of a rather widely used Monte Carlo computational scheme and, secondly, to give a more realistic (compared to the existing unit tests) usage of alpaka abstractions for generators and atomic operations.

tdd11235813 commented 5 years ago

could be helpful to have such a common example like MonteCarlo (Pi calculation ?), how to use different back-ends, random numbers and atomics (for reduction). At the moment examples does not have high priority, but maybe someone can write this example for learning alpaka.

j-stephan commented 2 years ago

We have created a Monte Carlo Compute Pi example for last year's CERN workshop. We should aim to pull this into the mainline alpaka code base.

sbastrakov commented 2 years ago

Yes, or something similar to it. Iirc when doing examples for that workshop we were also thinking to simplify the coding of existing alpaka examples to separate them from CI test logic and so be easier readable. So more in spirit of the workshop examples