Skip to content

Commit f89a6f9

Browse files
committed
Fix
1 parent 87beb94 commit f89a6f9

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

include/mscclpp/port_channel.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ class ProxyService : public BaseProxyService {
5151
MemoryId addMemory(RegisteredMemory memory);
5252

5353
/// Get the next available memory ID.
54-
/// @param count The number of consecutive IDs required.
54+
/// @param count The number of consecutive IDs required (default: 1).
5555
/// @return The first ID of an available range [first, first + count).
56-
MemoryId nextMemoryId(uint32_t count) const;
56+
MemoryId nextMemoryId(uint32_t count = 1) const;
5757

5858
/// Get a semaphore by ID.
5959
/// @param id The ID of the semaphore.

src/executor/executor.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,10 @@ struct Executor::Impl {
241241
this->defaultScratchBuffer = GpuBuffer(this->defaultScratchBufferSize).memory();
242242
}
243243
if (scratchBufferSize > this->defaultScratchBufferSize) {
244-
throw Error(
245-
"DefaultScratchBuffer size not enough. Consider increasing the default scratch buffer size or disabling "
246-
"resource reuse.",
247-
ErrorCode::ExecutorError);
244+
throw Error("Scratch buffer size (" + std::to_string(scratchBufferSize) +
245+
" bytes) exceeds default buffer size (" + std::to_string(this->defaultScratchBufferSize) +
246+
" bytes). Consider increasing the default scratch buffer size or disabling resource reuse.",
247+
ErrorCode::ExecutorError);
248248
}
249249
context.scratchBufferSize = this->defaultScratchBufferSize;
250250
context.scratchBuffer = this->defaultScratchBuffer;

src/port_channel.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ MSCCLPP_API_CPP MemoryId ProxyService::addMemory(RegisteredMemory memory) {
6363
}
6464

6565
MSCCLPP_API_CPP MemoryId ProxyService::nextMemoryId([[maybe_unused]] uint32_t count) const {
66+
if (count == 0) {
67+
throw Error("count must be greater than 0", ErrorCode::InvalidUsage);
68+
}
6669
MemoryId firstId = memories_.size();
6770
return firstId;
6871
}

0 commit comments

Comments
 (0)