0

Has anyone know how to resolve these types of error? I am trying to add two 256-bit integer vector, but getting following error:

cpu_avx.c:12:20: error: incompatible types when initializing type ‘__m256i’ using type ‘int’ __m256i result = _mm256_add_epi32(a,b);

Sagar
  • 1
  • 1
  • 1
    You need to provide a [mcve]. Likely you are trying to pass an `int` where a `__m256i` is expected. – chtz Oct 01 '17 at 18:23
  • 1
    And also https://stackoverflow.com/questions/38662287/issue-with-m256-type-of-intel-intrinsics. **Looks like you ignored the warning that `_mm256_add_epi32` wasn't defined, and thus the return type defaulted to `int`.** (That's what happens in C. In C++ it's already an error to use undefined functions..) – Peter Cordes Oct 01 '17 at 18:54
  • 1
    Post your processor and more codes. We need to know about `a`, `b`, and `result` type. For example, maybe you declared `__m256 a, b;` and want to add them to `__m256i result` – Amiri Oct 01 '17 at 20:22

0 Answers0