8000 Allow building a C++20 module for Kokkos by masterleinad · Pull Request #8117 · kokkos/kokkos · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Allow building a C++20 module for Kokkos #8117

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

Draft
wants to merge 100 commits into
base: develop
Choose a base branch
from

Conversation

masterleinad
Copy link
Contributor
@masterleinad masterleinad commented May 22, 2025

Fixes #8081. kokkoscore.ccm needs some structuring but otherwise this should be good enough for a first stab at using modules that works with clang++ to gather some feedback for the approach. gcc seems to make much more problems.

There aren't actually many "real" changes apart from gathering all relevant symbols in kokkoscore.ccm.

For testing we are using

#include <Kokkos_Macros.hpp>
#ifdef KOKKOS_ENABLE_EXPERIMENTAL_CXX20_MODULE
import kokkoscore;
#else
#include <KokkosCore.hpp>
#endif

instead of just

#include <Kokkos_Core.hpp

which contributes to about half of the lines changed.

@pzehner
Copy link
Contributor
pzehner commented Jun 2, 2025

The problem with the on-the-fly module generation with the script is, as you said, you don't know what you're exposing. Listing symbols explicitly is tedious, but you know what you have.

I think it would be a good side effect of the C++ modules to help Core to be more self-contained, as it would improve the code quality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++20 Related to the transition to C++ 20
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prototype C++20 modules; import Kokkos
3 participants
0