提交 51ca5d0d 编写于 作者: Y yejianwu

support ubuntu18 with gcc7.3

上级 af264bfb
...@@ -39,7 +39,7 @@ int MaceOpenMPThreadCount = 1; ...@@ -39,7 +39,7 @@ int MaceOpenMPThreadCount = 1;
namespace { namespace {
int GetCPUCount() { int GetCPUCount() {
char path[32]; char path[64];
int cpu_count = 0; int cpu_count = 0;
int result = 0; int result = 0;
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#define MACE_KERNELS_ACTIVATION_H_ #define MACE_KERNELS_ACTIVATION_H_
#include <algorithm> #include <algorithm>
#include <cmath>
#include <memory> #include <memory>
#include <string> #include <string>
#include <vector> #include <vector>
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "mace/kernels/conv_pool_2d_util.h" #include "mace/kernels/conv_pool_2d_util.h"
#include <algorithm> #include <algorithm>
#include <cmath>
#include <vector> #include <vector>
namespace mace { namespace mace {
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#define MACE_KERNELS_ELTWISE_H_ #define MACE_KERNELS_ELTWISE_H_
#include <algorithm> #include <algorithm>
#include <cmath>
#include <functional> #include <functional>
#include <memory> #include <memory>
#include <utility> #include <utility>
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#define MACE_KERNELS_GATHER_H_ #define MACE_KERNELS_GATHER_H_
#include <algorithm> #include <algorithm>
#include <cmath>
#include <functional> #include <functional>
#include <vector> #include <vector>
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#define MACE_KERNELS_LOCAL_RESPONSE_NORM_H_ #define MACE_KERNELS_LOCAL_RESPONSE_NORM_H_
#include <algorithm> #include <algorithm>
#include <cmath>
#include <memory> #include <memory>
#include <vector> #include <vector>
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#ifndef MACE_KERNELS_QUANTIZE_H_ #ifndef MACE_KERNELS_QUANTIZE_H_
#define MACE_KERNELS_QUANTIZE_H_ #define MACE_KERNELS_QUANTIZE_H_
#include <cmath>
#include <vector> #include <vector>
#include <algorithm> #include <algorithm>
#include <limits> #include <limits>
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#define MACE_KERNELS_RESIZE_BICUBIC_H_ #define MACE_KERNELS_RESIZE_BICUBIC_H_
#include <algorithm> #include <algorithm>
#include <cmath>
#include <memory> #include <memory>
#include <vector> #include <vector>
......
...@@ -965,7 +965,7 @@ void SGemm::PackPerBatch(const MatrixMap<const float> &src, ...@@ -965,7 +965,7 @@ void SGemm::PackPerBatch(const MatrixMap<const float> &src,
const index_t width = src.col(); const index_t width = src.col();
auto src_data = src.batch_data(batch_index); 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. // This is for packing no-transpose lhs.
index_t h = 0; index_t h = 0;
#if defined(MACE_ENABLE_NEON) #if defined(MACE_ENABLE_NEON)
...@@ -1011,7 +1011,8 @@ void SGemm::PackPerBatch(const MatrixMap<const float> &src, ...@@ -1011,7 +1011,8 @@ void SGemm::PackPerBatch(const MatrixMap<const float> &src,
for (index_t ih = h; ih < height; ++ih) { for (index_t ih = h; ih < height; ++ih) {
std::copy_n(src_data + ih * width, width, packed_data + ih * width); 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. // This is for packing transpose-needed lhs.
index_t h = 0; index_t h = 0;
#if defined(MACE_ENABLE_NEON) #if defined(MACE_ENABLE_NEON)
...@@ -1052,7 +1053,8 @@ void SGemm::PackPerBatch(const MatrixMap<const float> &src, ...@@ -1052,7 +1053,8 @@ void SGemm::PackPerBatch(const MatrixMap<const float> &src,
packed_data_ptr[w] = src_data_ptr[w * height]; 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. // This is for packing no-transpose rhs.
index_t w = 0; index_t w = 0;
#if defined(MACE_ENABLE_NEON) #if defined(MACE_ENABLE_NEON)
...@@ -1077,7 +1079,8 @@ void SGemm::PackPerBatch(const MatrixMap<const float> &src, ...@@ -1077,7 +1079,8 @@ void SGemm::PackPerBatch(const MatrixMap<const float> &src,
packed_data_ptr[h] = src_data_ptr[h * width]; 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. // This is for packing transpose-needed rhs.
index_t w = 0; index_t w = 0;
#if defined(MACE_ENABLE_NEON) #if defined(MACE_ENABLE_NEON)
...@@ -1113,7 +1116,7 @@ void SGemm::UnPackPerBatch(const float *packed_data, ...@@ -1113,7 +1116,7 @@ void SGemm::UnPackPerBatch(const float *packed_data,
const index_t width = matrix_map->col(); const index_t width = matrix_map->col();
auto unpacked_data = matrix_map->batch_data(batch_index); 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 // This is for non-transposed result
index_t w = 0; index_t w = 0;
#if defined(MACE_ENABLE_NEON) #if defined(MACE_ENABLE_NEON)
......
...@@ -74,7 +74,7 @@ class MatrixMap { ...@@ -74,7 +74,7 @@ class MatrixMap {
return stride_; return stride_;
} }
Major major() const { Major map_major() const {
return major_; return major_;
} }
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#define MACE_KERNELS_STRIDED_SLICE_H_ #define MACE_KERNELS_STRIDED_SLICE_H_
#include <algorithm> #include <algorithm>
#include <cmath>
#include <memory> #include <memory>
#include <vector> #include <vector>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册