Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

How to rotate array in mkl

caden_g_
Beginner
808 Views

int arrA[]={1,2,3,..........100};

I want to get arrB={100,.......3,2,1};

What's the fastest fun?

0 Kudos
7 Replies
caden_g_
Beginner
808 Views

If I want to get arrA={100,.......3,2,1},too;

What's the fastest fun?

0 Kudos
Gennady_F_Intel
Moderator
808 Views

MKL doesn't have such functions, but you may have a look at the existing IPP functionality ( ippsFlip_*,* or ippsSortAscend/Descend ). 

https://software.intel.com/en-us/node/502149.

 

0 Kudos
TimP
Honored Contributor III
808 Views

C++ reverse_copy() is optimized for the designated architecture by Intel C++ and g++.  A plain loop would work as well.

0 Kudos
mecej4
Honored Contributor III
808 Views

By the way, note that "Rotate" is not an apt word for what you want to do. "Reverse", "Reflect" or the more flippant "Flip" would be more appropriate.

0 Kudos
caden_g_
Beginner
808 Views

Gennady Fedorov (Intel) wrote:

MKL doesn't have such functions, but you may have a look at the existing IPP functionality ( ippsFlip_*,* or ippsSortAscend/Descend ). 

https://software.intel.com/en-us/node/502149.

 

 

ok,thank you

0 Kudos
caden_g_
Beginner
808 Views

Tim P. wrote:

C++ reverse_copy() is optimized for the designated architecture by Intel C++ and g++.  A plain loop would work as well.

ok thank you

0 Kudos
caden_g_
Beginner
808 Views

mecej4 wrote:

By the way, note that "Rotate" is not an apt word for what you want to do. "Reverse", "Reflect" or the more flippant "Flip" would be more appropriate.

yes, you are right.

0 Kudos
Reply