Skip to content

Commit

Permalink
Update DDS check to also include previously used allocators
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinch-nv committed Dec 29, 2023
1 parent 998517b commit fa093f0
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -937,13 +937,13 @@ Status BindContextOutput(Ort::KernelContext& ctx,
// which we defer allocation until the size is known and don't call IExecution::setTensorAddress)
//
// Otherwise, if the shape of the output tensor is known prior to the runtime, ORT will pre-allocate memory buffer for the output tensor for enqueueV3.
if (is_dds_output) {
if (dds_output_allocator_map.find(output_name) == dds_output_allocator_map.end()) {
auto knownDDS = dds_output_allocator_map.find(output_name) != dds_output_allocator_map.end();
if (is_dds_output || knownDDS) {
dds_output_set.emplace(output_name);
if (!knownDDS) {
auto allocatorPtr = std::make_unique<OutputAllocator>();
trt_context->setOutputAllocator(output_name, allocatorPtr.get());
dds_output_allocator_map[output_name] = std::move(allocatorPtr);
} else {
trt_context->setOutputAllocator(output_name, dds_output_allocator_map[output_name].get());
}
} else {
output_tensors[i] = ctx.GetOutput(output_index, output_shapes);
Expand Down

0 comments on commit fa093f0

Please sign in to comment.