- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
though the codes compiles well, the programe gives the message "run time check failure, stack around variable x", where i am doing it wrong? the output y
//.h file
#define _SSEEXAMPLE1_H
#include
__declspec(align(16))class sseexample1
{
public:
void charles(__m128i *x, __m128i *y);
};
#endif
//.cpp file
#include "stdafx.h"
#include
#include
#include "sseexample1.h"
void sseexample1::charles(__m128i* x,__m128i* y)
{
int j;
__m128i p,q,s;
for (j = 0;j<4;j++)
{
p
=_mm_loadu_si128(&x
q =_mm_loadu_si128(&x[j+1]);// load row 2 of x
s = _mm_add_epi16(p,q);// add row one and two
_mm_storeu_si128(&y
}
}
//main.cpp file
#include "stdafx.h"
#include
#include
#include "sseexample1.h"
#include
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
short x[4][4]={1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4};
short y[4][4];
//int s[4];
sseexample1 z;
z.charles((__m128i*)x,(__m128i*)y);
for (int j = 0; j < 4; j++)
cout << y
cout << endl;
return 0;
}
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
so when reading your x value, you are actually reading a vector of pointers. try to pass to the function &x[0][0] as argument
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page