File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff 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.
Original file line number Diff line number Diff 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 ;
Original file line number Diff line number Diff line change @@ -63,6 +63,9 @@ MSCCLPP_API_CPP MemoryId ProxyService::addMemory(RegisteredMemory memory) {
6363}
6464
6565MSCCLPP_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}
You can’t perform that action at this time.
0 commit comments