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

Simplify work with walberla kernels #4988

Open
RudolfWeeber opened this issue Aug 26, 2024 · 1 comment
Open

Simplify work with walberla kernels #4988

RudolfWeeber opened this issue Aug 26, 2024 · 1 comment

Comments

@RudolfWeeber
Copy link
Contributor

RudolfWeeber commented Aug 26, 2024

When adding new kernels, a lot of manual work is currently needed

  • write the actual kernel generation in maintainer/walberla_kernels/generate_*.py
  • generate, format and copy kernels to src/walberla_bridge/src/lattice_boltzmann/generated_kernels

the following have to be done 4x per kernel, single/double precision, cpu/gpu

  • Add kernel cpp files to the CMake file there
  • include headers of the new kernels in kernel_traits.hpp
  • add the kernel classes in the KernelTraits classes for the respective architectures
  • lastly, kernels are currently imported into the actual LBWalberlaImpl class template via a using statement.

There is probably some potential for streamlingin:

  • the various kernel generation steps described in the readme in maintainer/walberla_kernels can probably mostly be put into a shell script
  • at the time of kernel generation, all information needed for the kernel_traits.hpp is in princicle known. We could generate that file from a Jinja template
  • Having one using statement per Kernel in LBWalberlaImpl could also be avoided, this would, however result in extra typenames throughout the code. Might still be worth it.
using Kernels = detail::KernelTraits<FloatType, Architecture>;

// ...
auto m_initial_pdf_setter = std::make_shared<typename Kernels::InitialPDFSetter>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@RudolfWeeber and others