Skip to content

Commit 88b9974

Browse files
Nicholas Sarkauskasnsarka
authored andcommitted
Review
1 parent d926696 commit 88b9974

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

benchmarks/cpp/p2p_communication.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,15 @@ void benchmarkP2PCommunication() {
121121
}
122122

123123
// Benchmark
124-
cudaDeviceSynchronize();
124+
NVFUSER_CUDA_RT_SAFE_CALL(cudaDeviceSynchronize());
125125
auto start_time = std::chrono::high_resolution_clock::now();
126126

127127
for (int rep = 0; rep < kNumRepetitions; rep++) {
128128
send_tensor.copy_(at::arange(current_tensor_size, tensor_options) + rep);
129129
executor.runWithInput(inputs);
130130
}
131131

132-
cudaDeviceSynchronize();
132+
NVFUSER_CUDA_RT_SAFE_CALL(cudaDeviceSynchronize());
133133
auto end_time = std::chrono::high_resolution_clock::now();
134134

135135
auto duration = std::chrono::duration_cast<std::chrono::microseconds>(
@@ -144,10 +144,10 @@ void benchmarkP2PCommunication() {
144144
// Format message size with units
145145
std::string size_str;
146146
if (data_size_mb >= 1.0) {
147-
size_str = std::to_string(static_cast<int>(data_size_mb + 0.5)) + " MB";
147+
size_str = std::to_string(static_cast<int>(data_size_mb)) + " MB";
148148
} else {
149149
size_str =
150-
std::to_string(static_cast<int>(data_size_mb * 1024 + 0.5)) + " KB";
150+
std::to_string(static_cast<int>(data_size_mb * 1024)) + " KB";
151151
}
152152

153153
// Print table row

0 commit comments

Comments
 (0)