Software Archive
Read-only legacy content
17060 Discussions

AVX-512 _mm512_castsi256_si512

Anonymous18
Beginner
484 Views

Hello,

I am new in MIC programming

I am using AVX-512 registers. My code is:

__m256i s0 =  _mm256_set_epi8(
                        imageTemp((x-2),(y-1),11),imageTemp((x-2),(y-1),10),imageTemp((x-2),(y-1),9),imageTemp((x-2),(y-1),8)
                        ,imageTemp((x-2),(y-1),7),imageTemp((x-2),(y-1),6),imageTemp((x-2),(y-1),5),imageTemp((x-2),(y-1),4)
                        ,imageTemp((x-2),(y-1),3),imageTemp((x-2),(y-1),2),imageTemp((x-2),(y-1),1),imageTemp((x-2),(y-1),0)
                        ,imageTemp((x-2),(y-2),19),imageTemp((x-2),(y-2),18),imageTemp((x-2),(y-2),17),imageTemp((x-2),(y-2),16)
                        ,imageTemp((x-2),(y-2),15),imageTemp((x-2),(y-2),14),imageTemp((x-2),(y-2),13),imageTemp((x-2),(y-2),12)
                        ,imageTemp((x-2),(y-2),11),imageTemp((x-2),(y-2),10),imageTemp((x-2),(y-2),9),imageTemp((x-2),(y-2),8)
                        ,imageTemp((x-2),(y-2),7),imageTemp((x-2),(y-2),6),imageTemp((x-2),(y-2),5),imageTemp((x-2),(y-2),4)
                        ,imageTemp((x-2),(y-2),3),imageTemp((x-2),(y-2),2),imageTemp((x-2),(y-2),1),imageTemp((x-2),(y-2),0)
                        );

#pragma offload target(mic)
                        {                                
                                __m512i aux1 = _mm512_castsi256_si512(s0);
                        }

and i want to convert my variable s0(__m256i) to aux1(__m512i) .

I compile with:

icc my_smooth_opt_v128v2.c

AND I GET 2 ERRORS:

my_smooth_opt_v128v2.c(188): error: function "_mm512_castsi256_si512" called in offload region must have been declared with compatible "target" attribute
                  __m512i x1 = _mm512_castsi256_si512(a);     
                               ^

my_smooth_opt_v128v2.c(188): error: a value of type "int" cannot be used to initialize an entity of type "__m512i"
                  __m512i x1 = _mm512_castsi256_si512(a);

 

Thank you so much

0 Kudos
1 Reply
Loc_N_Intel
Employee
484 Views

Hi Lex,

Have you verified if that intrinsic is supported for Xeon Phi coprocessor (please refer to "Intel(R) Xeon Phi(TM) Coprocessor Instruction Set Architecture Reference Manual" https://software.intel.com/sites/default/files/forum/278102/327364001en.pdf)?

Thanks.

0 Kudos
Reply