Community
cancel
Showing results for 
Search instead for 
Did you mean: 
GoGetEM
Beginner
103 Views

Intel compiler generates error / gcc is ok

I just installed oneApi on my Ubuntu 20.04 machine.  My gcc compiler successfully compiles this native on Ubuntu:

 

void mullo_epi8(__m256i a, __m256i b, __m256i& result)
{
// convert to 16bit and combine
__m256i tmp0 = _mm256_cvtepi8_epi16(((__m128i*)&a[0])[0]);
__m256i tmp1 = _mm256_cvtepi8_epi16(((__m128i*)&b[0])[0]);
__m256i tmp2 = _mm256_cvtepi8_epi16(((__m128i*)&a[0])[1]);
__m256i tmp3 = _mm256_cvtepi8_epi16(((__m128i*)&b[0])[1]);

// do the multiply
__m256i res1 = _mm256_mullo_epi16(tmp0, tmp1);
__m256i res2 = _mm256_mullo_epi16(tmp2, tmp3);

// convert back to 8bit
result = _mm256_permute4x64_epi64(
_mm256_packs_epi16(res1, res2),
0xD8 // 3,1,2,0
);
}

With the intel compiler I get errors:

 __m256i tmp0 = _mm256_cvtepi8_epi16(((__m128i*)&(a.data()))[0]);
~^~~~~
./turbo_coder.h:120:52: error: address of vector element requested
__m256i tmp1 = _mm256_cvtepi8_epi16(((__m128i*)&b[0])[0]);
^~~~~
./turbo_coder.h:121:52: error: address of vector element requested
__m256i tmp2 = _mm256_cvtepi8_epi16(((__m128i*)&a[0])[1]);
^~~~~

0 Kudos
3 Replies
NoorjahanSk_Intel
Moderator
79 Views

Hi,

Thanks for reaching out to us.

 

could you please try using &a instead of &a[0].

If the issue still persists, please let us know.

 

Thanks & regards

Noorjahan

 

NoorjahanSk_Intel
Moderator
53 Views

Hi,

 

Reminder:

Could you please confirm whether your issue is resolved. If yes, let us know if we can close this thread from our end.

 

Thanks & Regards

Noorjahan.

 

 

NoorjahanSk_Intel
Moderator
5 Views

Hi,

We are closing this thread assuming your issue has been resolved.


We will no longer respond to this thread. If you require additional assistance from Intel, please start a new thread.


Any further interaction in this thread will be considered community only..


Thanks & Regards

Noorjahan


Reply