GDRCopy status message to string (#793)

This commit is contained in:
Changho Hwang
2026-04-27 10:32:20 -07:00
committed by GitHub
parent e874bf1666
commit c97be492d5
2 changed files with 4 additions and 3 deletions

View File

@@ -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)

View File

@@ -7,6 +7,7 @@
#include <cstddef>
#include <cstdint>
#include <memory>
#include <string>
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.