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

Add infrastructure and example for native CUDA #288

Merged
merged 6 commits into from
Feb 12, 2025

Conversation

chillenzer
Copy link
Contributor

@chillenzer chillenzer commented Feb 7, 2025

Adds an example of using mallocMC in native CUDA applications and adds corresponding infrastructure. Along the way it fixes a cmake bug, namely that we forgot to link against alpaka. As there is a bug in alpaka's cmake forbidding this to succeed, we switch to a temporary branch until the main alpaka merges the fix.

After rebasing on top of the latest changes it turned out that our CI coverage is very poor and the reviewer apparently did not attempt manual testing on any of the previous PRs. So, the second commit fixes a plethora of inconsistencies that have built up lately.

Further minor feature requests/bug fixes crept in during offline discussion: All examples are now part of ctest, the tests enforce the serial accelerator they depend on and the native-cuda example is only activated if alpaka_ACC_GPU_CUDA_ENABLE is set.

@chillenzer
Copy link
Contributor Author

If alpaka-group/alpaka#2476 gets merged first, we could update this PR to point to the alpaka dev again.


namespace ReservePoolPolicies
{
// This is provided because the original ReservePoolPolicies::AlpakaBuf takes an alpaka::Acc as template
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this comment still true for the new mallocMC interface where we use a tag?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, almost... it's still true that we provide this to make it alpaka-agnostic. It's no longer true that the alpaka-specific thing to patch out is the acc but only its tag. Anyways, I've updated the comment and added a sentence of clarification.

@chillenzer chillenzer marked this pull request as draft February 10, 2025 16:08
@chillenzer
Copy link
Contributor Author

As alpaka-group/alpaka#2476 is already approved, I'm drafting this until it's merged, so that I can update to the latest dev of alpaka.

@psychocoderHPC
Copy link
Member

try to run examples and tests on our dev system fwk388 and I got a bunch of compile errors


spack load /gisjfoh
module load rocm-6.0.2
spack load [email protected]
export CXX=clang

cmake ../mallocMC -DmallocMC_BUILD_TESTING=ON -DmallocMC_BUILD_EXAMPLES=ON -Dalpaka_ACC_GPU_HIP_ENABLE=ON

mallocMCCompileErrorsHIP.txt

@psychocoderHPC
Copy link
Member

-Dalpaka_ACC_CPU_B_SEQ_T_SEQ_ENABLE=ON is required to run the tests. This should be set automatically by mallocMC

@chillenzer chillenzer marked this pull request as ready for review February 12, 2025 10:16
@psychocoderHPC psychocoderHPC merged commit 65c15d7 into alpaka-group:dev Feb 12, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants