From 070983ad9c79c48648b0e5f0c58a65844ba635b8 Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Wed, 8 Feb 2023 17:24:32 +0100 Subject: [PATCH] Initialize HIP early to avoid concurrent initialization --- libs/pika/init_runtime/src/init_runtime.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libs/pika/init_runtime/src/init_runtime.cpp b/libs/pika/init_runtime/src/init_runtime.cpp index c4b3d20b2..cf9b0d924 100644 --- a/libs/pika/init_runtime/src/init_runtime.cpp +++ b/libs/pika/init_runtime/src/init_runtime.cpp @@ -43,6 +43,11 @@ #include #include +#if defined(PIKA_HAVE_HIP) +#include +#include +#endif + #if defined(__bgq__) #include #endif @@ -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";