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 hipstdpar support to BabelStream #195

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

gsitaram
Copy link

@gsitaram gsitaram commented May 2, 2024

This PR adds support for offload to AMD GPUs using the par_unseq execution policy in C++ standard parallelism algorithms. To trigger the GPU offload of all parallel algorithms, the --hipstdpar compilation flag must be provided. For GPU targets other than the current default of gfx906, the --offload-arch=<arch_string> option must also be provided at compile time.

When using ROCm 6.1.0, the compilation commands may look like the following if compiling for an AMD Instinct MI200 series GPU:

cmake -Bbuild -H. -DMODEL=std-data -DCMAKE_CXX_COMPILER=hipcc -DCLANG_OFFLOAD=gfx90a
cmake --build build

Remember to set the environment variable to enable address translation and page migration (where applicable) when running std-data-stream or std-indices-stream:

export HSA_XNACK=1

@@ -50,4 +66,13 @@ macro(setup)
register_definitions(USE_ONEDPL)
register_link_library(oneDPL)
endif ()
if (CLANG_OFFLOAD)
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not totally sold on the name of this definition as CLANG is not specific to AMD, but the CLANG_FLAGS set below are definitely specific. Can we rename this please to something appropriate?

Copy link
Author

@gsitaram gsitaram May 13, 2024

Choose a reason for hiding this comment

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

Would replacing CLANG_OFFLOAD with AMDGPU_TARGET_OFFLOAD and CLANG_FLAGS with AMDGPU_TARGET_OFFLOAD_FLAGS be acceptable?

@tomdeakin
Copy link
Contributor

It's great to see hipstdpar working, so let's work to get this merged in. Thanks for the contributions.

@tomdeakin tomdeakin changed the base branch from main to develop May 26, 2024 10:37
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