Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gemm_strided: error: always_inline function '_mm256_setzero_pd' requires target feature 'xsave' #22

Open
timotheecour opened this issue Jan 30, 2019 · 1 comment

Comments

@timotheecour
Copy link

timotheecour commented Jan 30, 2019

import pkg/laser/primitives/matrix_multiplication/gemm

#[
error:
/tmp/nim/nimcache/laser_gemm_ukernel_avx.c:416:10: error: always_inline function '_mm256_setzero_pd' requires target feature 'xsave', but would be inlined into function 'gebb_ukernel_float64_x86_AVX_Ecs27YPxbc6EG9arud9a0ZTQ' that is compiled without support for 'xsave'
        AB0_0 = _mm256_setzero_pd();
]#
proc test =
  let a = [[1.0, 2, 3],
           [1.0, 1, 1],
           [1.0, 1, 1]]

  let b = [[1.0, 1],
           [1.0, 1],
           [1.0, 1]]

  let ab = [[6.0, 6],
            [3.0, 3],
            [3.0, 3]]

  var res_ab: array[3, array[2, float]]
  gemm_strided(
    3, 2, 3,
    1.0,  a[0][0].unsafeAddr, 3, 1,
          b[0][0].unsafeAddr, 2, 1,
    0.0,  res_ab[0][0].addr,  2, 1
    )

when defined(case1):
  proc test =
    # todo: different numbers
    let p1 = 3
    let p2 = p1
    let p3 = p1

    type T = float

    var a = newSeq[T](p1 * p2)
    for i in 0..<a.len: a[i] = 1.0
    var b = newSeq[T](p2 * p3)
    for i in 0..<b.len: b[i] = 1.0
    var c = newSeq[T](p1 * p3)

    gemm_strided(
      p1, p2, p3, # CHECKME ; not sure if order correct, would be nice to document M,N,K in `gemm_strided`

      1.0,
      a[0].addr, p1, 1,
      b[0].addr, p2, 1,

      0.0,
      c[0].addr, p1, 1,
    )
    echo c

test()
@timotheecour
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant