- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am a newcommer to MKL and write a simple test program. It is compiled and linked in VC++6 and VC++8 correctly. But when running to "SGETRS", there is a memory accessing violation. All input parameters seem to be right. Could anyone help me?
#include
#include
#include
#include "mkl.h"
void main()
{
int result;
int r, c, i;
char trans;
int order_a, systems_num, row_a, row_b, para_info;
int *pivot_index;
float*a, *b;
result = 1;
trans = 'N';
order_a = 12;
row_a = order_a;
row_b = order_a;
systems_num = 1;
a = b = NULL;
pivot_index = NULL;
a = (float*)malloc(order_a*order_a*sizeof(float));
b = (float*)malloc(order_a*systems_num*sizeof(float));
pivot_index = (int*)malloc(order_a*sizeof(int));
srand((unsigned)time(NULL));
for(i = 0, c = 0; c < order_a; c++)
for(r = 0; r < order_a; r++)
{
a = (float)rand();
i++;
}
for(i = 0, c = 0; c < systems_num; c++)
for(r = 0; r < order_a; r++)
{
b = (float)rand();
i++;
}
SGETRS(&trans, &order_a, &systems_num, a, &row_a, pivot_index,
b, &row_b, ¶_info);
}
#include
#include
#include
#include "mkl.h"
void main()
{
int result;
int r, c, i;
char trans;
int order_a, systems_num, row_a, row_b, para_info;
int *pivot_index;
float*a, *b;
result = 1;
trans = 'N';
order_a = 12;
row_a = order_a;
row_b = order_a;
systems_num = 1;
a = b = NULL;
pivot_index = NULL;
a = (float*)malloc(order_a*order_a*sizeof(float));
b = (float*)malloc(order_a*systems_num*sizeof(float));
pivot_index = (int*)malloc(order_a*sizeof(int));
srand((unsigned)time(NULL));
for(i = 0, c = 0; c < order_a; c++)
for(r = 0; r < order_a; r++)
{
a = (float)rand();
i++;
}
for(i = 0, c = 0; c < systems_num; c++)
for(r = 0; r < order_a; r++)
{
b = (float)rand();
i++;
}
SGETRS(&trans, &order_a, &systems_num, a, &row_a, pivot_index,
b, &row_b, ¶_info);
}
Link Copied
0 Replies

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page