我是 SSE 的新手,到目前为止,您已经设法从 unsigned char 数组加载,但我不知道如何将结果存储回来。请帮我。
void calculate_borders_parallel( unsigned char *src, unsigned char *dst, int width, int height )
{
// TO DO
__m128i sourceUp;
__m128i sourceDown;
__m128i destiny;
#pragma omp parallel for
for (int j = 1; j<height; j++)
{
for (int i = 0; i<width; i+=4)
{
sourceUp = _mm_loadu_si128( (const __m128i*)&src[(j-1)*width+i] );
sourceDown = _mm_loadu_si128( (const __m128i*)&src[(j+1)*width+i] );
destiny = _mm_subs_epu8(sourceDown, sourceUp);
_mm_store_si128( &dst[(j+0)*width+i], destiny ); // <----- ERROR HERE .. cannot convert from __m128i to unsigned char
}
}