//.h file #ifndef _SSEEXAMPLE1_H #define _SSEEXAMPLE1_H #include <emmintrin.h> class sseexample1 { public: void charles(__m128i *x, __m128i *y); }; #endif //,cpp file #include "stdafx.h" #include <stdio.h> #include <emmintrin.h> #include "sseexample1.h" void sseexample1::charles(__m128i* x,__m128i* y) { for (int j = 0;j<4;j++) { *&y[j] = _mm_add_epi16(*&x[j],*&x[j+1]); } } //main.cpp file #include "stdafx.h" #include <stdio.h> #include <emmintrin.h> #include "sseexample1.h" #include <iostream> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { int x[2][4]={1,1,1,1,2,2,2,2}; int y[2][4]; sseexample1 z; z.charles(x,y);//error C2664: 'sseexample1::charles' : cannot convert parameter 1 from 'int [2][4]' to '__m128i *' for (int j = 0; j < 4; j++) cout << y[j] << " "; cout << endl; return 0; }
z.charles((__m128i *)x, (__m128i *)y);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)