Skip to content

Commit f51d29f

Browse files
authored
Add OutputBufferQuery API (triton-inference-server#179)
1 parent f5e1c9a commit f51d29f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/request_executor.cc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,17 @@ ResponseAlloc(
139139
return nullptr; // Success
140140
}
141141

142+
TRITONSERVER_Error*
143+
OutputBufferQuery(
144+
TRITONSERVER_ResponseAllocator* allocator, void* userp,
145+
const char* tensor_name, size_t* byte_size,
146+
TRITONSERVER_MemoryType* memory_type, int64_t* memory_type_id)
147+
{
148+
// Always attempt to return the memory in the requested memory_type and
149+
// memory_type_id.
150+
return nullptr; // Success
151+
}
152+
142153
TRITONSERVER_Error*
143154
ResponseRelease(
144155
TRITONSERVER_ResponseAllocator* allocator, void* buffer, void* buffer_userp,
@@ -155,6 +166,8 @@ RequestExecutor::RequestExecutor(
155166
TRITONSERVER_ResponseAllocator* allocator;
156167
THROW_IF_TRITON_ERROR(TRITONSERVER_ResponseAllocatorNew(
157168
&allocator, ResponseAlloc, ResponseRelease, nullptr /* start_fn */));
169+
THROW_IF_TRITON_ERROR(TRITONSERVER_ResponseAllocatorSetQueryFunction(
170+
allocator, OutputBufferQuery));
158171
response_allocator_ = allocator;
159172
}
160173

0 commit comments

Comments
 (0)