1 #ifndef CAFFE2_UTILS_CPU_NEON_H_ 2 #define CAFFE2_UTILS_CPU_NEON_H_ 5 #if defined(__ARM_NEON__) || defined(__ARM_NEON) 11 inline bool isPointerAligned(
T* p,
size_t align) {
12 return (reinterpret_cast<uintptr_t>(p) % align == 0);
15 inline float32x4_t vert_sum_f32(float32x4_t v0,
19 v0 = vaddq_f32(v0, v1);
20 v2 = vaddq_f32(v2, v3);
21 return vaddq_f32(v0, v2);
24 inline float horizontal_sum_f32(float32x4_t v0,
28 v0 = vert_sum_f32(v0, v1, v2, v3);
29 float32x2_t v = vadd_f32(vget_high_f32(v0), vget_low_f32(v0));
30 return vget_lane_f32(vpadd_f32(v, v), 0);
35 inline float32x4_t vld1q_f32_aligned(
const float* p) {
36 return vld1q_f32((
const float*)
37 __builtin_assume_aligned(p,
sizeof(float32x4_t)));
40 inline void vst1q_f32_aligned(
float* p, float32x4_t v) {
41 vst1q_f32((
float*) __builtin_assume_aligned(p,
sizeof(float32x4_t)), v);
44 inline void vst4_u8_aligned(uint8_t* p, uint8x8x4_t v) {
46 __builtin_assume_aligned(p,
sizeof(uint8x8x4_t)), v);
51 #endif // defined(__ARM_NEON__) || defined(__ARM_NEON) 53 #endif // CAFFE2_UTILS_CPU_NEON_H_
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...