Skip to content

Commit

Permalink
【Hackathon 6th Fundable Projects 2 No.28】Fix modernize-avoid-c-arrays…
Browse files Browse the repository at this point in the history
…_3-final (PaddlePaddle#64520)

* no c array

* format
  • Loading branch information
walkalone20 authored and co63oc committed May 23, 2024
1 parent c496bc2 commit 1e8d6a2
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 16 deletions.
4 changes: 2 additions & 2 deletions paddle/fluid/distributed/ps/table/ssd_sparse_table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2615,8 +2615,8 @@ int32_t SSDSparseTable::LoadWithString(
char* end = nullptr;
int local_shard_id = i % _avg_local_shard_num;
auto& shard = _local_shards[local_shard_id];
float data_buffer[FLAGS_pserver_load_batch_size *
feature_value_size]; // NOLINT
float data_buffer[FLAGS_pserver_load_batch_size * // NOLINT
feature_value_size];
float* data_buffer_ptr = data_buffer;
uint64_t mem_count = 0;
uint64_t ssd_count = 0;
Expand Down
4 changes: 2 additions & 2 deletions paddle/fluid/distributed/test/graph_node_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ void testFeatureNodeSerializeFloat64() {
// void testCache();
void testGraphToBuffer();

const char* edges[] = {"37\t45\t0.34",
const char* edges[] = {"37\t45\t0.34", // NOLINT
"37\t145\t0.31",
"37\t112\t0.21",
"96\t48\t1.4",
Expand All @@ -239,7 +239,7 @@ const char* edges[] = {"37\t45\t0.34",
"97\t111\t0.21"}; // NOLINT
char edge_file_name[] = "edges.txt"; // NOLINT

const char* nodes[] = {"user\t37\ta 0.34\tb 13 14\tc hello\td abc",
const char* nodes[] = {"user\t37\ta 0.34\tb 13 14\tc hello\td abc", // NOLINT
"user\t96\ta 0.31\tb 15 10\tc 96hello\td abcd",
"user\t59\ta 0.11\tb 11 14",
"user\t97\ta 0.11\tb 12 11",
Expand Down
4 changes: 2 additions & 2 deletions paddle/fluid/ir_adaptor/translator/op_translator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ constexpr char kTargetDialectPrefix[] = "pd_op."; // NOLINT
#ifdef PADDLE_WITH_DNNL
constexpr char kOneDNNTargetDialectPrefix[] = "onednn_op."; // NOLINT
#endif
constexpr char kCustomOpDialectPrefix[] = "custom_op.";
constexpr char kEmptyVarName[] = "@EMPTY@"; // NOLINT
constexpr char kCustomOpDialectPrefix[] = "custom_op."; // NOLINT
constexpr char kEmptyVarName[] = "@EMPTY@"; // NOLINT

static const std::unordered_set<std::string> SpecialNonInplaceOps = {};

Expand Down
11 changes: 6 additions & 5 deletions paddle/fluid/operators/pscore/listen_and_serv_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ limitations under the License. */

#include "paddle/fluid/framework/op_registry.h"

constexpr char kLRDecayBlockId[] = "lr_decay_block_id";
constexpr char kCheckpointBlockId[] = "checkpint_block_id";
constexpr char kPrefetchVarNameToBlockId[] = "prefetch_var_name_to_block_id";
constexpr char kOptimizeBlocks[] = "optimize_blocks";
constexpr char kSparseGradToParam[] = "sparse_grad_to_param";
constexpr char kLRDecayBlockId[] = "lr_decay_block_id"; // NOLINT
constexpr char kCheckpointBlockId[] = "checkpint_block_id"; // NOLINT
constexpr char kPrefetchVarNameToBlockId[] =
"prefetch_var_name_to_block_id"; // NOLINT
constexpr char kOptimizeBlocks[] = "optimize_blocks"; // NOLINT
constexpr char kSparseGradToParam[] = "sparse_grad_to_param"; // NOLINT

namespace paddle {
namespace framework {
Expand Down
4 changes: 2 additions & 2 deletions paddle/fluid/pir/dialect/distributed/ir/dist_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
namespace paddle {
namespace dialect {

const char* ShardTensorOp::attributes_name[1] = {"op_dist_attr"};
const char* ReshardOp::attributes_name[1] = {"op_dist_attr"};
const char* ShardTensorOp::attributes_name[1] = {"op_dist_attr"}; // NOLINT
const char* ReshardOp::attributes_name[1] = {"op_dist_attr"}; // NOLINT

void ShardTensorOp::VerifySig() {
VLOG(4)
Expand Down
6 changes: 3 additions & 3 deletions paddle/fluid/pir/dialect/operator/ir/control_flow_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ paddle::dialect::IfOp, paddle::dialect::WhileOp, paddle::dialect::HasElementsOp,

using pir::TuplePopOp;
using pir::TuplePushOp;
constexpr char kStopGradientAttrName[] = "stop_gradient";
constexpr char kStopGradientAttrName[] = "stop_gradient"; // NOLINT
namespace paddle {
namespace dialect {

Expand Down Expand Up @@ -826,8 +826,8 @@ void HasElementsOp::VerifySig() {
"The type of cf.has_elements' output is not correct."));
}

const char *AssertOp::attributes_name[1] = {"summarize"};
const char AssertOp::ERROR_INFO_ATTR_NAME[] = "error_info";
const char *AssertOp::attributes_name[1] = {"summarize"}; // NOLINT
const char AssertOp::ERROR_INFO_ATTR_NAME[] = "error_info"; // NOLINT

void AssertOp::Build(pir::Builder &builder, // NOLINT
pir::OperationArgument &argument, // NOLINT
Expand Down

0 comments on commit 1e8d6a2

Please sign in to comment.