Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for Example: Fortran+CUDA #1403

Closed
AndiH opened this issue Jan 24, 2020 · 8 comments · Fixed by #1454
Closed

Request for Example: Fortran+CUDA #1403

AndiH opened this issue Jan 24, 2020 · 8 comments · Fixed by #1454
Assignees
Milestone

Comments

@AndiH
Copy link

AndiH commented Jan 24, 2020

We are preparing a hands-on example for our ESM User Forum in a few days and want to show usage of GridTools for that occasion.

We would like to use the Fortran binding capabilities to launch a GridTools 2D Jacobi stencil on the GPU.

As a GridTools newbie, I lack an example, showing Fortran usage of GPU GridTools stencils. I found the driver.f90 of the c_bindings example, but that uses the MC backend. Is there one which I overlooked? Or can you quickly put something together which I can use as a blueprint?

We intend to use either GCC as our host compiler or PGI (we are showing an OpenACC stencil as well).

@mbianco
Copy link
Contributor

mbianco commented Jan 24, 2020

Dear @AndiH As far as I remember this should be just matter of allocating the data on the GPU and then passing GPUs pointers to the computations (and compile with the GPU backend). We'll get back to you with more specific information.

@AndiH
Copy link
Author

AndiH commented Jan 24, 2020

Thanks for the swift reply!

Exactly, that's what I haven't cleared up yet in my head: How to allocate GPU buffers. Most probably I should do that within the wrapped GridTools C++ file, since that is already compiled with nvcc. Then we wouldn't need to add further Fortran bindings to cudaMalloc[Managed].

@AndiH
Copy link
Author

AndiH commented Jan 28, 2020

Any news on this, @mbianco? Otherwise we'd need to work on an alternative plan for our hands-ons.

@mbianco
Copy link
Contributor

mbianco commented Jan 28, 2020

Hi @AndiH , we are looking in this, but we cannot guarantee the time right now, since our bandwidth is limited. We want to make the example nice and be included in the repo and the documentation

@AndiH
Copy link
Author

AndiH commented Jan 29, 2020

I understand. That cuts it quite close for us. We might try to whip something up ourselves. Might I email you for some feedback once we have a sketch?

@mbianco
Copy link
Contributor

mbianco commented Jan 29, 2020

Sure!

@havogt
Copy link
Contributor

havogt commented Jan 29, 2020

You can also join the GridTools slack channel for discussion. https://gridtools-slack.herokuapp.com/

@havogt
Copy link
Contributor

havogt commented Feb 24, 2020

Need to port #1406 to master before v2.0 or out-source to cpp_bindgen.

@havogt havogt added this to the v2.0 milestone Feb 24, 2020
havogt added a commit to havogt/gridtools that referenced this issue Apr 2, 2020
@havogt havogt self-assigned this Apr 2, 2020
havogt added a commit that referenced this issue Apr 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants