ExtremeFLOW / neko

/ᐠ. 。.ᐟ\ᵐᵉᵒʷˎˊ˗
https://neko.cfd/
Other
158 stars 27 forks source link

Allow for makeneko to compile .cu/.hip files #1234

Open vbaconnet opened 2 months ago

vbaconnet commented 2 months ago

It would be nice to extend makeneko to compile e.g. .cu or .hip files to allow users to use their own device code without having to add it to the source code. An example would be the application of a user source term, like:

subroutine forcing(f, t)
  class(fluid_user_source_term_t), intent(inout) :: f
  real(kind=rp), intent(in) :: t

  if (NEKO_BCKND_DEVICE .eq. 1) then
      call device_my_forcing(f, t)
  else
      call my_forcing(f, t)
  end if

end subroutine forcing

where the user would have implemented their own C interface and e.g. .cu or .hip.

Perhaps we can even impose a bcknd folder structure with bcknd/cpu and bcknd/device folders to make things more homogeneous?