MNN/source/core/Macro.h

25 lines
575 B
C
Raw Normal View History

2019-04-17 10:49:11 +08:00
//
// Macro.h
// MNN
//
// Created by MNN on 2018/07/26.
// Copyright © 2018, Alibaba Group Holding Limited
//
#ifndef macro_h
#define macro_h
2019-12-27 22:16:57 +08:00
#include <MNN/MNNDefine.h>
2019-04-17 10:49:11 +08:00
#define ALIMIN(x, y) ((x) < (y) ? (x) : (y))
#define ALIMAX(x, y) ((x) > (y) ? (x) : (y))
#define UP_DIV(x, y) (((x) + (y) - (1)) / (y))
#define ROUND_UP(x, y) (((x) + (y) - (1)) / (y) * (y))
#define ALIGN_UP4(x) ROUND_UP((x), 4)
#define ALIGN_UP8(x) ROUND_UP((x), 8)
#if (__arm__ || __aarch64__) && (defined(__ARM_NEON__) || defined(__ARM_NEON))
#define MNN_USE_NEON
#endif
#endif /* macro_h */