How to run dgemms subroutine on mac computer

Click For Summary

Discussion Overview

The discussion revolves around the use of the dgemul subroutine for matrix multiplication on a Mac computer, specifically within the context of the Accelerate framework and LAPACK. Participants are exploring issues related to function recognition and appropriate subroutines for matrix operations.

Discussion Character

  • Homework-related
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant describes their attempt to use the dgemul subroutine for matrix multiplication but encounters an issue where the function is not recognized.
  • Another participant notes that they could not find a routine called dgemul in the LAPACK documentation.
  • A participant questions the source of the dgemul reference and provides a link to IBM's documentation, which describes ESSL rather than LAPACK.
  • There is a request for clarification on which subroutine should be used for matrix-matrix multiplication.
  • One participant reiterates the source of their information regarding dgemul, emphasizing the distinction between ESSL and LAPACK.

Areas of Agreement / Disagreement

Participants do not appear to agree on the existence of the dgemul subroutine within LAPACK, with some asserting it is not included while others reference external documentation. The discussion remains unresolved regarding the appropriate subroutine for matrix multiplication.

Contextual Notes

The discussion highlights potential confusion between different libraries (LAPACK vs. ESSL) and the specific subroutines available within them. There is uncertainty regarding the correct function to use for matrix multiplication.

missfangula
Messages
32
Reaction score
0

Homework Statement



I wrote a program to run the dgemul subroutine on my mac to find the matrix product for matrix a and matrix b, outputted as matrix c, just like the reference manual told me to. Being a mac user, I added the accelerate framework to the file which contain all the lapack stuff, but it does not recognize 'dgemul' as a function. Can someone please enlighten me as to what I am doing wrong? Below is the completed program.

Homework Equations


The Attempt at a Solution



#import <Foundation/Foundation.h>
#include <Accelerate/Accelerate.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>

int main ()
{

double a[16] =
{
1.0, 2.0, 3.0, 4.0,
1.0, 2.0, 3.0, 4.0,
1.0, 2.0, 3.0, 4.0,
1.0, 2.0, 3.0, 4.0

};

double b[16] =
{
5.0, 4.0, 3.0, 2.0,
5.0, 4.0, 3.0, 2.0,
5.0, 4.0, 3.0, 2.0,
5.0, 4.0, 3.0, 2.0
};

double c[16] =
{
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0
};

int lda = 4;
int ldb = 4;
char transa = 'N';
char transb = 'N';
int ldc = 4;
int l = 4;
int m = 4;
int n = 4;

dgemul(a, lda, transa, b, ldb, transb, c, ldc, l, m, n);
int i;
for (i=0; i<16; ++i) printf("%5.10f\n", c);


return 0;
}


Thank you!
-miss fangula
 
Physics news on Phys.org
sorry, i meant the dgemul subroutine in the title, not dgemms
 
I took a quick look at lapack and didn't see a routine called dgemul included.
 
what subroutine should i call to do a matrix-matrix product?
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
6K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
Replies
4
Views
14K
  • · Replies 3 ·
Replies
3
Views
19K
  • · Replies 6 ·
Replies
6
Views
3K
Replies
1
Views
2K