Skip to content

Commit 0be51f7

Browse files
committed
nccl: don't use <format>
Signed-off-by: Carl Pearson <[email protected]>
1 parent c64a9ef commit 0be51f7

File tree

2 files changed

+23
-22
lines changed

2 files changed

+23
-22
lines changed

unit_tests/nccl/test_nccl.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
// NOTE: This file is a NCCL smoke test and does nothing related to KokkosComm.
55

6-
#include <format>
76
#include <iostream>
87
#include <iomanip>
98
#include <sstream>
@@ -14,13 +13,14 @@
1413

1514
namespace {
1615

17-
#define NCCL_CHECK(cmd) \
18-
do { \
19-
if (ncclResult_t res = cmd; res != ncclSuccess) { \
20-
std::cerr << std::format("KokkosComm::unit_tests: {}:{} error(NCCL): {}\n", __FILE__, __LINE__, \
21-
ncclGetErrorString(res)); \
22-
std::exit(-1); \
23-
} \
16+
#define NCCL_CHECK(cmd) \
17+
do { \
18+
if (ncclResult_t res = cmd; res != ncclSuccess) { \
19+
std::cerr << "KokkosComm::unit_tests: " << __FILE__ << ":" << __LINE__ \
20+
<< " error(NCCL): " << ncclGetErrorString(res) << "\n"; \
21+
\
22+
std::exit(-1); \
23+
} \
2424
} while (0)
2525

2626
#define CUDA_CHECK(cmd) \

unit_tests/nccl/utils.hpp

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include <cstddef>
1010
#include <cstdint>
1111
#include <cstdlib>
12-
#include <format>
1312
#include <fstream>
1413
#include <iosfwd>
1514
#include <string>
@@ -22,21 +21,23 @@
2221

2322
namespace {
2423

25-
#define MPI_CHECK(cmd) \
26-
do { \
27-
if (int res = cmd; res != MPI_SUCCESS) { \
28-
std::cerr << std::format("KokkosComm::unit_tests: {}:{} error(MPI): {}\n", __FILE__, __LINE__, res); \
29-
std::exit(-1); \
30-
} \
24+
#define MPI_CHECK(cmd) \
25+
do { \
26+
if (int res = cmd; res != MPI_SUCCESS) { \
27+
std::cerr << "KokkosComm::unit_tests: " << __FILE__ << ":" << __LINE__ << " error(MPI): " << res << "\n"; \
28+
\
29+
std::exit(-1); \
30+
} \
3131
} while (0)
3232

33-
#define NCCL_CHECK(cmd) \
34-
do { \
35-
if (ncclResult_t res = cmd; res != ncclSuccess) { \
36-
std::cerr << std::format("KokkosComm::unit_tests: {}:{} error(NCCL): {}\n", __FILE__, __LINE__, \
37-
ncclGetErrorString(res)); \
38-
std::exit(-1); \
39-
} \
33+
#define NCCL_CHECK(cmd) \
34+
do { \
35+
if (ncclResult_t res = cmd; res != ncclSuccess) { \
36+
std::cerr << "KokkosComm::unit_tests: " << __FILE__ << ":" << __LINE__ \
37+
<< " error(NCCL): " << ncclGetErrorString(res) << "\n"; \
38+
\
39+
std::exit(-1); \
40+
} \
4041
} while (0)
4142

4243
#define CUDA_CHECK(cmd) \

0 commit comments

Comments
 (0)