Skip to content

Commit

Permalink
use include-what-you-use to regularize headers
Browse files Browse the repository at this point in the history
NOTE: This commit skiped the pre-commit hook to bypass cpplint, etc.
  • Loading branch information
silverling committed Apr 7, 2024
1 parent d1c469d commit 2ce6c02
Show file tree
Hide file tree
Showing 3,982 changed files with 42,964 additions and 5,424 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
11 changes: 10 additions & 1 deletion paddle/common/ddim.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,16 @@

#include "paddle/common/ddim.h"

#include <set>
#include <algorithm>
#include <cstdint>
#include <functional>
#include <iterator>
#include <numeric>
#include <ostream>

#include "paddle/common/enforce.h"
#include "paddle/common/errors.h"
#include "paddle/common/unroll_array_ops.h"

namespace common {

Expand Down
6 changes: 6 additions & 0 deletions paddle/common/ddim.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,22 @@
// limitations under the License.

#pragma once
#include <stdint.h>
#include <initializer_list>
#include <numeric>
#include <stdexcept>
#include <string>
#include <vector>
#include <cstddef>
#include <iosfwd>
#include <type_traits>
#include <typeindex>

#include "paddle/common/dim.h"
#include "paddle/common/enforce.h"
#include "paddle/common/exception.h"
#include "paddle/utils/test_macros.h"
#include "paddle/common/array.h"

namespace common {

Expand Down
7 changes: 6 additions & 1 deletion paddle/common/enforce.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@ See the License for the specific language governing permissions and
limitations under the License. */

#include "paddle/common/enforce.h"

#include <dlfcn.h>
#include <execinfo.h>
#include <stdlib.h>
#include <unistd.h>
#include <array>
#include <atomic>
#include <map>
#include <string>
#include <vector>

#include "paddle/common/flags.h"

REGISTER_LOG_SIMPLY_STR(std::string);
Expand Down
7 changes: 7 additions & 0 deletions paddle/common/enforce.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,15 @@
#ifdef __GNUC__
#include <cxxabi.h> // for __cxa_demangle
#endif // __GNUC__
#include <stdint.h>
#include <exception>
#include <iostream>
#include <cstdlib>
#include <memory>
#include <string>
#include <type_traits>
#include <typeinfo>
#include <utility>
#if !defined(_WIN32)
#include <dlfcn.h> // dladdr
#include <unistd.h> // sleep, usleep
Expand Down
1 change: 1 addition & 0 deletions paddle/common/errors.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ limitations under the License. */
#include "paddle/common/errors.h"

#include <stdexcept>
#include <memory>

namespace common {
std::string error_name(ErrorCode code) {
Expand Down
6 changes: 6 additions & 0 deletions paddle/common/flags.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@
#include "paddle/utils/test_macros.h"
#include "paddle/utils/variant.h"

namespace paddle {
namespace flags {
class FlagRegisterer;
} // namespace flags
} // namespace paddle

#if defined(_WIN32)
#define COMMON_IMPORT_FLAG __declspec(dllimport)
#else
Expand Down
12 changes: 8 additions & 4 deletions paddle/common/flags_native.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,25 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "paddle/common/flags.h"

#include <stdint.h>
#include <cassert>
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <map>
#include <mutex>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <exception>
#include <stdexcept>
#include <utility>

#include "paddle/common/flags.h"
#include "paddle/utils/test_macros.h"

namespace paddle {
namespace flags {
template <typename T> struct FlagTypeTraits;

std::stringstream& ErrorStream() {
static std::stringstream err_ss;
Expand Down
1 change: 1 addition & 0 deletions paddle/common/unroll_array_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#pragma once
#include <cstddef>
#include <type_traits>

#include "paddle/common/hostdevice.h"
#include "paddle/common/macros.h"

Expand Down
9 changes: 8 additions & 1 deletion paddle/fluid/distributed/auto_parallel/dist_attr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,20 @@ limitations under the License. */
#include <algorithm>
#include <iostream>
#include <iterator>
#include <utility>

#include "paddle/fluid/distributed/auto_parallel/dist_attr.h"
#include "paddle/fluid/framework/block_desc.h"
#include "paddle/fluid/framework/op_desc.h"
#include "paddle/fluid/framework/program_desc.h"
#include "paddle/fluid/framework/var_desc.h"
#include "paddle/phi/core/distributed/auto_parallel/proto_helper.h"
#include "net/proto2/public/repeated_field.h"
#include "paddle/common/enforce.h"
#include "paddle/common/errors.h"
#include "paddle/fluid/framework/framework.pb.h"
#include "paddle/fluid/platform/enforce.h"
#include "paddle/phi/core/distributed/auto_parallel/auto_parallel.pb.h"
#include "paddle/phi/core/distributed/auto_parallel/utils.h"

namespace paddle {
namespace distributed {
Expand Down
10 changes: 10 additions & 0 deletions paddle/fluid/distributed/auto_parallel/dist_attr.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,23 @@ limitations under the License. */
#include <map>
#include <string>
#include <vector>
#include <algorithm>
#include <atomic>

#include "paddle/fluid/platform/enforce.h"
#include "paddle/phi/core/distributed/auto_parallel/auto_parallel.pb.h"
#include "paddle/phi/core/distributed/auto_parallel/dist_attr.h"
#include "paddle/phi/core/distributed/auto_parallel/process_mesh.h"
#include "paddle/phi/core/distributed/auto_parallel/utils.h"

namespace phi {
namespace distributed {
namespace auto_parallel {
class OperatorDistAttrProto;
} // namespace auto_parallel
} // namespace distributed
} // namespace phi

namespace paddle {

// Forward Declaration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,16 @@ limitations under the License. */

#include "paddle/fluid/distributed/auto_parallel/spmd_rules/dist_tensor_spec.h"

#include <cstdint>

#include "paddle/phi/core/distributed/auto_parallel/utils.h"
#include "paddle/phi/api/include/tensor.h"

namespace phi {
namespace distributed {
class ProcessMesh;
} // namespace distributed
} // namespace phi

namespace paddle {
namespace distributed {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,22 @@ limitations under the License. */

#pragma once

#include <stdint.h>
#include <string>
#include <vector>

#include "paddle/phi/api/include/tensor.h"
#include "paddle/phi/core/distributed/auto_parallel/dist_attr.h"

namespace phi {
namespace distributed {
class ProcessMesh;
} // namespace distributed
} // namespace phi

namespace paddle {
class Tensor;

namespace distributed {
using phi::distributed::ProcessMesh;
using phi::distributed::TensorDistAttr;
Expand Down
6 changes: 6 additions & 0 deletions paddle/fluid/distributed/collective/common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@

#include "paddle/fluid/distributed/collective/common.h"

#include <algorithm>
#include <iosfwd>

#include "paddle/phi/common/place.h"
#include "paddle/phi/core/dense_tensor.h"

namespace paddle {
namespace distributed {

Expand Down
8 changes: 8 additions & 0 deletions paddle/fluid/distributed/collective/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,17 @@

#pragma once

#include <string>
#include <vector>

#include "paddle/fluid/platform/place.h"
#include "paddle/phi/common/place.h"
#include "paddle/phi/core/dense_tensor.h"

namespace phi {
class DenseTensor;
} // namespace phi

namespace paddle {
namespace distributed {

Expand Down
5 changes: 0 additions & 5 deletions paddle/fluid/distributed/collective/gloo_send_recv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <algorithm>
#include <cstring>

#include "gloo/common/logging.h"
#include "gloo/math.h"
#include "gloo/types.h"
#include "paddle/fluid/distributed/collective/gloo_send_recv.h"

Expand Down
5 changes: 5 additions & 0 deletions paddle/fluid/distributed/collective/gloo_send_recv.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@

#pragma once

#include <bits/chrono.h>
#include <stddef.h>
#include <stdint.h>
#include <memory>

#include "gloo/context.h"
#include "gloo/transport/unbound_buffer.h"

Expand Down
2 changes: 2 additions & 0 deletions paddle/fluid/distributed/collective/process_group.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

#include "paddle/fluid/distributed/collective/process_group.h"

#include <cstdlib>

namespace paddle {
namespace distributed {

Expand Down
12 changes: 12 additions & 0 deletions paddle/fluid/distributed/collective/process_group.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,30 @@

#pragma once

#include <bits/chrono.h>
#include <stdint.h>
#include <chrono>
#include <memory>
#include <string>
#include <unordered_map>
#include <vector>
#include <mutex>
#include <utility>

#include "paddle/common/errors.h"
#include "paddle/phi/core/dense_tensor.h"
#include "paddle/phi/core/device_context.h"
#include "paddle/phi/core/distributed/types.h"
#include "paddle/phi/core/distributed/utils.h"
#include "paddle/phi/core/enforce.h"
#include "paddle/common/enforce.h"
#include "paddle/common/macros.h"
#include "paddle/phi/common/place.h"

namespace phi {
class DenseTensor;
class DeviceContext;
} // namespace phi

constexpr auto kWaitTimeout = std::chrono::milliseconds(0);

Expand Down
21 changes: 17 additions & 4 deletions paddle/fluid/distributed/collective/process_group_gloo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <iostream>

#ifdef _WIN32
#include <gloo/common/win.h>
#include <winsock2.h>
Expand All @@ -24,13 +22,28 @@
#include <unistd.h>
#endif

#include <gloo/reduce.h>
#include <bits/local_lim.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <array>

#include "paddle/fluid/distributed/collective/common.h"
#include "paddle/fluid/distributed/collective/process_group_gloo.h"
#include "paddle/fluid/platform/enforce.h"
#include "paddle/phi/api/lib/data_transform.h"
#include "paddle/phi/core/distributed/comm_context_manager.h"
#include "gloo/rendezvous/context.h"
#include "gloo/transport/tcp/attr.h"
#include "gloo/transport/tcp/device.h"
#include "paddle/phi/core/dense_tensor.h"
#include "paddle/phi/core/distributed/gloo_comm_context.h"
#include "paddle/phi/core/distributed/store/tcp_utils.h"

namespace gloo {
namespace transport {
class Device;
} // namespace transport
} // namespace gloo

namespace paddle {
namespace distributed {
Expand Down
Loading

0 comments on commit 2ce6c02

Please sign in to comment.