@@ -74,32 +74,32 @@ class BufferDesc
7474public:
7575 BufferDesc () = default ;
7676
77- BufferDesc (nvinfer1::Dims dims , int32_t dataWidth , TensorFormat format)
77+ BufferDesc (nvinfer1::Dims dims_ , int32_t dataWidth_ , TensorFormat format)
7878 {
79- this ->dataWidth = dataWidth ;
79+ this ->dataWidth = dataWidth_ ;
8080 if (format == TensorFormat::kLINEAR )
8181 {
82- this ->dims [0 ] = dims .d [0 ];
83- this ->dims [1 ] = dims .d [1 ];
84- this ->dims [2 ] = dims .d [2 ];
85- this ->dims [3 ] = dims .d [3 ];
82+ this ->dims [0 ] = static_cast < int32_t >(dims_ .d [0 ]) ;
83+ this ->dims [1 ] = static_cast < int32_t >(dims_ .d [1 ]) ;
84+ this ->dims [2 ] = static_cast < int32_t >(dims_ .d [2 ]) ;
85+ this ->dims [3 ] = static_cast < int32_t >(dims_ .d [3 ]) ;
8686 this ->dims [4 ] = 1 ;
8787 }
8888 else if (format == TensorFormat::kCHW32 )
8989 {
90- this ->dims [0 ] = dims .d [0 ];
91- this ->dims [1 ] = divUp (dims .d [1 ], 32 );
92- this ->dims [2 ] = dims .d [2 ];
93- this ->dims [3 ] = dims .d [3 ];
90+ this ->dims [0 ] = static_cast < int32_t >(dims_ .d [0 ]) ;
91+ this ->dims [1 ] = divUp (static_cast < int32_t >(dims_ .d [1 ]) , 32 );
92+ this ->dims [2 ] = static_cast < int32_t >(dims_ .d [2 ]) ;
93+ this ->dims [3 ] = static_cast < int32_t >(dims_ .d [3 ]) ;
9494 this ->dims [4 ] = 32 ;
9595 this ->scalarPerVector = 32 ;
9696 }
9797 else if (format == TensorFormat::kHWC )
9898 {
99- this ->dims [0 ] = dims .d [0 ];
100- this ->dims [1 ] = dims .d [2 ];
101- this ->dims [2 ] = dims .d [3 ];
102- this ->dims [3 ] = dims .d [1 ];
99+ this ->dims [0 ] = static_cast < int32_t >(dims_ .d [0 ]) ;
100+ this ->dims [1 ] = static_cast < int32_t >(dims_ .d [2 ]) ;
101+ this ->dims [2 ] = static_cast < int32_t >(dims_ .d [3 ]) ;
102+ this ->dims [3 ] = static_cast < int32_t >(dims_ .d [1 ]) ;
103103 this ->dims [4 ] = 1 ;
104104 this ->channelPivot = true ;
105105 }
@@ -144,23 +144,23 @@ class SampleBuffer
144144 dims.d [3 ] = 1 ;
145145 }
146146
147- SampleBuffer (nvinfer1::Dims dims , int32_t dataWidth , TensorFormat format , bool isInput )
148- : dims(dims )
149- , dataWidth(dataWidth )
150- , format(format )
151- , isInput(isInput )
147+ SampleBuffer (nvinfer1::Dims dims_ , int32_t dataWidth_ , TensorFormat format_ , bool isInput_ )
148+ : dims(dims_ )
149+ , dataWidth(dataWidth_ )
150+ , format(format_ )
151+ , isInput(isInput_ )
152152 {
153153
154154 // Output buffer is unsqueezed to 4D in order to reuse the BufferDesc class
155- if (isInput == false )
155+ if (isInput_ == false )
156156 {
157- dims .d [2 ] = dims .d [0 ];
158- dims .d [3 ] = dims .d [1 ];
159- dims .d [0 ] = 1 ;
160- dims .d [1 ] = 1 ;
157+ dims_ .d [2 ] = dims_ .d [0 ];
158+ dims_ .d [3 ] = dims_ .d [1 ];
159+ dims_ .d [0 ] = 1 ;
160+ dims_ .d [1 ] = 1 ;
161161 }
162162
163- desc = BufferDesc (dims, dataWidth, format );
163+ desc = BufferDesc (dims_, dataWidth_, format_ );
164164
165165 if (nullptr == buffer)
166166 {
@@ -330,7 +330,7 @@ bool SampleIOFormats::verify(TypeSpec const& spec)
330330// !
331331// ! \return true if the engine was created successfully and false otherwise
332332// !
333- bool SampleIOFormats::build (int32_t dataWidth)
333+ bool SampleIOFormats::build (int32_t /* dataWidth*/ )
334334{
335335 auto builder = std::unique_ptr<nvinfer1::IBuilder>(nvinfer1::createInferBuilder (sample::gLogger .getTRTLogger ()));
336336 if (!builder)
@@ -436,7 +436,7 @@ bool SampleIOFormats::build(int32_t dataWidth)
436436// ! \param builder Pointer to the engine builder
437437// !
438438bool SampleIOFormats::constructNetwork (std::unique_ptr<nvinfer1::IBuilder>& builder,
439- std::unique_ptr<nvinfer1::INetworkDefinition>& network, std::unique_ptr<nvinfer1::IBuilderConfig>& config,
439+ std::unique_ptr<nvinfer1::INetworkDefinition>& /* network*/ , std::unique_ptr<nvinfer1::IBuilderConfig>& config,
440440 std::unique_ptr<nvonnxparser::IParser>& parser)
441441{
442442 auto parsed = parser->parseFromFile (samplesCommon::locateFile (mParams .onnxFileName , mParams .dataDirs ).c_str (),
@@ -548,7 +548,7 @@ void printHelpInfo()
548548// ! \brief Used to run the engine build and inference/reference functions
549549// !
550550template <typename T>
551- bool process (SampleIOFormats& sample, sample::Logger::TestAtom const & sampleTest, SampleBuffer& inputBuf,
551+ bool process (SampleIOFormats& sample, sample::Logger::TestAtom const & /* sampleTest*/ , SampleBuffer& inputBuf,
552552 SampleBuffer& outputBuf, TypeSpec& spec)
553553{
554554 sample::gLogInfo << " Building and running a GPU inference engine with specified I/O formats." << std::endl;
@@ -562,8 +562,8 @@ bool process(SampleIOFormats& sample, sample::Logger::TestAtom const& sampleTest
562562 return false ;
563563 }
564564
565- inputBuf = SampleBuffer (sample.mInputDims , sizeof (T), sample.mTensorFormat , true );
566- outputBuf = SampleBuffer (sample.mOutputDims , sizeof (T), TensorFormat::kLINEAR , false );
565+ inputBuf = SampleBuffer (sample.mInputDims , static_cast < int32_t >( sizeof (T) ), sample.mTensorFormat , true );
566+ outputBuf = SampleBuffer (sample.mOutputDims , static_cast < int32_t >( sizeof (T) ), TensorFormat::kLINEAR , false );
567567
568568 if (!sample.infer (inputBuf, outputBuf))
569569 {
0 commit comments