Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions src/model_instance_state.cc
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,27 @@ ModelInstanceState::Create(
return nullptr; // success
}

void
ModelInstanceState::CreateCudaEvents(const int32_t& device_id)
{
#ifdef TRITON_ENABLE_GPU
// Need to set the CUDA context so that the context that events are
// created on match with contexts that events are recorded with.
THROW_IF_BACKEND_INSTANCE_ERROR(ConvertCUDAStatusToTritonError(
cudaSetDevice(device_id), TRITONSERVER_ERROR_INTERNAL,
"Failed to set the device"));
THROW_IF_BACKEND_INSTANCE_ERROR(ConvertCUDAStatusToTritonError(
cudaEventCreate(&compute_input_start_event_), TRITONSERVER_ERROR_INTERNAL,
"Failed to create cuda event"));
THROW_IF_BACKEND_INSTANCE_ERROR(ConvertCUDAStatusToTritonError(
cudaEventCreate(&compute_infer_start_event_), TRITONSERVER_ERROR_INTERNAL,
"Failed to create cuda event"));
THROW_IF_BACKEND_INSTANCE_ERROR(ConvertCUDAStatusToTritonError(
cudaEventCreate(&compute_output_start_event_),
TRITONSERVER_ERROR_INTERNAL, "Failed to create cuda event"));
#endif
}

void
ModelInstanceState::Execute(
std::vector<TRITONBACKEND_Response*>* responses,
Expand Down Expand Up @@ -1230,6 +1251,12 @@ ModelInstanceState::SetInputTensors(
return nullptr;
}

ModelState*
ModelInstanceState::StateForModel() const
{
return model_state_;
}

TRITONSERVER_Error*
ModelInstanceState::ValidateBooleanSequenceControl(
triton::common::TritonJson::Value& sequence_batching,
Expand Down
Loading