Skip to content

Commit

Permalink
Merge #6280 #6284
Browse files Browse the repository at this point in the history
6280: Add TBB to HPX documentation in Migration Guide r=hkaiser a=dimitraka



6284: Add CUDA/HIP MultiGPU Event Polling r=hkaiser a=G-071

While the [cuda,hip]_executors within HPX support MultiGPU scenarios themselves (by using a device index and ```cudaSetDevice```), the event polling actually does not, forcing users to use the less performant callback version instead! To fix this, we need to make the CUDA/HIP event pool aware on which device the events it reuses are created, and add an index to always push/pop events on the correct device. 

This PR implements this, by adding multiple event stacks (one per device) to the event pool singleton. Furthermore, the PR adds an additional device_id parameter to the appropriate get_future calls that use events. To keep things compatible with code that used previous HPX versions, 0 is used as a default where this parameter was added. For each device, there's always 128 events added in the beginning by default - in case one wants to avoid this overhead when only a single GPU is used, simply set the environment variable CUDA_VISIBLE_DEVICES=0.

Co-authored-by: dimitraka <kadimitra@ece.auth.gr>
Co-authored-by: Gregor Daiss <Gregor.Daiss+git@gmail.com>
Co-authored-by: Gregor Daiß <G-071@users.noreply.github.com>
  • Loading branch information
4 people committed Jul 8, 2023
3 parents 2e61670 + 36f1c62 + 9f0d330 commit 8384b3b
Show file tree
Hide file tree
Showing 12 changed files with 700 additions and 104 deletions.
1 change: 1 addition & 0 deletions docs/sphinx/api/public_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ Functions
:cpp:func:`hpx::ranges::stable_sort` :cppreference-generic:`algorithm/ranges,stable_sort`
:cpp:func:`hpx::ranges::starts_with` :cppreference-generic:`algorithm/ranges,starts_with`
:cpp:func:`hpx::ranges::swap_ranges` :cppreference-generic:`algorithm/ranges,swap_ranges`
:cpp:func:`hpx::ranges::transform` :cppreference-generic:`algorithm/ranges,transform`
:cpp:func:`hpx::ranges::unique` :cppreference-generic:`algorithm/ranges,unique`
:cpp:func:`hpx::ranges::unique_copy` :cppreference-generic:`algorithm/ranges,unique_copy`
:cpp:func:`hpx::ranges::experimental::for_loop` |cpp19_n4808|_
Expand Down
Loading

0 comments on commit 8384b3b

Please sign in to comment.