Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- void matmul(float **a, float **b, float **c,int m)
- {
- int i,j,k;
- for(i=0; i<m; i++)
- for(j=0; j<m; j++)
- c[i][j] = 0.0;
- for(i=0; i<m; i++)
- for(k=0; k<m; k++)
- for(j=0; j<m; j++)
- c[i][j] += a[i][k]*b[k][j];
- }
- from ctypes import *
- libhello = cdll.LoadLibrary('./matmul.so')
- input = (c_double * 2)()
- input[0].value = 2.5
- libhello.matmul(input, input, input)
Add Comment
Please, Sign In to add comment