From 51ca5d0d77f2b45d320aebedd7dc66d37f347444 Mon Sep 17 00:00:00 2001 From: yejianwu Date: Thu, 13 Sep 2018 13:13:14 +0800 Subject: [PATCH] support ubuntu18 with gcc7.3 --- mace/core/runtime/cpu/cpu_runtime.cc | 2 +- mace/kernels/activation.h | 1 + mace/kernels/conv_pool_2d_util.cc | 1 + mace/kernels/eltwise.h | 1 + mace/kernels/gather.h | 1 + mace/kernels/local_response_norm.h | 1 + mace/kernels/quantize.h | 1 + mace/kernels/resize_bicubic.h | 1 + mace/kernels/sgemm.cc | 13 ++++++++----- mace/kernels/sgemm.h | 2 +- mace/kernels/strided_slice.h | 1 + 11 files changed, 18 insertions(+), 7 deletions(-) diff --git a/mace/core/runtime/cpu/cpu_runtime.cc b/mace/core/runtime/cpu/cpu_runtime.cc index 671d4cdf..5e76e499 100644 --- a/mace/core/runtime/cpu/cpu_runtime.cc +++ b/mace/core/runtime/cpu/cpu_runtime.cc @@ -39,7 +39,7 @@ int MaceOpenMPThreadCount = 1; namespace { int GetCPUCount() { - char path[32]; + char path[64]; int cpu_count = 0; int result = 0; diff --git a/mace/kernels/activation.h b/mace/kernels/activation.h index 3159684d..47350d91 100644 --- a/mace/kernels/activation.h +++ b/mace/kernels/activation.h @@ -16,6 +16,7 @@ #define MACE_KERNELS_ACTIVATION_H_ #include +#include #include #include #include diff --git a/mace/kernels/conv_pool_2d_util.cc b/mace/kernels/conv_pool_2d_util.cc index 72a03072..801f2061 100644 --- a/mace/kernels/conv_pool_2d_util.cc +++ b/mace/kernels/conv_pool_2d_util.cc @@ -15,6 +15,7 @@ #include "mace/kernels/conv_pool_2d_util.h" #include +#include #include namespace mace { diff --git a/mace/kernels/eltwise.h b/mace/kernels/eltwise.h index 9e9a2be8..e07b4505 100644 --- a/mace/kernels/eltwise.h +++ b/mace/kernels/eltwise.h @@ -16,6 +16,7 @@ #define MACE_KERNELS_ELTWISE_H_ #include +#include #include #include #include diff --git a/mace/kernels/gather.h b/mace/kernels/gather.h index ddfa14d1..d8978a63 100644 --- a/mace/kernels/gather.h +++ b/mace/kernels/gather.h @@ -16,6 +16,7 @@ #define MACE_KERNELS_GATHER_H_ #include +#include #include #include diff --git a/mace/kernels/local_response_norm.h b/mace/kernels/local_response_norm.h index d9eeb7db..d53b8f08 100644 --- a/mace/kernels/local_response_norm.h +++ b/mace/kernels/local_response_norm.h @@ -16,6 +16,7 @@ #define MACE_KERNELS_LOCAL_RESPONSE_NORM_H_ #include +#include #include #include diff --git a/mace/kernels/quantize.h b/mace/kernels/quantize.h index fe52e8d8..c0280931 100644 --- a/mace/kernels/quantize.h +++ b/mace/kernels/quantize.h @@ -15,6 +15,7 @@ #ifndef MACE_KERNELS_QUANTIZE_H_ #define MACE_KERNELS_QUANTIZE_H_ +#include #include #include #include diff --git a/mace/kernels/resize_bicubic.h b/mace/kernels/resize_bicubic.h index f8953e89..52f0ee34 100644 --- a/mace/kernels/resize_bicubic.h +++ b/mace/kernels/resize_bicubic.h @@ -16,6 +16,7 @@ #define MACE_KERNELS_RESIZE_BICUBIC_H_ #include +#include #include #include diff --git a/mace/kernels/sgemm.cc b/mace/kernels/sgemm.cc index ab8310d1..a5f15fd0 100644 --- a/mace/kernels/sgemm.cc +++ b/mace/kernels/sgemm.cc @@ -965,7 +965,7 @@ void SGemm::PackPerBatch(const MatrixMap &src, const index_t width = src.col(); auto src_data = src.batch_data(batch_index); - if (src.major() == Major::RowMajor && order == PackOrder::ColMajor) { + if (src.map_major() == Major::RowMajor && order == PackOrder::ColMajor) { // This is for packing no-transpose lhs. index_t h = 0; #if defined(MACE_ENABLE_NEON) @@ -1011,7 +1011,8 @@ void SGemm::PackPerBatch(const MatrixMap &src, for (index_t ih = h; ih < height; ++ih) { std::copy_n(src_data + ih * width, width, packed_data + ih * width); } - } else if (src.major() == Major::ColMajor && order == PackOrder::ColMajor) { + } else if (src.map_major() == Major::ColMajor && + order == PackOrder::ColMajor) { // This is for packing transpose-needed lhs. index_t h = 0; #if defined(MACE_ENABLE_NEON) @@ -1052,7 +1053,8 @@ void SGemm::PackPerBatch(const MatrixMap &src, packed_data_ptr[w] = src_data_ptr[w * height]; } } - } else if (src.major() == Major::RowMajor && order == PackOrder::RowMajor) { + } else if (src.map_major() == Major::RowMajor && + order == PackOrder::RowMajor) { // This is for packing no-transpose rhs. index_t w = 0; #if defined(MACE_ENABLE_NEON) @@ -1077,7 +1079,8 @@ void SGemm::PackPerBatch(const MatrixMap &src, packed_data_ptr[h] = src_data_ptr[h * width]; } } - } else if (src.major() == Major::ColMajor && order == PackOrder::RowMajor) { + } else if (src.map_major() == Major::ColMajor && + order == PackOrder::RowMajor) { // This is for packing transpose-needed rhs. index_t w = 0; #if defined(MACE_ENABLE_NEON) @@ -1113,7 +1116,7 @@ void SGemm::UnPackPerBatch(const float *packed_data, const index_t width = matrix_map->col(); auto unpacked_data = matrix_map->batch_data(batch_index); - if (matrix_map->major() == Major::RowMajor) { + if (matrix_map->map_major() == Major::RowMajor) { // This is for non-transposed result index_t w = 0; #if defined(MACE_ENABLE_NEON) diff --git a/mace/kernels/sgemm.h b/mace/kernels/sgemm.h index c24c9c03..92a185db 100644 --- a/mace/kernels/sgemm.h +++ b/mace/kernels/sgemm.h @@ -74,7 +74,7 @@ class MatrixMap { return stride_; } - Major major() const { + Major map_major() const { return major_; } diff --git a/mace/kernels/strided_slice.h b/mace/kernels/strided_slice.h index a5d0eb38..3f1f2c49 100644 --- a/mace/kernels/strided_slice.h +++ b/mace/kernels/strided_slice.h @@ -16,6 +16,7 @@ #define MACE_KERNELS_STRIDED_SLICE_H_ #include +#include #include #include -- GitLab