Guest User

Untitled

a guest
Nov 23rd, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4.  
  5. void matmul(float **a, float **b, float **c,int m)
  6. {
  7. int i,j,k;
  8. for(i=0; i<m; i++)
  9. for(j=0; j<m; j++)
  10. c[i][j] = 0.0;
  11. for(i=0; i<m; i++)
  12. for(k=0; k<m; k++)
  13. for(j=0; j<m; j++)
  14. c[i][j] += a[i][k]*b[k][j];
  15. }
  16.  
  17.  
  18. from ctypes import *
  19. libhello = cdll.LoadLibrary(&#039;./matmul.so&#039;)
  20. input = (c_double * 2)()
  21. input[0].value = 2.5
  22. libhello.matmul(input, input, input)
Add Comment
Please, Sign In to add comment