Problem with "undefined reference to `_mm512_mask_set1_epi32'"

Problem with "undefined reference to `_mm512_mask_set1_epi32'"

I starting in MIC and I have a problem with the function _mm512_mask_set1_epi32.

I have a vector that I want to change the half of the elements with a value and the other half with another value.

#include <immintrin.h>

int main(){

       int valueOne = 7;

       int valueTwo = 11;

        __m512i vector;

        __mmask16 mask = _mm512_int2mask(0xFF00);

        vector = _mm512_set1_epi32(valueOne);

        _mm512_mask_set1_epi32(vector, mask, valueTwo);

        return(0);
}

I compiled with:

icpc -mmic test.cpp -c

that generate the file test.o. So I used xiar to create a static archive library:

xiar rcs libtest.a test.o

So, when I tried to generate the executable with

icpc -mmic libtest.a -o test

I received the below error:

libtest.a(test.o): In function `main':
test.cpp:(.text+0x47): undefined reference to `_mm512_mask_set1_epi32'

I'm using Intel Compiler SP1 ( 14.0.1.106 ) and only getting errors with this function. If someone can give me any hint about how to solve this error, I appreciate.

11 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

_mm512_mask_set1_epi32 is only available in the Intel® AVX-512 intrinsics and not the current Xeon Phi™ processor (“Knights Corner”). It may be available in a future a Xeon Phi™ coprocessor that includes Intel® AVX-512 support.

For now, Development recommends  using  _mm512_mask_mov{_ps|_epi32} or an alternative _mm512_extload_*.

Using _mm512_mask_mov_* the code would look like this:

         vector1 = _mm512_set1_epi32(valueOne); 
         vector2 = _mm512_set1_epi32(valueTwo); 
         res     = _mm512_mask_mov_epi32(vector1, mask, vector2);

The alternative using _mm512_extload_* intrinsic looks something like this:

         vector1 = _mm512_set1_epi32(valueOne); 
         res     = _mm512_mask_extload_epi32(vector1, mask, &valueTwo,
                                             _MM_UPCONV_EPI32_NONE,
                                             _MM_BROADCAST_1X16, 0);

 

Thanks a lot for the answer, Kevin!

I tried to use this function(_mm512_mask_set1_epi32) because i saw it in specific KNC functions list(https://software.intel.com/sites/landingpage/IntrinsicsGuide/) and I checked the line 4963 in the file zmmintrin.h for it.

If this function only will works in AVX-512, where can I see only KNC functions?

One more time, thanks for your explanation.

If this function only will works in AVX-512, where can I see only KNC functions?

If you click on the box to select only KNC functions at the intrinsics guide (the link you gave), then you'll only see KNC functions. Like this...

Some of them will be tagged with the red (AVX-512) colour as well, because they're the same in both KNC and AVX-512.

If this is showing the wrong things, then let us know and we'll get it fixed.

You're very welcome.

I received some follow up from Developers who indicate this intrinsic will be available for the next generation Xeon Phi™ coprocessor and could can be added for the current Xeon Phi™ ("Knights Corner") coprocessor too. I created a feature request (see internal tracking id below) and will update this thread on the availability as I learn it. I don't have any time frame commitment currently so hopefully the alternatives will help for now.

(Internal tracking id: DPD200357605)

If this function only will works in AVX-512, where can I see only KNC functions?

If you click on the box to select only KNC functions at the intrinsics guide (the link you gave), then you'll only see KNC functions. Like this...

James, I asked because I saw in this page, marking only KNC functions as below:

I believe that this function couldn't be viewed for KNC until is available for it. Thanks for you hint.

And thanks again Kevin, the alternatives that you gave me works very well.

I agree, that seems like a bug on that web page. I hope Kevin knows how to submit a bug report for it :-)

On the Intrinsic Guide page, when you mouse over the ? appearing to the right of the search field it raises a pop-up with a "Go Here" link (https://software.intel.com/en-us/forums/topic/363747) where one can report questions/issues with the guide.

I posted a reply regarding the issue Jeremias noted here: https://software.intel.com/en-us/forums/topic/363747?page=1#comment-1791410

Excellent. I will track the releases and corrections.

 

The intrinsic guide issue has been fixed. Thank you for bringing that to our attention.
 

I'm grateful for your help.

Leave a Comment

Please sign in to add a comment. Not a member? Join today