From c97be492d5d097f2ab5885e74b029610845400a4 Mon Sep 17 00:00:00 2001 From: Changho Hwang Date: Mon, 27 Apr 2026 10:32:20 -0700 Subject: [PATCH] GDRCopy status message to string (#793) --- src/core/gdr.cc | 4 ++-- src/core/include/gdr.hpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/gdr.cc b/src/core/gdr.cc index 22ac15c9..f361a3aa 100644 --- a/src/core/gdr.cc +++ b/src/core/gdr.cc @@ -48,7 +48,7 @@ GdrStatus gdrStatus() { return gdrContext()->status(); } bool gdrEnabled() { return gdrStatus() == GdrStatus::Ok; } -const char* gdrStatusMessage() { +std::string gdrStatusMessage() { switch (gdrStatus()) { case GdrStatus::Ok: return "GDRCopy initialized successfully"; @@ -181,7 +181,7 @@ GdrStatus gdrStatus() { return GdrStatus::NotBuilt; } bool gdrEnabled() { return false; } -const char* gdrStatusMessage() { return "mscclpp was not built with GDRCopy support (MSCCLPP_USE_GDRCOPY not set)"; } +std::string gdrStatusMessage() { return "mscclpp was not built with GDRCopy support (MSCCLPP_USE_GDRCOPY not set)"; } // GdrMap::Impl — stub (no GDRCopy) diff --git a/src/core/include/gdr.hpp b/src/core/include/gdr.hpp index e0c7f006..c1378334 100644 --- a/src/core/include/gdr.hpp +++ b/src/core/include/gdr.hpp @@ -7,6 +7,7 @@ #include #include #include +#include namespace mscclpp { @@ -25,7 +26,7 @@ GdrStatus gdrStatus(); bool gdrEnabled(); /// Return a human-readable error message for the current GDRCopy status. -const char* gdrStatusMessage(); +std::string gdrStatusMessage(); /// RAII wrapper for a GDRCopy BAR1 mapping of a GPU address. /// When GDRCopy is not available, all operations are no-ops and valid() returns false.