Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix maybe-uninitialized compiler warning in Linux #51336

Merged
merged 3 commits into from
Mar 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion cmake/flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ if(NOT WIN32)
-Wno-error=terminate # Warning in PADDLE_ENFORCE
-Wno-error=int-in-bool-context # Warning in Eigen gcc 7.2
-Wimplicit-fallthrough=0 # Warning in tinyformat.h
-Wno-error=maybe-uninitialized # Warning in Paddle-Lite
${fsanitize})

if(WITH_IPU)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ void DeleteWeightDequantLinearOpPass::ApplyImpl(ir::Graph* graph) const {
if (n->IsOp()) {
auto* op = n->Op();
if (op->Type() == "dequantize_linear") {
Node *weight_var_node, *dequantized_weight_var_node, *scale_var_node,
*calcu_op_node, *while_op_node;
Node *weight_var_node, *calcu_op_node, *while_op_node;
Node *dequantized_weight_var_node = nullptr, *scale_var_node = nullptr;
// 1. Judge whether for dequant weight and find
// weight_var_node/scale_var_node
for (auto* input_node : n->inputs) {
Expand Down
3 changes: 3 additions & 0 deletions paddle/fluid/inference/tensorrt/convert/op_converter.h
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,9 @@ class OpConverter {
const std::string& layer_type,
const std::vector<std::string>& output_tensor_names,
bool test_mode = false) {
if (layer == nullptr) {
return;
}
size_t num_out = output_tensor_names.size();
std::string layer_name = layer_type + " (Output: ";
for (size_t i = 0; i < num_out; i++) {
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/inference/tensorrt/convert/unary_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class UnaryOpConverter : public OpConverter {
nvinfer1::ITensor* input_tensor =
engine_->GetITensor(op_desc.Input("X")[0]);
auto op_pair = ops.find(op_type_);
nvinfer1::ILayer* layer;
nvinfer1::ILayer* layer = nullptr;
#if !IS_TRT_VERSION_GE(8500)
nvinfer1::DataType org_type = input_tensor->getType();
bool cast = org_type == nvinfer1::DataType::kINT8 ||
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/operators/fused/fused_gemm_epilogue_op_xpu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class FusedGemmEpilogueXPUGradKernel : public framework::OpKernel<T> {
(reserve_space == NULL)
? (reinterpret_cast<const XPUType*>(NULL))
: (reinterpret_cast<const XPUType*>(reserve_space->data<T>()));
XPUType* d_act_input_ptr;
XPUType* d_act_input_ptr = NULL;
if (activation != "none") {
d_act_input_ptr = RAII_GUARD.alloc_l3_or_gm<XPUType>(dout->numel());
dout_fc_ptr = d_act_input_ptr;
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/kernels/xpu/pad3d_grad_kernel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void Pad3dGradKernel(const Context& dev_ctx,

auto* d_out = &out_grad;
auto* d_in = x_grad;
auto d_in_dims = d_in->dims();
auto d_in_dims = vectorize<int>(d_in->dims());
const T* d_out_data = d_out->data<T>();
T* d_in_data = dev_ctx.template Alloc<T>(d_in);

Expand Down