Skip to content

Commit 83b1a8f

Browse files
authored
Pending more CPPLint errors in fluid/operators/math (#10243)
* Fix CPPLint issue in test_engine * Fix CPPLint errors in operators/math * Fix compilation
1 parent 98cf74c commit 83b1a8f

14 files changed

+22
-8
lines changed

paddle/fluid/inference/engine.h

-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ class EngineBase {
4646
virtual void Execute(int batch_size) = 0;
4747

4848
virtual ~EngineBase() {}
49-
5049
}; // class EngineBase
5150

5251
} // namespace inference

paddle/fluid/inference/tensorrt/engine.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ limitations under the License. */
1616

1717
#include <NvInfer.h>
1818
#include <memory>
19+
#include <string>
1920
#include <unordered_map>
21+
#include <vector>
2022
#include "paddle/fluid/inference/engine.h"
2123
#include "paddle/fluid/inference/tensorrt/helper.h"
2224

@@ -56,9 +58,9 @@ class TensorRTEngine : public EngineBase {
5658
virtual ~TensorRTEngine();
5759

5860
// TODO(Superjomn) implement it later when graph segmentation is supported.
59-
virtual void Build(const DescType& paddle_model) override;
61+
void Build(const DescType& paddle_model) override;
6062

61-
virtual void Execute(int batch_size) override;
63+
void Execute(int batch_size) override;
6264

6365
// Initialize the inference network, so that TensorRT layers can add to this
6466
// network.

paddle/fluid/inference/tensorrt/test_engine.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,12 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
See the License for the specific language governing permissions and
1313
limitations under the License. */
1414

15-
#include "paddle/fluid/inference/tensorrt/engine.h"
16-
1715
#include <cuda.h>
1816
#include <cuda_runtime_api.h>
1917
#include <glog/logging.h>
2018
#include <gtest/gtest.h>
2119

20+
#include "paddle/fluid/inference/tensorrt/engine.h"
2221
#include "paddle/fluid/platform/enforce.h"
2322

2423
namespace paddle {
@@ -65,7 +64,8 @@ TEST_F(TensorRTEngineTest, add_layer) {
6564

6665
// fill in real data
6766
float x_v = 1234;
68-
engine_->SetInputFromCPU("x", (void*)&x_v, 1 * sizeof(float));
67+
engine_->SetInputFromCPU("x", reinterpret_cast<void*>(&x_v),
68+
1 * sizeof(float));
6969
LOG(INFO) << "to execute";
7070
engine_->Execute(1);
7171

paddle/fluid/operators/concurrency/channel_util.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
See the License for the specific language governing permissions and
1313
limitations under the License. */
1414

15-
#include "channel_util.h"
15+
#include "paddle/fluid/operators/concurrency/channel_util.h"
1616
#include "paddle/fluid/framework/var_type.h"
1717

1818
namespace poc = paddle::operators::concurrency;

paddle/fluid/operators/math/context_project.h

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ limitations under the License. */
1414

1515
#pragma once
1616

17+
#include <algorithm>
18+
#include <vector>
1719
#include "paddle/fluid/framework/lod_tensor.h"
1820
#include "paddle/fluid/operators/math/im2col.h"
1921
#include "paddle/fluid/operators/math/math_function.h"

paddle/fluid/operators/math/im2col.cc

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ See the License for the specific language governing permissions and
1313
limitations under the License. */
1414

1515
#include "paddle/fluid/operators/math/im2col.h"
16+
#include <vector>
1617

1718
namespace paddle {
1819
namespace operators {

paddle/fluid/operators/math/im2col.cu

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
See the License for the specific language governing permissions and
1313
limitations under the License. */
1414

15+
#include <algorithm>
16+
#include <vector>
1517
#include "paddle/fluid/operators/math/im2col.h"
1618
#include "paddle/fluid/platform/cuda_helper.h"
1719

paddle/fluid/operators/math/im2col.h

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ limitations under the License. */
1414

1515
#pragma once
1616

17+
#include <vector>
1718
#include "paddle/fluid/framework/tensor.h"
1819
#include "paddle/fluid/framework/tensor_util.h"
1920
#include "paddle/fluid/platform/device_context.h"

paddle/fluid/operators/math/math_function_impl.h

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ See the License for the specific language governing permissions and
1313
limitations under the License. */
1414

1515
#pragma once
16+
#include <vector>
1617
#include "paddle/fluid/framework/data_type.h"
1718
#include "paddle/fluid/operators/math/math_function.h"
1819

paddle/fluid/operators/math/sequence_padding_test.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ limitations under the License. */
1414

1515
#include "paddle/fluid/operators/math/sequence_padding.h"
1616
#include <gtest/gtest.h>
17+
#include <vector>
1718

1819
template <typename DeviceContext, typename Place, typename T>
1920
void TestSequencePadding(const paddle::framework::LoD& lod,
@@ -75,7 +76,7 @@ void TestSequencePadding(const paddle::framework::LoD& lod,
7576

7677
delete place;
7778
delete context;
78-
};
79+
}
7980

8081
TEST(Seq2BatchPadding, CPU) {
8182
paddle::framework::LoD lod1;

paddle/fluid/operators/math/sequence_pooling.cu

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
See the License for the specific language governing permissions and
1313
limitations under the License. */
1414

15+
#include <string>
1516
#include "paddle/fluid/operators/math/math_function.h"
1617
#include "paddle/fluid/operators/math/sequence_pooling.h"
1718
#include "paddle/fluid/platform/cuda_helper.h"

paddle/fluid/operators/math/sequence_pooling.h

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ See the License for the specific language governing permissions and
1313
limitations under the License. */
1414

1515
#pragma once
16+
#include <string>
1617
#include "paddle/fluid/framework/lod_tensor.h"
1718
#include "paddle/fluid/framework/tensor.h"
1819
#include "paddle/fluid/platform/device_context.h"

paddle/fluid/operators/math/vol2col.h

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ limitations under the License. */
1414

1515
#pragma once
1616

17+
#include <vector>
1718
#include "paddle/fluid/framework/tensor.h"
1819
#include "paddle/fluid/framework/tensor_util.h"
1920
#include "paddle/fluid/platform/device_context.h"

paddle/fluid/operators/reader/reader_op_registry.h

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
#pragma once
1616

17+
#include <string>
18+
#include <vector>
1719
#include "paddle/fluid/framework/op_registry.h"
1820
#include "paddle/fluid/framework/reader.h"
1921

0 commit comments

Comments
 (0)