Skip to content

Commit

Permalink
neon
Browse files Browse the repository at this point in the history
  • Loading branch information
i-evi committed Oct 29, 2020
1 parent 25e7aa6 commit 593f8ba
Show file tree
Hide file tree
Showing 4 changed files with 5,770 additions and 5 deletions.
16 changes: 12 additions & 4 deletions src/additional/ecpufn/ecpufn.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
#include <immintrin.h>
#endif

#ifdef __ARM_NEON
#include "sse2neon.h"
#endif

#include "ecpufn.h"

#define NAIVE_CONV2D_IMPLEMENTATION(dtype) \
Expand Down Expand Up @@ -91,7 +95,8 @@ void ecpu_conv2d_f32(const f32 *in, f32 *out, i32 ix, i32 iy,
}
}

#if defined(__x86_64) && defined(__SSE__)
#if defined(__x86_64) && defined(__SSE__) || \
defined(__ARM_NEON) /* Supported via `sse2neon` */
void sse_conv2d_f32_k1s1(const f32 *in, f32 *out, i32 ix, i32 iy,
i32 ox, i32 oy, i32 sx, i32 sy, const f32 *k, i32 kw)
{
Expand Down Expand Up @@ -278,7 +283,8 @@ void ecpu_dot_prod_f32(const f32 *in, f32 *out, const f32 *w, i32 iw)
#endif
}

#if defined(__x86_64) && defined(__SSE__)
#if defined(__x86_64) && defined(__SSE__) || \
defined(__ARM_NEON) /* Supported via `sse2neon` */
void sse_dot_prod_f32(const f32 *in, f32 *out, const f32 *w, i32 iw)
{
i32 i;
Expand Down Expand Up @@ -396,7 +402,8 @@ void ecpu_max_pool2d_f32(const f32 *in, f32 *out, i32 x, i32 y, i32 s)
}
}

#if defined(__x86_64) && defined(__SSE__)
#if defined(__x86_64) && defined(__SSE__) || \
defined(__ARM_NEON) /* Supported via `sse2neon` */
void sse_max_pool2d_f32_s2(const f32 *in, f32 *out, i32 x, i32 y, i32 s)
{
i32 i, j;
Expand Down Expand Up @@ -552,7 +559,8 @@ void ecpu_avg_pool2d_f32(const f32 *in, f32 *out, i32 x, i32 y, i32 s)
}
}

#if defined(__x86_64) && defined(__SSE__)
#if defined(__x86_64) && defined(__SSE__) || \
defined(__ARM_NEON) /* Supported via `sse2neon` */
void sse_avg_pool2d_f32_s2(const f32 *in, f32 *out, i32 x, i32 y, i32 s)
{
i32 i, j;
Expand Down
3 changes: 2 additions & 1 deletion src/additional/ecpufn/ecpufn.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ ECPU_CONV2D_DECLARATION (u64);
ECPU_CONV2D_DECLARATION (f32);
ECPU_CONV2D_DECLARATION (f64);

#if defined(__x86_64) && defined(__SSE__)
#if (defined(__x86_64) && defined(__SSE__)) || \
(defined(__ARM_NEON)) /* Supported via `sse2neon` */
#define ALT_CONV2D_F32_K1S1 sse_conv2d_f32_k1s1
#define ALT_CONV2D_F32_K2SX sse_conv2d_f32_k2sx
#define ALT_CONV2D_F32_K3S1 sse_conv2d_f32_k3s1
Expand Down
Loading

0 comments on commit 593f8ba

Please sign in to comment.