Skip to content

Commit

Permalink
Initialize HIP early to avoid concurrent initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
msimberg committed Feb 13, 2023
1 parent 7e1c1a4 commit 070983a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions libs/pika/init_runtime/src/init_runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@
#include <pika/util/get_entry_as.hpp>
#include <pika/version.hpp>

#if defined(PIKA_HAVE_HIP)
#include <hip/hip_runtime.h>
#include <whip.hpp>
#endif

#if defined(__bgq__)
#include <cstdlib>
#endif
Expand Down Expand Up @@ -492,6 +497,11 @@ namespace pika {
return -1;
}

#if defined(PIKA_HAVE_HIP)
LPROGRESS_ << "run_local: initialize HIP";
whip::check_error(hipInit(0));
#endif

// Initialize and start the pika runtime.
LPROGRESS_ << "run_local: create runtime";

Expand Down

0 comments on commit 070983a

Please sign in to comment.