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

cmake: add CMake language support for CUDA/HIP #2173

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

rbberger
Copy link

Alternative to #2084

@kokkos-devops-admin
Copy link

Status Flag 'Pre-Test Inspection' - - This Pull Request Requires Inspection... The code must be inspected by a member of the Team before Testing/Merging
NO INSPECTION HAS BEEN PERFORMED ON THIS PULL REQUEST! - This PR must be inspected by setting label 'AT: PRE-TEST INSPECTED'.

@lucbv
Copy link
Contributor

lucbv commented Apr 10, 2024

Is there a reason to assume that only users of Kokkos Kernels in Trilinos will need this vs users of the library that might have precompiled it and then compiled Trilinos against it?

@lucbv lucbv self-requested a review April 10, 2024 23:57
@lucbv
Copy link
Contributor

lucbv commented Apr 10, 2024

Also if you have some testing instruction for this I'm happy to follow them, I don't think CI will be able to help us assess this PR.

@rbberger
Copy link
Author

rbberger commented Apr 11, 2024

Is there a reason to assume that only users of Kokkos Kernels in Trilinos will need this vs users of the library that might have precompiled it and then compiled Trilinos against it?

This is an incremental change to tackle the case when kokkos-kernels is built in isolation (standalone) and kokkos is already built. I'm looking at this from a Spack perspective, where each package is built on its own. Trilinos is not a priority for me at the moment, but could very well be added later if needed. (the standalone and Trilinos bits seem to share CMake logic, so it might just mean some extra variables and checking to cover the case where Kokkos_COMPILE_LANGUAGE isn't set; it is only set in KokkosConfig.cmake during find_package at the moment)

@rbberger
Copy link
Author

rbberger commented Apr 11, 2024

Also if you have some testing instruction for this I'm happy to follow them, I don't think CI will be able to help us assess this PR.

Build kokkos for CUDA as usual but don't use the wrapper also add Kokkos_ENABLE_COMPILE_AS_CMAKE_LANGUAGE=ON and CMAKE_CUDA_ARCHITECTURES set to something meaningful (80 for ampere). Then build kokkos-kernels with the kokkos installation in the CMAKE_PREFIX_PATH and also set CMAKE_CUDA_ARCHITECTURES.

The same could be tested with ROCm, the variables then change to CMAKE_HIP_COMPILER and CMAKE_HIP_ARCHITECTURES.

Let me know if you need more detail than that. For Spack we're still in the process to updating the spackages upstream spack/spack#43517. Once those are in it could be also tested that way (that's how I tested it: I built kokkos +cmake_lang+cuda cuda_arch=80 and then built kokkos-kernels manually using that install)

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

Successfully merging this pull request may close these issues.

None yet

3 participants