Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    optimizing matrix multiplication

    Does anybody have a working algorithm or full copy of code that optimizes matrix multiplication in the x86 assembly language?

    I know a basic algorithm in C:
    for (i=0;i<BLOCK_SIZE;i++)
    for (j=0;j<BLOCK_SIZE;j++)
    for (k=0;k<BLOCK_SIZE;k++)
    c[i*MAX+j] += a[i*MAX+k]*b[k*MAX+j];

    but, does anybody know a faster one?

  • #2
    Regular Coder
    Join Date
    May 2004
    Location
    New Hampshire, America
    Posts
    246
    Thanks
    0
    Thanked 2 Times in 2 Posts
    You could download the DirectX SDK and import the library:
    d3dx.lib
    Use header:
    #include <d3dx.h>

    Use function:
    D3DXMatrixMultiply(Result, Mat1, Mat2);

    (note: the library name and header might be off slightly, it may be something like d3dx8.lib and d3dx8.h, you can easily check online though)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •