Skip to content

Commit

Permalink
fix arm targets
Browse files Browse the repository at this point in the history
  • Loading branch information
kali committed Nov 12, 2020
1 parent a3d707c commit c8ae9db
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
16 changes: 8 additions & 8 deletions linalg/src/arm32/armv7neon.rs
Expand Up @@ -3,16 +3,16 @@ use crate::frame::sigmoid::*;
use crate::frame::tanh::*;

extern "C" {
fn armv7neon_mmm_i8_8x4(op: *const MatMatMulKerSpec<i8, i8, i8, i32>) -> isize;
fn armv7neon_mmm_f32_8x4(op: *const MatMatMulKerSpec<f32, f32, f32, f32>) -> isize;
fn armv7neon_mmm_i8_8x4(op: *const MatMatMulKerSpec<i32>) -> isize;
fn armv7neon_mmm_f32_8x4(op: *const MatMatMulKerSpec<f32>) -> isize;
fn armv7neon_sigmoid_f32_4n(ptr: *mut f32, count: usize);
fn armv7neon_tanh_f32_4n(ptr: *mut f32, count: usize);
}

#[derive(Copy, Clone, Debug)]
pub struct MatMatMulI8x8x4;

impl MatMatMulKer<i8, i8, i8, i32> for MatMatMulI8x8x4 {
impl MatMatMulKer<i32> for MatMatMulI8x8x4 {
#[inline(always)]
fn name() -> &'static str {
"neon"
Expand All @@ -32,15 +32,15 @@ impl MatMatMulKer<i8, i8, i8, i32> for MatMatMulI8x8x4 {
4
}
#[inline(never)]
fn kernel(spec: &MatMatMulKerSpec<i8, i8, i8, i32>) -> isize {
fn kernel(spec: &MatMatMulKerSpec<i32>) -> isize {
unsafe { armv7neon_mmm_i8_8x4(spec) }
}
}

#[derive(Copy, Clone, Debug)]
pub struct MatMatMulI8xI32x8x4;

impl MatMatMulKer<i8, i8, i32, i32> for MatMatMulI8xI32x8x4 {
impl MatMatMulKer<i32> for MatMatMulI8xI32x8x4 {
#[inline(always)]
fn name() -> &'static str {
"neon"
Expand All @@ -60,15 +60,15 @@ impl MatMatMulKer<i8, i8, i32, i32> for MatMatMulI8xI32x8x4 {
4
}
#[inline(never)]
fn kernel(spec: &MatMatMulKerSpec<i8, i8, i32, i32>) -> isize {
fn kernel(spec: &MatMatMulKerSpec<i32>) -> isize {
unsafe { armv7neon_mmm_i8_8x4(spec as *const _ as _) }
}
}

#[derive(Copy, Clone, Debug)]
pub struct MatMatMulF32x8x4;

impl MatMatMulKer<f32, f32, f32, f32> for MatMatMulF32x8x4 {
impl MatMatMulKer<f32> for MatMatMulF32x8x4 {
#[inline(always)]
fn name() -> &'static str {
"neon"
Expand All @@ -88,7 +88,7 @@ impl MatMatMulKer<f32, f32, f32, f32> for MatMatMulF32x8x4 {
4
}
#[inline(never)]
fn kernel(spec: &MatMatMulKerSpec<f32, f32, f32, f32>) -> isize {
fn kernel(spec: &MatMatMulKerSpec<f32>) -> isize {
unsafe { armv7neon_mmm_f32_8x4(spec) }
}
}
Expand Down
6 changes: 3 additions & 3 deletions linalg/src/arm32/armvfpv2.rs
@@ -1,13 +1,13 @@
use crate::frame::mmm::*;

extern "C" {
fn armvfpv2_mmm_f32_4x4(op: *const MatMatMulKerSpec<f32, f32, f32, f32>) -> isize;
fn armvfpv2_mmm_f32_4x4(op: *const MatMatMulKerSpec<f32>) -> isize;
}

#[derive(Copy, Clone, Debug)]
pub struct MatMatMulF32x4x4;

impl MatMatMulKer<f32, f32, f32, f32> for MatMatMulF32x4x4 {
impl MatMatMulKer<f32> for MatMatMulF32x4x4 {
#[inline(always)]
fn name() -> &'static str {
"vfpv2"
Expand All @@ -27,7 +27,7 @@ impl MatMatMulKer<f32, f32, f32, f32> for MatMatMulF32x4x4 {
4
}
#[inline(never)]
fn kernel(spec: &MatMatMulKerSpec<f32, f32, f32, f32>) -> isize {
fn kernel(spec: &MatMatMulKerSpec<f32>) -> isize {
unsafe { armvfpv2_mmm_f32_4x4(spec) }
}
}
Expand Down
22 changes: 11 additions & 11 deletions linalg/src/arm64/arm64simd.rs
Expand Up @@ -3,17 +3,17 @@ use crate::frame::sigmoid::*;
use crate::frame::tanh::*;

extern "C" {
fn arm64simd_mmm_f32_8x8_a5x(op: *const MatMatMulKerSpec<f32, f32, f32, f32>) -> isize;
fn arm64simd_mmm_f32_8x8_gen(op: *const MatMatMulKerSpec<f32, f32, f32, f32>) -> isize;
fn arm64simd_mmm_i8_8x8(op: *const MatMatMulKerSpec<i8, i8, i8, i32>) -> isize;
fn arm64simd_mmm_f32_8x8_a5x(op: *const MatMatMulKerSpec<f32>) -> isize;
fn arm64simd_mmm_f32_8x8_gen(op: *const MatMatMulKerSpec<f32>) -> isize;
fn arm64simd_mmm_i8_8x8(op: *const MatMatMulKerSpec<i32>) -> isize;
fn arm64simd_sigmoid_f32_4n(ptr: *mut f32, count: usize);
fn arm64simd_tanh_f32_4n(ptr: *mut f32, count: usize);
}

#[derive(Copy, Clone, Debug)]
pub struct MatMatMulF32x8x8A5x;

impl MatMatMulKer<f32, f32, f32, f32> for MatMatMulF32x8x8A5x {
impl MatMatMulKer<f32> for MatMatMulF32x8x8A5x {
#[inline(always)]
fn name() -> &'static str {
"arm64simd"
Expand All @@ -33,15 +33,15 @@ impl MatMatMulKer<f32, f32, f32, f32> for MatMatMulF32x8x8A5x {
16
}
#[inline(never)]
fn kernel(op: &MatMatMulKerSpec<f32, f32, f32, f32>) -> isize {
fn kernel(op: &MatMatMulKerSpec<f32>) -> isize {
unsafe { arm64simd_mmm_f32_8x8_a5x(op) }
}
}

#[derive(Copy, Clone, Debug)]
pub struct MatMatMulF32x8x8;

impl MatMatMulKer<f32, f32, f32, f32> for MatMatMulF32x8x8 {
impl MatMatMulKer<f32> for MatMatMulF32x8x8 {
#[inline(always)]
fn name() -> &'static str {
"arm64simd"
Expand All @@ -61,15 +61,15 @@ impl MatMatMulKer<f32, f32, f32, f32> for MatMatMulF32x8x8 {
16
}
#[inline(never)]
fn kernel(op: &MatMatMulKerSpec<f32, f32, f32, f32>) -> isize {
fn kernel(op: &MatMatMulKerSpec<f32>) -> isize {
unsafe { arm64simd_mmm_f32_8x8_gen(op) }
}
}

#[derive(Copy, Clone, Debug)]
pub struct MatMatMulI8x8x8;

impl MatMatMulKer<i8, i8, i8, i32> for MatMatMulI8x8x8 {
impl MatMatMulKer<i32> for MatMatMulI8x8x8 {
#[inline(always)]
fn name() -> &'static str {
"arm64simd"
Expand All @@ -89,15 +89,15 @@ impl MatMatMulKer<i8, i8, i8, i32> for MatMatMulI8x8x8 {
16
}
#[inline(never)]
fn kernel(op: &MatMatMulKerSpec<i8, i8, i8, i32>) -> isize {
fn kernel(op: &MatMatMulKerSpec<i32>) -> isize {
unsafe { arm64simd_mmm_i8_8x8(op) }
}
}

#[derive(Copy, Clone, Debug)]
pub struct MatMatMulI8xI32x8x8;

impl MatMatMulKer<i8, i8, i32, i32> for MatMatMulI8xI32x8x8 {
impl MatMatMulKer<i32> for MatMatMulI8xI32x8x8 {
#[inline(always)]
fn name() -> &'static str {
"arm64simd"
Expand All @@ -117,7 +117,7 @@ impl MatMatMulKer<i8, i8, i32, i32> for MatMatMulI8xI32x8x8 {
16
}
#[inline(never)]
fn kernel(op: &MatMatMulKerSpec<i8, i8, i32, i32>) -> isize {
fn kernel(op: &MatMatMulKerSpec<i32>) -> isize {
unsafe { arm64simd_mmm_i8_8x8(op as *const _ as _) }
}
}
Expand Down

0 comments on commit c8ae9db

Please sign in to comment.