8000 [BYOC] Fix build with TensorRT 8 (#9047) · apache/tvm@92ca782 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 92ca782

Browse files
authored
[BYOC] Fix build with TensorRT 8 (#9047)
* fix compile error missing noexcept in overwridden methods * remove depricated builder method call
1 parent 18a36a7 commit 92ca782

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

src/runtime/contrib/tensorrt/tensorrt_builder.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@ TensorRTBuilder::TensorRTBuilder(TensorRTLogger* logger,
6161
this->calibrator_ = calibrator;
6262
if (calibrator != nullptr) {
6363
use_int8_ = true;
64-
builder_->setFp16Mode(true);
65-
builder_->setInt8Mode(true);
66-
builder_->setInt8Calibrator(calibrator);
6764
}
6865
network_ = builder_->createNetworkV2(flags);
6966
#else

src/runtime/contrib/tensorrt/tensorrt_calibrator.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ class TensorRTCalibrator : public nvinfer1::IInt8EntropyCalibrator2 {
6262
data_sizes_.push_back(binding_sizes);
6363
}
6464

65-
int getBatchSize() const override 8000 { return batch_size_; }
65+
int getBatchSize() const noexcept override { return batch_size_; }
6666

6767
/*!
6868
* \brief TensorRT will call this method to get next batch of data to
6969
* calibrate with.
7070
*/
71-
bool getBatch(void* bindings[], const char* names[], int nbBindings) override {
71+
bool getBatch(void* bindings[], const char* names[], int nbBindings) noexcept override {
7272
AllocateBuffersIfNotAllocated();
7373
CHECK_EQ(input_names_.size(), nbBindings);
7474
for (size_t i = 0; i < input_names_.size(); ++i) {
@@ -83,13 +83,13 @@ class TensorRTCalibrator : public nvinfer1::IInt8EntropyCalibrator2 {
8383
return (num_batches_calibrated_ < data_.size());
8484
}
8585

86-
const void* readCalibrationCache(size_t& length) override {
86+
const void* readCalibrationCache(size_t& length) noexcept override {
8787
if (calibration_cache_.empty()) return nullptr;
8888
length = calibration_cache_.size();
8989
return calibration_cache_.data();
9090
}
9191

92-
void writeCalibrationCache(const void* cache, size_t length) override {
92+
void writeCalibrationCache(const void* cache, size_t length) noexcept override {
9393
calibration_cache_.assign(static_cast<const char*>(cache), length);
9494
}
9595

0 commit comments

Comments
 (0)
0