From 968ee0c071d7cdfff8a5d4ed3b2ae5220e580dea Mon Sep 17 00:00:00 2001 From: liuqi Date: Fri, 13 Apr 2018 14:09:33 +0800 Subject: [PATCH] Remove static keyword in header files. --- mace/kernels/addn.h | 2 +- mace/kernels/proposal.h | 12 ++++++------ mace/kernels/resize_bilinear.h | 20 ++++++++++---------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/mace/kernels/addn.h b/mace/kernels/addn.h index 0803bc2a..7538b5b1 100644 --- a/mace/kernels/addn.h +++ b/mace/kernels/addn.h @@ -19,7 +19,7 @@ namespace mace { namespace kernels { -static constexpr int kCostPerGroup = 1024; +constexpr int kCostPerGroup = 1024; template struct AddNFunctor { diff --git a/mace/kernels/proposal.h b/mace/kernels/proposal.h index d817ae13..0f259cdc 100644 --- a/mace/kernels/proposal.h +++ b/mace/kernels/proposal.h @@ -15,7 +15,7 @@ namespace mace { namespace kernels { -static inline std::vector WHCenters(const std::vector &anchor) { +inline std::vector WHCenters(const std::vector &anchor) { // width, height, width_center, height_center std::vector window(4); window[0] = anchor[2] - anchor[0] + 1; @@ -25,7 +25,7 @@ static inline std::vector WHCenters(const std::vector &anchor) { return window; } -static inline std::vector> GenerateAnchors( +inline std::vector> GenerateAnchors( const std::vector &scales, const std::vector &ratios, const int base_size) { @@ -65,10 +65,10 @@ static inline std::vector> GenerateAnchors( return anchors; } -static inline std::vector nms(const float *bboxes_ptr, - const index_t num_bboxes, - const float thresh, - const int post_nms_top_n) { +inline std::vector nms(const float *bboxes_ptr, + const index_t num_bboxes, + const float thresh, + const int post_nms_top_n) { std::vector keep; std::vector suppressed(num_bboxes, 0); diff --git a/mace/kernels/resize_bilinear.h b/mace/kernels/resize_bilinear.h index 7af3b39c..5a513753 100644 --- a/mace/kernels/resize_bilinear.h +++ b/mace/kernels/resize_bilinear.h @@ -23,15 +23,15 @@ struct CachedInterpolation { float lerp; }; -static inline float CalculateResizeScale(index_t in_size, - index_t out_size, - bool align_corners) { +inline float CalculateResizeScale(index_t in_size, + index_t out_size, + bool align_corners) { return (align_corners && out_size > 1) ? (in_size - 1) / static_cast(out_size - 1) : in_size / static_cast(out_size); } -static inline void ComputeInterpolationWeights( +inline void ComputeInterpolationWeights( const index_t out_size, const index_t in_size, const float scale, @@ -46,12 +46,12 @@ static inline void ComputeInterpolationWeights( } } -static inline float ComputeLerp(const float top_left, - const float top_right, - const float bottom_left, - const float bottom_right, - const float x_lerp, - const float y_lerp) { +inline float ComputeLerp(const float top_left, + const float top_right, + const float bottom_left, + const float bottom_right, + const float x_lerp, + const float y_lerp) { const float top = top_left + (top_right - top_left) * x_lerp; const float bottom = bottom_left + (bottom_right - bottom_left) * x_lerp; return top + (bottom - top) * y_lerp; -- GitLab