From 82c60bbbb5831ffb5a0a8f65cdc528b0c637e60d Mon Sep 17 00:00:00 2001 From: fengjiayi Date: Fri, 19 May 2017 11:49:38 +0800 Subject: [PATCH] adjust '#include' style and move macro definition files into folder 'detail' --- paddle/majel/ddim.cc | 2 +- paddle/majel/ddim.h | 2 +- paddle/majel/{util.h => detail/cuda_assert.h} | 7 ------- paddle/majel/{ => detail}/hostdevice.h | 0 paddle/majel/dim.h | 4 ++-- paddle/majel/place.cc | 4 ++-- paddle/majel/test/ddim_test.cc | 2 +- paddle/majel/test/dim_test.cu | 2 +- paddle/majel/test/place_test.cc | 2 +- 9 files changed, 9 insertions(+), 16 deletions(-) rename paddle/majel/{util.h => detail/cuda_assert.h} (93%) rename paddle/majel/{ => detail}/hostdevice.h (100%) diff --git a/paddle/majel/ddim.cc b/paddle/majel/ddim.cc index e92d9afa0b..f32408ed53 100644 --- a/paddle/majel/ddim.cc +++ b/paddle/majel/ddim.cc @@ -1,4 +1,4 @@ -#include +#include "paddle/majel/ddim.h" namespace majel { diff --git a/paddle/majel/ddim.h b/paddle/majel/ddim.h index 64cebf8958..7be756f8c0 100644 --- a/paddle/majel/ddim.h +++ b/paddle/majel/ddim.h @@ -5,7 +5,7 @@ #include #include -#include "majel/dim.h" +#include "paddle/majel/dim.h" namespace majel { diff --git a/paddle/majel/util.h b/paddle/majel/detail/cuda_assert.h similarity index 93% rename from paddle/majel/util.h rename to paddle/majel/detail/cuda_assert.h index ab21e1869f..9490d0ae3e 100644 --- a/paddle/majel/util.h +++ b/paddle/majel/detail/cuda_assert.h @@ -30,10 +30,3 @@ #define MAJEL_ASSERT(e) assert(e) #define MAJEL_ASSERT_MSG(e, m) assert((e) && (m)) #endif - -namespace majel { -namespace detail { - -inline int div_up(int x, int y) { return (x + y - 1) / y; } -} -} diff --git a/paddle/majel/hostdevice.h b/paddle/majel/detail/hostdevice.h similarity index 100% rename from paddle/majel/hostdevice.h rename to paddle/majel/detail/hostdevice.h diff --git a/paddle/majel/dim.h b/paddle/majel/dim.h index ba718ce5b7..5eff4c05cc 100644 --- a/paddle/majel/dim.h +++ b/paddle/majel/dim.h @@ -5,8 +5,8 @@ #include #include -#include "majel/hostdevice.h" -#include "majel/util.h" +#include "paddle/majel/detail/hostdevice.h" +#include "paddle/majel/detail/util.h" namespace majel { diff --git a/paddle/majel/place.cc b/paddle/majel/place.cc index eecd8e5b73..ca50b37843 100644 --- a/paddle/majel/place.cc +++ b/paddle/majel/place.cc @@ -1,4 +1,4 @@ -#include +#include "paddle/majel/place.h" namespace majel { @@ -16,7 +16,7 @@ public: void operator()(const GpuPlace& p) { os_ << "GpuPlace(" << p.device << ")"; } }; -} // namespace majel +} // namespace detail static Place the_default_place; diff --git a/paddle/majel/test/ddim_test.cc b/paddle/majel/test/ddim_test.cc index 5c60451796..a5b8a7c4d2 100644 --- a/paddle/majel/test/ddim_test.cc +++ b/paddle/majel/test/ddim_test.cc @@ -4,7 +4,7 @@ #include #include "gtest/gtest.h" -#include "majel/ddim.h" +#include "paddle/majel/ddim.h" TEST(DDim, Equality) { // construct a DDim from an initialization list diff --git a/paddle/majel/test/dim_test.cu b/paddle/majel/test/dim_test.cu index ed7c34ffd1..a7d81e595b 100644 --- a/paddle/majel/test/dim_test.cu +++ b/paddle/majel/test/dim_test.cu @@ -1,7 +1,7 @@ #include #include -#include "majel/dim.h" +#include "paddle/majel/dim.h" #include "gtest/gtest.h" __global__ void test(majel::Dim<2>* o) { diff --git a/paddle/majel/test/place_test.cc b/paddle/majel/test/place_test.cc index c9a53802b2..6a099ae6b6 100644 --- a/paddle/majel/test/place_test.cc +++ b/paddle/majel/test/place_test.cc @@ -1,4 +1,4 @@ -#include "majel/place.h" +#include "paddle/majel/place.h" #include #include "gtest/gtest.h" -- GitLab