Skip to content

Commit

Permalink
pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Akarale98 committed Sep 19, 2024
1 parent 05e3786 commit 9ae5a09
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
7 changes: 3 additions & 4 deletions src/tensorrt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -350,13 +350,12 @@ TRITONBACKEND_ModelInstanceFinalize(TRITONBACKEND_ModelInstance* instance)
RETURN_IF_ERROR(TRITONBACKEND_ModelInstanceState(instance, &vstate));
ModelInstanceState* instance_state =
reinterpret_cast<ModelInstanceState*>(vstate);

LOG_MESSAGE(
TRITONSERVER_LOG_INFO,
"TRITONBACKEND_ModelInstanceFinalize: delete instance state");
if (!instance_state)
{
return nullptr;
if (!instance_state) {
return nullptr;
}
ScopedRuntimeCiGContext cig_scope(instance_state->StateForModel());

Expand Down
1 change: 1 addition & 0 deletions src/tensorrt_model.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include "tensorrt_model.h"

#include <sstream>

namespace triton { namespace backend { namespace tensorrt {
Expand Down
12 changes: 7 additions & 5 deletions src/tensorrt_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#pragma once

#include "triton/backend/backend_model.h"
#include <cuda.h>

#include "triton/backend/backend_model.h"

namespace triton { namespace backend { namespace tensorrt {

class TensorRTModel : public BackendModel {
Expand Down Expand Up @@ -55,9 +56,10 @@ class TensorRTModel : public BackendModel {
bool BusyWaitEvents() { return busy_wait_events_; }


//! Following functions are related to CiG (Cuda in Graphics) context sharing for
//! gaming use case. Creating a shared contexts reduces context switching overhead
//! and leads to better performance of model execution along side Graphics workload.
//! Following functions are related to CiG (Cuda in Graphics) context sharing
//! for gaming use case. Creating a shared contexts reduces context switching
//! overhead and leads to better performance of model execution along side
//! Graphics workload.
CUcontext GetCiGContext() { return cig_ctx_; }
bool isCiGEnabled() { return cig_ctx_ != nullptr; }

Expand Down Expand Up @@ -107,7 +109,7 @@ struct ScopedRuntimeCiGContext {
}
}
~ScopedRuntimeCiGContext()
{
{
if (model_state_->isCiGEnabled()) {
THROW_IF_BACKEND_MODEL_ERROR(model_state_->PopCiGContext());
}
Expand Down

0 comments on commit 9ae5a09

Please sign in to comment.