简体   繁体   中英

Is there something like extremely optimized memcpy2d in C/C++?

I am looking for something to copy a 2D array into another (larger) 2D array extremely fast, using SSD/MMX/3DNow/SIMD (Whatever). I do not want to implement myself, just looking for a high-optimized supported and maintained solution. I am using Clang(++) on Linux.

memcyp2Di(int *src, int *dest, int srcw, int srch, int destw, int desth, int destx, int desty)

通过Agner Fog查看Asmlib ,它提供了一个极其优化的memcpy版本和其他常见的libc函数,这些函数是用汇编编写的,并使用CPU中可用的最佳SIMD指令集,从基本的SSE一直到最新的AVX2和FMA3例如,Haswell处理器中的说明。

There is the Intel IPP library . It is used to do things such as math computations on large matrices, but I am pretty sure there are copy functions too. The library initializes itself to make use of the fastest version of each function depending on your processor and they keep it up to date so when new processors come out, they eventually implement the functions with new instructions to make things even faster.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM