Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

prevent TRT_Logger to be destroyed before TRT engine #14898

Merged
merged 3 commits into from
Aug 2, 2019

Conversation

Caenorst
Copy link
Contributor

@Caenorst Caenorst commented May 6, 2019

Description

prevent TRT_Logger to be destroyed before TRT engine

Checklist

Essentials

  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:

Changes

  • add TRT_Logger in TRTEngineParam
  • delete TRT_Logger when TRTEngineParam

Comments

  • Correct a bug that is exposed when using CUDA 10.1

@vandanavk
Copy link
Contributor

@mxnet-label-bot add [pr-awaiting-review]

@marcoabreu marcoabreu added the pr-awaiting-review PR is waiting for code review label May 7, 2019
const std::string& onnx_model,
int32_t max_batch_size,
size_t max_workspace_size,
nvinfer1::ILogger::Severity verbosity,
bool debug_builder) {
GOOGLE_PROTOBUF_VERIFY_VERSION;

TRT_Logger trt_logger(verbosity);
auto trt_builder = InferObject(nvinfer1::createInferBuilder(trt_logger));
TRT_Logger* trt_logger = new TRT_Logger(verbosity);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unique_ptr?

@abhinavs95
Copy link
Contributor

@Caenorst Could you have a look at the review comments?

@piyushghai
Copy link
Contributor

@Caenorst Gentle ping...

@Caenorst
Copy link
Contributor Author

Caenorst commented Jun 7, 2019

Sure I can use a unique_ptr, I will make the change

@vandanavk
Copy link
Contributor

@KellenSunderland for review

@karan6181
Copy link
Contributor

@KellenSunderland , @ptrendx Could you please review this PR? Thanks!

Copy link
Member

@ptrendx ptrendx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@piyushghai
Copy link
Contributor

@ptrendx Can you merge this PR if it looks good ?

@ptrendx ptrendx merged commit 24cce9e into apache:master Aug 2, 2019
KellenSunderland pushed a commit to KellenSunderland/incubator-mxnet that referenced this pull request Aug 13, 2019
* prevent TRT_Logger to be destroyed before TRT engine

* use unique_ptr for trt_logger/parser/engine/executor ownership

* reduce line length for lint
TaoLv pushed a commit that referenced this pull request Aug 16, 2019
* prevent TRT_Logger to be destroyed before TRT engine

* use unique_ptr for trt_logger/parser/engine/executor ownership

* reduce line length for lint
anirudhacharya pushed a commit to anirudhacharya/mxnet that referenced this pull request Aug 20, 2019
* prevent TRT_Logger to be destroyed before TRT engine

* use unique_ptr for trt_logger/parser/engine/executor ownership

* reduce line length for lint
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr-awaiting-review PR is waiting for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants