Browse Source

chore(format): fix compile bugs after code format

GitOrigin-RevId: 11a4b06f6f
release-1.7
Megvii Engine Team 3 years ago
parent
commit
bfb30dcb81
56 changed files with 82 additions and 94 deletions
  1. +3
    -1
      dnn/src/aarch64/matrix_mul/int8x8x16/kernel_mk4_4x4x8_a72.h
  2. +0
    -1
      dnn/src/arm_common/elemwise/opr_impl.h
  3. +1
    -0
      dnn/src/arm_common/matrix_mul/int8/gemv.cpp
  4. +0
    -3
      dnn/src/common/cv/interp_helper.cpp
  5. +2
    -0
      dnn/src/common/cv/interp_helper.h
  6. +1
    -0
      dnn/src/cuda/batch_conv_bias/helper.cuh
  7. +1
    -0
      dnn/src/cuda/concat/concat.cuh
  8. +1
    -0
      dnn/src/cuda/dot/dot.cuh
  9. +1
    -0
      dnn/src/cuda/repeat/repeat.cuh
  10. +1
    -0
      dnn/src/cuda/tile/tile.cuh
  11. +1
    -0
      dnn/src/cuda/warp_affine/common.cuh
  12. +1
    -0
      dnn/src/cuda/warp_perspective/common.cuh
  13. +2
    -1
      dnn/src/rocm/handle.h
  14. +2
    -0
      dnn/src/x86/avx_helper.h
  15. +2
    -1
      dnn/src/x86/conv_bias/f32/do_conv_stride2.h
  16. +1
    -2
      dnn/src/x86/convolution/avx/convolution_conv_fh1_avx.cpp
  17. +1
    -2
      dnn/src/x86/convolution/avx/convolution_conv_fh2_avx.cpp
  18. +1
    -2
      dnn/src/x86/convolution/avx/convolution_conv_fh3_avx.cpp
  19. +1
    -2
      dnn/src/x86/convolution/avx/convolution_conv_fh4_avx.cpp
  20. +1
    -2
      dnn/src/x86/convolution/avx/convolution_conv_fh5_avx.cpp
  21. +1
    -2
      dnn/src/x86/convolution/avx/convolution_conv_fh6_avx.cpp
  22. +1
    -2
      dnn/src/x86/convolution/avx/convolution_conv_fh7_avx.cpp
  23. +1
    -2
      dnn/src/x86/convolution/avx/convolution_xcorr_fh1_avx.cpp
  24. +1
    -2
      dnn/src/x86/convolution/avx/convolution_xcorr_fh2_avx.cpp
  25. +1
    -2
      dnn/src/x86/convolution/avx/convolution_xcorr_fh3_avx.cpp
  26. +1
    -2
      dnn/src/x86/convolution/avx/convolution_xcorr_fh4_avx.cpp
  27. +1
    -2
      dnn/src/x86/convolution/avx/convolution_xcorr_fh5_avx.cpp
  28. +1
    -2
      dnn/src/x86/convolution/avx/convolution_xcorr_fh6_avx.cpp
  29. +1
    -2
      dnn/src/x86/convolution/avx/convolution_xcorr_fh7_avx.cpp
  30. +1
    -3
      dnn/src/x86/convolution/fma/convolution_conv_fh1_fma.cpp
  31. +1
    -3
      dnn/src/x86/convolution/fma/convolution_conv_fh2_fma.cpp
  32. +1
    -3
      dnn/src/x86/convolution/fma/convolution_conv_fh3_fma.cpp
  33. +1
    -3
      dnn/src/x86/convolution/fma/convolution_conv_fh4_fma.cpp
  34. +1
    -3
      dnn/src/x86/convolution/fma/convolution_conv_fh5_fma.cpp
  35. +1
    -3
      dnn/src/x86/convolution/fma/convolution_conv_fh6_fma.cpp
  36. +1
    -3
      dnn/src/x86/convolution/fma/convolution_conv_fh7_fma.cpp
  37. +1
    -3
      dnn/src/x86/convolution/fma/convolution_xcorr_fh1_fma.cpp
  38. +1
    -3
      dnn/src/x86/convolution/fma/convolution_xcorr_fh2_fma.cpp
  39. +1
    -3
      dnn/src/x86/convolution/fma/convolution_xcorr_fh3_fma.cpp
  40. +1
    -3
      dnn/src/x86/convolution/fma/convolution_xcorr_fh4_fma.cpp
  41. +1
    -3
      dnn/src/x86/convolution/fma/convolution_xcorr_fh5_fma.cpp
  42. +1
    -3
      dnn/src/x86/convolution/fma/convolution_xcorr_fh6_fma.cpp
  43. +1
    -3
      dnn/src/x86/convolution/fma/convolution_xcorr_fh7_fma.cpp
  44. +2
    -0
      dnn/src/x86/local/local_avx.cpp
  45. +2
    -0
      dnn/src/x86/local/local_fma.cpp
  46. +2
    -0
      dnn/src/x86/local/local_simd.h
  47. +2
    -0
      dnn/src/x86/local/local_sse.cpp
  48. +0
    -1
      dnn/src/x86/matrix_mul/common/common.h
  49. +2
    -0
      dnn/src/x86/simd_helper.h
  50. +2
    -1
      imperative/tablegen/emitter.h
  51. +1
    -0
      imperative/tablegen/targets/macros.cpp
  52. +4
    -5
      src/core/impl/graph/var_node_mem_mgr.cpp
  53. +6
    -1
      src/core/impl/graph/var_node_mem_mgr.h
  54. +2
    -1
      src/core/include/megbrain/utils/thread_impl_spinlock.h
  55. +8
    -7
      src/opr/include/megbrain/opr/basic_arith.h
  56. +2
    -1
      src/opr/test/atlas_models.h

+ 3
- 1
dnn/src/aarch64/matrix_mul/int8x8x16/kernel_mk4_4x4x8_a72.h View File

@@ -53,7 +53,9 @@ static inline void kern_4x4(const int8_t* packA, const int8_t* packB, int K,
const int8_t* b_ptr = packB;

LDC = LDC * sizeof(int8_t);
// clang-format off

// clang-format off

#define STORE_LINE(reg0) \
"cmp w10, #0 \n" \
"beq 101f\n" \


+ 0
- 1
dnn/src/arm_common/elemwise/opr_impl.h View File

@@ -10,7 +10,6 @@
* implied.
*/
#pragma once

#include "src/fallback/elemwise/opr_impl.h"

#include "src/arm_common/elemwise_op.h"


+ 1
- 0
dnn/src/arm_common/matrix_mul/int8/gemv.cpp View File

@@ -10,6 +10,7 @@
*/

#include "src/arm_common/simd_macro/marm_neon.h"

#include "src/arm_common/matrix_mul/int8/gemv.h"
#include "src/common/utils.h"
#include "megdnn/oprs.h"


+ 0
- 3
dnn/src/common/cv/interp_helper.cpp View File

@@ -60,11 +60,8 @@
#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
// TableHolderBase has no problem; ignore the warning for old clang versions

#include "./helper.h"
#include "./interp_helper.h"

#include "src/common/utils.h"

using namespace megdnn;
using namespace megdnn::megcv;



+ 2
- 0
dnn/src/common/cv/interp_helper.h View File

@@ -62,7 +62,9 @@
#pragma once

#include "src/common/cv/aligned_allocator.h"
#include "src/common/utils.h"

#include "./helper.h"
#include "megdnn/opr_param_defs.h"

#include <cstdint>


+ 1
- 0
dnn/src/cuda/batch_conv_bias/helper.cuh View File

@@ -10,6 +10,7 @@
*/
#pragma once
#include "src/cuda/convolution_helper/parameter.cuh"
#include "src/cuda/utils.cuh"

namespace megdnn {
namespace cuda {


+ 1
- 0
dnn/src/cuda/concat/concat.cuh View File

@@ -10,6 +10,7 @@
*/
#pragma once
#include <stdint.h>
#include "src/cuda/utils.cuh"

namespace megdnn {
namespace cuda {


+ 1
- 0
dnn/src/cuda/dot/dot.cuh View File

@@ -10,6 +10,7 @@
*/
#pragma once
#include "megdnn/dtype.h"
#include "src/cuda/utils.cuh"

namespace megdnn {
namespace cuda {


+ 1
- 0
dnn/src/cuda/repeat/repeat.cuh View File

@@ -9,6 +9,7 @@
* "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include "src/cuda/utils.cuh"

namespace megdnn {
namespace cuda {


+ 1
- 0
dnn/src/cuda/tile/tile.cuh View File

@@ -9,6 +9,7 @@
* "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include "src/cuda/utils.cuh"

namespace megdnn {
namespace cuda {


+ 1
- 0
dnn/src/cuda/warp_affine/common.cuh View File

@@ -9,6 +9,7 @@
* "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include "src/cuda/utils.cuh"

namespace megdnn {
namespace cuda {


+ 1
- 0
dnn/src/cuda/warp_perspective/common.cuh View File

@@ -9,6 +9,7 @@
* "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include "src/cuda/utils.cuh"

namespace megdnn {
namespace cuda {


+ 2
- 1
dnn/src/rocm/handle.h View File

@@ -9,6 +9,8 @@
* "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include "src/rocm/miopen_wrapper.h"

#include "megcore_rocm.h"
#include "megdnn/basic_types.h"
#include "megdnn/handle.h"
@@ -16,7 +18,6 @@

#include "src/common/handle_impl.h"
#include "src/common/utils.h"
#include "src/rocm/miopen_with_check.h"

#include <rocblas.h>
#include <atomic>


+ 2
- 0
dnn/src/x86/avx_helper.h View File

@@ -13,9 +13,11 @@
#include "megdnn/arch.h"

#include <immintrin.h>
#ifdef WIN32
#include <avxintrin.h>
#include <avx2intrin.h>
#include <fmaintrin.h>
#endif

#if !defined (__clang__)
#pragma GCC target ("avx")


+ 2
- 1
dnn/src/x86/conv_bias/f32/do_conv_stride2.h View File

@@ -9,7 +9,8 @@
* "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
// clang-format off
#include "src/x86/simd_macro/sse_helper.h"
#include "src/fallback/convolution/do_conv_stride2_decl.inl"
#include "src/x86/simd_macro/sse_helper_epilogue.h"
// clang-format on

+ 1
- 2
dnn/src/x86/convolution/avx/convolution_conv_fh1_avx.cpp View File

@@ -801,8 +801,7 @@
} \
} while (0)

#include <immintrin.h>
#include <avxintrin.h>
#include "src/x86/avx_helper.h"
#include <algorithm>

#include "../convolution_direct_special_cases.h"


+ 1
- 2
dnn/src/x86/convolution/avx/convolution_conv_fh2_avx.cpp View File

@@ -896,8 +896,7 @@
} \
} while (0)

#include <immintrin.h>
#include <avxintrin.h>
#include "src/x86/avx_helper.h"
#include <algorithm>

#include "../convolution_direct_special_cases.h"


+ 1
- 2
dnn/src/x86/convolution/avx/convolution_conv_fh3_avx.cpp View File

@@ -943,8 +943,7 @@
} \
} while (0)

#include <immintrin.h>
#include <avxintrin.h>
#include "src/x86/avx_helper.h"
#include <algorithm>

#include "../convolution_direct_special_cases.h"


+ 1
- 2
dnn/src/x86/convolution/avx/convolution_conv_fh4_avx.cpp View File

@@ -948,8 +948,7 @@
} \
} while (0)

#include <immintrin.h>
#include <avxintrin.h>
#include "src/x86/avx_helper.h"
#include <algorithm>

#include "../convolution_direct_special_cases.h"


+ 1
- 2
dnn/src/x86/convolution/avx/convolution_conv_fh5_avx.cpp View File

@@ -917,8 +917,7 @@
} \
} while (0)

#include <immintrin.h>
#include <avxintrin.h>
#include "src/x86/avx_helper.h"
#include <algorithm>

#include "../convolution_direct_special_cases.h"


+ 1
- 2
dnn/src/x86/convolution/avx/convolution_conv_fh6_avx.cpp View File

@@ -856,8 +856,7 @@
} \
} while (0)

#include <immintrin.h>
#include <avxintrin.h>
#include "src/x86/avx_helper.h"
#include <algorithm>

#include "../convolution_direct_special_cases.h"


+ 1
- 2
dnn/src/x86/convolution/avx/convolution_conv_fh7_avx.cpp View File

@@ -771,8 +771,7 @@
} \
} while (0)

#include <immintrin.h>
#include <avxintrin.h>
#include "src/x86/avx_helper.h"
#include <algorithm>

#include "../convolution_direct_special_cases.h"


+ 1
- 2
dnn/src/x86/convolution/avx/convolution_xcorr_fh1_avx.cpp View File

@@ -788,8 +788,7 @@
} \
} while (0)

#include <immintrin.h>
#include <avxintrin.h>
#include "src/x86/avx_helper.h"
#include <algorithm>

#include "../convolution_direct_special_cases.h"


+ 1
- 2
dnn/src/x86/convolution/avx/convolution_xcorr_fh2_avx.cpp View File

@@ -872,8 +872,7 @@
} \
} while (0)

#include <immintrin.h>
#include <avxintrin.h>
#include "src/x86/avx_helper.h"
#include <algorithm>

#include "../convolution_direct_special_cases.h"


+ 1
- 2
dnn/src/x86/convolution/avx/convolution_xcorr_fh3_avx.cpp View File

@@ -910,8 +910,7 @@
} \
} while (0)

#include <immintrin.h>
#include <avxintrin.h>
#include "src/x86/avx_helper.h"
#include <algorithm>

#include "../convolution_direct_special_cases.h"


+ 1
- 2
dnn/src/x86/convolution/avx/convolution_xcorr_fh4_avx.cpp View File

@@ -908,8 +908,7 @@
} \
} while (0)

#include <immintrin.h>
#include <avxintrin.h>
#include "src/x86/avx_helper.h"
#include <algorithm>

#include "../convolution_direct_special_cases.h"


+ 1
- 2
dnn/src/x86/convolution/avx/convolution_xcorr_fh5_avx.cpp View File

@@ -872,8 +872,7 @@
} \
} while (0)

#include <immintrin.h>
#include <avxintrin.h>
#include "src/x86/avx_helper.h"
#include <algorithm>

#include "../convolution_direct_special_cases.h"


+ 1
- 2
dnn/src/x86/convolution/avx/convolution_xcorr_fh6_avx.cpp View File

@@ -808,8 +808,7 @@
} \
} while (0)

#include <immintrin.h>
#include <avxintrin.h>
#include "src/x86/avx_helper.h"
#include <algorithm>

#include "../convolution_direct_special_cases.h"


+ 1
- 2
dnn/src/x86/convolution/avx/convolution_xcorr_fh7_avx.cpp View File

@@ -722,8 +722,7 @@
} \
} while (0)

#include <immintrin.h>
#include <avxintrin.h>
#include "src/x86/avx_helper.h"
#include <algorithm>

#include "../convolution_direct_special_cases.h"


+ 1
- 3
dnn/src/x86/convolution/fma/convolution_conv_fh1_fma.cpp View File

@@ -785,9 +785,7 @@
} \
} while (0)

#include <immintrin.h>
#include <avxintrin.h>
#include <fmaintrin.h>
#include "src/x86/avx_helper.h"
#include <algorithm>

#include "../convolution_direct_special_cases.h"


+ 1
- 3
dnn/src/x86/convolution/fma/convolution_conv_fh2_fma.cpp View File

@@ -827,9 +827,7 @@
} \
} while (0)

#include <immintrin.h>
#include <avxintrin.h>
#include <fmaintrin.h>
#include "src/x86/avx_helper.h"
#include <algorithm>

#include "../convolution_direct_special_cases.h"


+ 1
- 3
dnn/src/x86/convolution/fma/convolution_conv_fh3_fma.cpp View File

@@ -842,9 +842,7 @@
} \
} while (0)

#include <immintrin.h>
#include <avxintrin.h>
#include <fmaintrin.h>
#include "src/x86/avx_helper.h"
#include <algorithm>

#include "../convolution_direct_special_cases.h"


+ 1
- 3
dnn/src/x86/convolution/fma/convolution_conv_fh4_fma.cpp View File

@@ -833,9 +833,7 @@
} \
} while (0)

#include <immintrin.h>
#include <avxintrin.h>
#include <fmaintrin.h>
#include "src/x86/avx_helper.h"
#include <algorithm>

#include "../convolution_direct_special_cases.h"


+ 1
- 3
dnn/src/x86/convolution/fma/convolution_conv_fh5_fma.cpp View File

@@ -803,9 +803,7 @@
} \
} while (0)

#include <immintrin.h>
#include <avxintrin.h>
#include <fmaintrin.h>
#include "src/x86/avx_helper.h"
#include <algorithm>

#include "../convolution_direct_special_cases.h"


+ 1
- 3
dnn/src/x86/convolution/fma/convolution_conv_fh6_fma.cpp View File

@@ -755,9 +755,7 @@
} \
} while (0)

#include <immintrin.h>
#include <avxintrin.h>
#include <fmaintrin.h>
#include "src/x86/avx_helper.h"
#include <algorithm>

#include "../convolution_direct_special_cases.h"


+ 1
- 3
dnn/src/x86/convolution/fma/convolution_conv_fh7_fma.cpp View File

@@ -692,9 +692,7 @@
} \
} while (0)

#include <immintrin.h>
#include <avxintrin.h>
#include <fmaintrin.h>
#include "src/x86/avx_helper.h"
#include <algorithm>

#include "../convolution_direct_special_cases.h"


+ 1
- 3
dnn/src/x86/convolution/fma/convolution_xcorr_fh1_fma.cpp View File

@@ -771,9 +771,7 @@
} \
} while (0)

#include <immintrin.h>
#include <avxintrin.h>
#include <fmaintrin.h>
#include "src/x86/avx_helper.h"
#include <algorithm>

#include "../convolution_direct_special_cases.h"


+ 1
- 3
dnn/src/x86/convolution/fma/convolution_xcorr_fh2_fma.cpp View File

@@ -801,9 +801,7 @@
} \
} while (0)

#include <immintrin.h>
#include <avxintrin.h>
#include <fmaintrin.h>
#include "src/x86/avx_helper.h"
#include <algorithm>

#include "../convolution_direct_special_cases.h"


+ 1
- 3
dnn/src/x86/convolution/fma/convolution_xcorr_fh3_fma.cpp View File

@@ -806,9 +806,7 @@
} \
} while (0)

#include <immintrin.h>
#include <avxintrin.h>
#include <fmaintrin.h>
#include "src/x86/avx_helper.h"
#include <algorithm>

#include "../convolution_direct_special_cases.h"


+ 1
- 3
dnn/src/x86/convolution/fma/convolution_xcorr_fh4_fma.cpp View File

@@ -789,9 +789,7 @@
} \
} while (0)

#include <immintrin.h>
#include <avxintrin.h>
#include <fmaintrin.h>
#include "src/x86/avx_helper.h"
#include <algorithm>

#include "../convolution_direct_special_cases.h"


+ 1
- 3
dnn/src/x86/convolution/fma/convolution_xcorr_fh5_fma.cpp View File

@@ -753,9 +753,7 @@
} \
} while (0)

#include <immintrin.h>
#include <avxintrin.h>
#include <fmaintrin.h>
#include "src/x86/avx_helper.h"
#include <algorithm>

#include "../convolution_direct_special_cases.h"


+ 1
- 3
dnn/src/x86/convolution/fma/convolution_xcorr_fh6_fma.cpp View File

@@ -701,9 +701,7 @@
} \
} while (0)

#include <immintrin.h>
#include <avxintrin.h>
#include <fmaintrin.h>
#include "src/x86/avx_helper.h"
#include <algorithm>

#include "../convolution_direct_special_cases.h"


+ 1
- 3
dnn/src/x86/convolution/fma/convolution_xcorr_fh7_fma.cpp View File

@@ -636,9 +636,7 @@
} \
} while (0)

#include <immintrin.h>
#include <avxintrin.h>
#include <fmaintrin.h>
#include "src/x86/avx_helper.h"
#include <algorithm>

#include "../convolution_direct_special_cases.h"


+ 2
- 0
dnn/src/x86/local/local_avx.cpp View File

@@ -8,6 +8,8 @@
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
// clang-format off
#include "src/x86/simd_helper.h"
#include "src/x86/simd_macro/avx_helper.h"
#include "src/common/local/local_def.inl"
// clang-format on

+ 2
- 0
dnn/src/x86/local/local_fma.cpp View File

@@ -8,6 +8,8 @@
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
// clang-format off
#include "src/x86/simd_helper.h"
#include "src/x86/simd_macro/fma_helper.h"
#include "src/common/local/local_def.inl"
// clang-format on

+ 2
- 0
dnn/src/x86/local/local_simd.h View File

@@ -10,6 +10,7 @@
*/
#pragma once

// clang-format off
#include "src/x86/simd_macro/sse_helper.h"
#include "src/common/local/local_decl.inl"
#include "src/x86/simd_macro/sse_helper_epilogue.h"
@@ -21,3 +22,4 @@
#include "src/x86/simd_macro/fma_helper.h"
#include "src/common/local/local_decl.inl"
#include "src/x86/simd_macro/fma_helper_epilogue.h"
// clang-format on

+ 2
- 0
dnn/src/x86/local/local_sse.cpp View File

@@ -8,6 +8,8 @@
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
// clang-format off
#include "src/x86/simd_helper.h"
#include "src/x86/simd_macro/sse_helper.h"
#include "src/common/local/local_def.inl"
// clang-form on

+ 0
- 1
dnn/src/x86/matrix_mul/common/common.h View File

@@ -11,7 +11,6 @@
*/
#pragma once
#include <x86intrin.h>

#ifdef WIN32
#include <avx2intrin.h>
#include <avxintrin.h>


+ 2
- 0
dnn/src/x86/simd_helper.h View File

@@ -13,9 +13,11 @@
#include "megdnn/arch.h"

#include <immintrin.h>
#ifdef WIN32
#include <xmmintrin.h>
#include <avxintrin.h>
#include <fmaintrin.h>
#endif
#include <cmath>
#include <algorithm>



+ 2
- 1
imperative/tablegen/emitter.h View File

@@ -17,6 +17,7 @@
#include "llvm/Support/raw_ostream.h"

namespace mlir::tblgen {
using llvm::raw_ostream;

struct Environment {
std::unordered_map<unsigned int, std::pair<llvm::StringRef, llvm::StringRef>> enumAlias;
@@ -37,4 +38,4 @@ protected:
Environment* env_p = nullptr;
};

} // namespace mlir::tblgen
} // namespace mlir::tblgen

+ 1
- 0
imperative/tablegen/targets/macros.cpp View File

@@ -9,6 +9,7 @@
* "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/

#include "./macros.h"
#include "./cpp_class.h"
#include "../emitter.h"



+ 4
- 5
src/core/impl/graph/var_node_mem_mgr.cpp View File

@@ -125,7 +125,7 @@ StaticDeviceMemoryManager::make_default_impl() {
#endif // MGB_THREAD_SAFE

/* ==================== AsyncVarReleaser ==================== */
#if MGB_CUDA || MGB_ATLAS || MGB_CAMBRICON || MGB_ROCM
#if MGB_COMMON_ASYNC_COMPNODE
class VarNodeMemManager::AsyncVarReleaser {
struct WaiterParam {
CompNode cn;
@@ -248,7 +248,7 @@ bool VarNodeMemManager::ImpureMemPlanManager::check_need_realloc() {
VarNodeMemManager::VarNodeMemManager(ComputingGraphImpl* graph)
: m_owner_graph(graph),
m_seq_mem_opt(graph)
#if MGB_CUDA || MGB_ATLAS || MGB_CAMBRICON || MGB_ROCM
#if MGB_COMMON_ASYNC_COMPNODE
,m_asyn_var_releaser(new AsyncVarReleaser)
#endif
{
@@ -256,7 +256,7 @@ VarNodeMemManager::VarNodeMemManager(ComputingGraphImpl* graph)
MGB_MARK_USED_VAR(ev);
// async release is only used for sync between multiple comp nodes, and
// does not wait for device to finish
#if MGB_CUDA || MGB_ATLAS || MGB_CAMBRICON || MGB_ROCM
#if MGB_COMMON_ASYNC_COMPNODE
m_asyn_var_releaser->wait_release_finish();
#endif
m_cpu_async_release_barrier.wait_zero();
@@ -297,8 +297,7 @@ VarNodeMemManager::VarNodeMemManager(ComputingGraphImpl* graph)
graph->event().register_receiver_permanent<event::CompSeqExecError>(
on_comp_seq_error);

#if MGB_ENABLE_VAR_DEV_MEM_DEFRAGMENTER && \
(MGB_CUDA || MGB_ATLAS || MGB_CAMBRICON || MGB_ROCM)
#if MGB_ENABLE_VAR_DEV_MEM_DEFRAGMENTER && MGB_COMMON_ASYNC_COMPNODE
auto on_mem_defrag_start = [this](const event::BeforeMemDefrag&) {
m_asyn_var_releaser->wait_release_finish();
};


+ 6
- 1
src/core/impl/graph/var_node_mem_mgr.h View File

@@ -445,7 +445,12 @@ class VarNodeMemManager {

SyncableCounter m_cpu_async_release_barrier;

#if MGB_CUDA || MGB_ATLAS || MGB_CAMBRICON || MGB_ROCM
// clang-format off
#define MGB_COMMON_ASYNC_COMPNODE \
(MGB_CUDA || MGB_ATLAS || MGB_CAMBRICON || MGB_ROCM)
// clang-format on

#if MGB_COMMON_ASYNC_COMPNODE
//! release dynamic var on after compnode event finishes
class AsyncVarReleaser;
std::unique_ptr<AsyncVarReleaser> m_asyn_var_releaser;


+ 2
- 1
src/core/include/megbrain/utils/thread_impl_spinlock.h View File

@@ -14,6 +14,7 @@
#include "megbrain/common.h"
#include <thread>
#include <atomic>
#include "megbrain/utils/metahelper.h"

namespace mgb {

@@ -24,7 +25,7 @@ class Spinlock final: public NonCopyableObj {
public:

void lock() {
while (m_state.test_and_set(std::memory_order_acquire));
while (m_state.test_and_set(std::memory_order_acquire)) {};
}

void unlock() {


+ 8
- 7
src/opr/include/megbrain/opr/basic_arith.h View File

@@ -281,8 +281,8 @@ MGB_DEFINE_OPR_CLASS(AddUpdate,
* Mode specifies the actual arithmetic; and exactly one of *axis* and
* *target_shape* must be provided, to specify output shape.
*/
MGB_DEFINE_OPR_CLASS(Reduce, intl::DynamicOutputIfInputDynamic<
intl::OutshapeBySymvarSCNOpr<mixin::MegDNNOprHolder>>) // {
MGB_DEFINE_OPR_CLASS(Reduce,
intl::DynamicOutputIfInputDynamic<intl::OutshapeBySymvarSCNOpr<mixin::MegDNNOprHolder>>) // {

public:
using Param = megdnn::param::Reduce;
@@ -350,16 +350,17 @@ MGB_DEFINE_OPR_CLASS(Reduce, intl::DynamicOutputIfInputDynamic<
* the optimizer.
*/
MGB_DEFINE_OPR_CLASS(PowC, intl::MegDNNOprWrapperFwd<megdnn::PowC>) // {
public:
PowC(VarNode* inp, const Param& param, const OperatorNodeConfig& config);
static SymbolVar make(SymbolVar inp, const Param& param = {},
const OperatorNodeConfig& config = {});

private:
void add_input_layout_constraint() override;
void init_output_static_infer_desc() override;
void mem_plan_fwd_in2out_writable() override;
NodeProp* do_make_node_prop() const override;
void scn_do_execute() override;

public:
PowC(VarNode* inp, const Param& param, const OperatorNodeConfig& config);
static SymbolVar make(SymbolVar inp, const Param& param = {},
const OperatorNodeConfig& config = {});
};

} // namespace opr


+ 2
- 1
src/opr/test/atlas_models.h View File

@@ -1,4 +1,5 @@
//generated by tools/atlas/embed.py
// generated by tools/atlas/embed.py
// clang-format off
#pragma once
#include <map>
#include <string>


Loading…
Cancel
Save