-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqs2a2.c
41 lines (34 loc) · 770 Bytes
/
qs2a2.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <stdio.h>
#include <sys/syscall.h>
#include <unistd.h>
//void copy( float** s, float** d,int n_rows,int n_cols)
//{
//float matrix[n_rows][n_cols];
//memcpy(matrix , s , sizeof(matrix));
//memcpy(d , matrix , sizeof(matrix));
//}
int main(){
float s[2][2];
float d[2][2];
for ( int i = 0 ; i <2; i++){
for ( int j = 0 ; j<2; j++){
s[i][j]= i+ j ;
}
}
for ( int i = 0 ; i <2; i++){
for ( int j = 0 ; j<2 ; j++){
printf("%f ",d[i][j]);
}printf("\n");
}
//void ** source = &s ;
//void ** des = &d ;
// copy(s, d,2,2);
syscall(448,s,d,2,2);
//kernel_2d_memcpy(335,s,d,2,2);
for ( int i = 0 ; i <2; i++){
for ( int j = 0 ; j<2 ; j++){
printf("%f ",d[i][j]);
}printf("\n");
}
return 0;
}