- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
#include <stdio.h>
void mat_mul2(int M, int N, int K, double A[M][K], double B[K][N], double C[M][N])
{
for (int i = 0; i < M; i++) {
for (int j = 0; j < N; j++) {
for (int k = 0; k < K; k++) {
C[i][j] += A[i][k] * B[k][j];
}
}
}
}
int main(int argc, char **argv)
{
double A[3][3], B[3][3];
double C[3][3] = { 0 };
for (int i = 0; i < 3; i++) {
B[i][i] = 1;
for (int j = 0; j < 3; j++) {
A[i][j] = 3 * i + j;
}
}
printf("before\n");
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
printf(" %lf", C[i][j]);
}
printf("\n");
}
mat_mul2(3, 3, 3, A, B, C);
printf("after\n");
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
printf(" %lf", C[i][j]);
}
printf("\n");
}
return 0;
}
When I build by using above source code the output is below.
Expected results are
..
How can I solve this problem??
Actually It works in GCC compiler.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for reaching out to us.
Could you please provide us the compiler command you have used to investigate more on your issue?
Could you also provide the Intel C compiler version you are using?
We are able to execute the mat_mul program using icl in Windows and ICC in Linux machines. Please refer to the below attachments for more information.
Thanks & Regards
Shivani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
As we didn't hear back from you, Is your issue resolved? If not, please provide the details that have been asked in my previous post.
Thanks & Regards,
Shivani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
As we have not heard back from you, we are considering that your issue has been resolved. So we will no longer respond to this thread. If you require additional assistance from Intel, please start a new thread. Any further interaction in this thread will be considered community only.
Have a Good day!
Thanks & Regards
Shivani

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