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.