1.0.0-RC3 build errors

Open discussion for MAGMA

1.0.0-RC3 build errors

Postby xunlei » Tue Jan 25, 2011 5:49 pm

Hi,
I have some trouble building 1.0.0-RC3 on a 2.6.35-rc4_performance kernel x86_64 GNU/Linux with Intel MKL 11.1.072 and CUDA3.2. Here are the errors.
icc -O3 -DADD_ -DGPUSHMEM=130 -I/hpc_shared/apps/RHEL-5/x86_64/cuda/cuda-3.2/cuda/include -I../include -I../quark/include -c zgeev.cpp -o zgeev.o
zgeev.cpp(132): warning #584: omission of exception specification is incompatible with previous function "sqrt" (declared at line 157 of "/usr/include/bits/mathcalls.h")
double sqrt(double);
^

zgeev.cpp(144): error: more than one instance of overloaded function "zscal_" has "C" linkage
zscal_(magma_int_t *, cuDoubleComplex *, cuDoubleComplex *, magma_int_t *),
^

zgeev.cpp(145): warning #159: declaration is incompatible with previous "dlabad_" (declared at line 55 of "../include/magma_lapack.h")
dlabad_(double *, double *);
^

zgeev.cpp(148): error: more than one instance of overloaded function "dlamch_" has "C" linkage
extern double dlamch_(char *);
^

compilation aborted for zgeev.cpp (code 2)
make[1]: *** [zgeev.o] Error 2
make[1]: Leaving directory `/hpc_shared/home/xunlei/programs/magma_1.0.0-rc3/src'
make: *** [libmagma] Error 2
-bash-3.2$

Would you please help? Thanks a lot.
Best,
xunlei
xunlei
 
Posts: 4
Joined: Tue Jan 25, 2011 1:10 pm

Re: 1.0.0-RC3 build errors

Postby Stan Tomov » Tue Jan 25, 2011 9:41 pm

Thank you for this bug report. We fixed it. Until we post the new version you can just take out zgeev.cpp from the Makefile to compile the rest of the library, or fix it (the problem is compiler dependent, the way certain functions are declared).
Stan Tomov
 
Posts: 253
Joined: Fri Aug 21, 2009 10:39 pm

Re: 1.0.0-RC3 build errors

Postby xunlei » Tue Jan 25, 2011 10:04 pm

Thanks, Stan.
Could you tell me how to fix it? If I simply take zgeev.cpp out, what will be the consequence?
Best,
xunlei
xunlei
 
Posts: 4
Joined: Tue Jan 25, 2011 1:10 pm

Re: 1.0.0-RC3 build errors

Postby Stan Tomov » Tue Jan 25, 2011 11:24 pm

Xunlei,
zgeec.cpp is the LAPACK's zgeev with certain parts replaced by their MAGMA equivalents. Your compiler gives errors on the way some of the dependencies are declared and this has to be fixed. Removing zgeev.cpp from the Makefile will result in zgeev not being included in the library. There are no other files (except the testing_zgeev) that depend on it. We will post in a day or two our fix (I am not posting it now because our changes are in several files and we are still testing it).
Stan
Stan Tomov
 
Posts: 253
Joined: Fri Aug 21, 2009 10:39 pm

Re: 1.0.0-RC3 build errors

Postby xunlei » Tue Jan 25, 2011 11:41 pm

Hi Stan,
There are similar errors beyond just zgeev.cpp. These errors happen to zheevd.cpp, zgesvd.cpp. After taking these three files out of Makefile, I ran into more errors listed below.
ifort -O3 -DADD_ -DGPUSHMEM=130 -I/hpc_shared/apps/RHEL-5/x86_64/cuda/cuda-3.2/cuda/include -I../include -I../quark/include -J../include -c magma_zfortran.f90 -o magma_zfortran.o
ifort: command line warning #10006: ignoring unknown option '-J../include'
magma_zfortran.f90(21): error #6684: This is an incorrect value for a kind type parameter in this context. [KIND]
integer(kind=16), intent(inout) :: A
---------------^
magma_zfortran.f90(28): error #6684: This is an incorrect value for a kind type parameter in this context. [KIND]
integer(kind=16), intent(in) :: dA
---------------^
magma_zfortran.f90(29): error #6684: This is an incorrect value for a kind type parameter in this context. [KIND]
integer(kind=16), intent(inout) :: dB
---------------^
compilation aborted for magma_zfortran.f90 (code 1)
make[1]: *** [magma_zfortran.o] Error 1
make[1]: Leaving directory `/hpc_shared/home/xunlei/programs/magma_1.0.0-rc3/src'
make: *** [libmagma] Error 2
-bash-3.2$

Please let me know when there is a fix for them. Thanks a lot.
xunlei
 
Posts: 4
Joined: Tue Jan 25, 2011 1:10 pm

Re: 1.0.0-RC3 build errors

Postby Stan Tomov » Wed Jan 26, 2011 12:44 am

Hi Xunlei,
Thanks for this report too! We are going to look into it.
The easiest fix for now may be to just use gfortran instead of ifort.
Stan
Stan Tomov
 
Posts: 253
Joined: Fri Aug 21, 2009 10:39 pm

Re: 1.0.0-RC3 build errors

Postby julie » Wed Jan 26, 2011 9:39 am

Hi Stan,
While playing with MAGMA, I found a minor typo in a Makefile that prevents building correctly the library.

In magmablas/Makefile line 123:
you have:
Code: Select all
   $(NVCC) $(NVOPTS) $(GPUOPT) $(INC) -c $< -o $@

and it should be NVOPT (without the S)
Code: Select all
   $(NVCC) $(NVOPT) $(GPUOPT) $(INC) -c $< -o $@

Cheers,
Julie
julie
 
Posts: 1
Joined: Wed Jan 26, 2011 9:35 am

Re: 1.0.0-RC3 build errors

Postby Stan Tomov » Wed Jan 26, 2011 12:21 pm

Julie,
Good catch. Thanks!
We were looking yesterday with Don trying to figure out why the "-DADD_" option was not passed to the compiler, not seeing that actually no option was passed.
Stan
Stan Tomov
 
Posts: 253
Joined: Fri Aug 21, 2009 10:39 pm

Re: 1.0.0-RC3 build errors

Postby robintux » Thu Jan 27, 2011 4:24 pm

The error of my compilation is :

make[1]: Entering directory `/home/abraham/magma_1.0.0-rc3/testing'
gcc -O3 -DADD_ -DGPUSHMEM=130 -I/usr/local/cuda/include -I../include -I../quark/include -c testing_zgemm.cpp -o testing_zgemm.o
gfortran -O3 -DADD_ -DGPUSHMEM=130 -fPIC -Xlinker -zmuldefs -DGPUSHMEM=130 testing_zgemm.o -o testing_zgemm lin/liblapacktest.a -L../lib \
-lcuda -lmagma -lmagmablas -lmagma -L/usr/lib64/atlas -L/usr/lib/ -L/home/abraham/magma_1.0.0-rc3/CLAPACK-3.1.1.1/F2CLIBS/ -L/usr/local/cuda/lib64 -L/usr/local/cuda/lib /usr/lib64/liblapack.a -lf77blas -latlas -lf2c -lcublas -lm

/usr/bin/ld: cannot find -lf77blas

collect2: ld returned 1 exit status
make[1]: *** [testing_zgemm] Error 1
rm testing_zgemm.o
make[1]: Leaving directory `/home/abraham/magma_1.0.0-rc3/testing'
make: *** [test] Error 2


What is the missing package in Ubuntu 10.04 ???
robintux
 
Posts: 3
Joined: Thu Jan 27, 2011 3:30 pm

Re: 1.0.0-RC3 build errors

Postby mmarc » Mon Jan 31, 2011 8:11 am

Stan, xunlei,

First, thank you, Stan, and your colleagues, for your great work!

I had the similar errors xunlei mentioned, and was able to fix them and get magma rc3 compiled with mkl and intel compilers. Basically, the function references could be fixed by hand, and also I turned off the least fortran example in testing.

In case it could be useful, attaching diffs and make.inc (sorry, forum won't let me to attach files).

Code: Select all
Index: /src/magma_zfortran.f90

===================================================================

--- /src/magma_zfortran.f90   (revision 1)

+++ /src/magma_zfortran.f90   (revision 2)

@@ -6,28 +6,66 @@

 !      November 2010

 !

-!   @precisions normal z -> c d s

+!   -- Modified for MULTIBLAS/COACCEL --

+!      SRCC MSU

+!      January 2011

 !

+     

+  subroutine magma_zgetrf_gpu(m, n, A, lda, ipiv, info)



+  use iso_c_binding



+  interface

 

-module magma_zfortran

+  subroutine magma_zgetrf_gpu_c(m, n, A, lda, ipiv, info)

   

-  implicit none

+  use iso_c_binding

+

+  integer(c_int), value :: m, n, lda

+  type(c_ptr), value :: ipiv

+  integer(c_int), value :: info

+  type(c_ptr), value :: A

+

+  end subroutine magma_zgetrf_gpu_c

   

-  !---- Fortran interfaces to MAGMA subroutines ----

+  end interface



+  integer, intent(in) :: m, n, lda

+  integer, intent(out) :: ipiv(*), info

+  complex(C_DOUBLE_COMPLEX), dimension(m, n) :: A



+  call magma_zgetrf_gpu_c(m, n, c_loc(A), lda, c_loc(ipiv), info)



+  end subroutine magma_zgetrf_gpu

+

+

+

+  subroutine magma_zgetrs_gpu(trans, n, nrhs, dA, ldda, ipiv, dB, lddb, info)

+

+  use iso_c_binding



   interface

-     

-     subroutine magma_zgetrf_gpu(m, n, A, lda, ipiv, info)

-       integer,          intent(in)    :: m, n, lda

-       integer,          intent(out)   :: ipiv(*), info

-       integer(kind=16), intent(inout) :: A

-     end subroutine magma_zgetrf_gpu

-     

-     subroutine magma_zgetrs_gpu(trans, n, nrhs, dA, ldda, ipiv, dB, lddb, info)

-       character,        intent(in)    :: trans

-       integer,          intent(in)    :: n, nrhs, ldda, ipiv(*), lddb

-       integer,          intent(out)   :: info

-       integer(kind=16), intent(in)    :: dA

-       integer(kind=16), intent(inout) :: dB

-     end subroutine magma_zgetrs_gpu

-     

+

+  subroutine magma_zgetrs_gpu_c(trans, n, nrhs, dA, ldda, ipiv, dB, lddb, info)



+  use iso_c_binding

+

+  character(c_char), value :: trans

+  integer(c_int), value :: n, nrhs, ldda, lddb

+  type(c_ptr), value :: ipiv

+  integer(c_int), value :: info

+  type(c_ptr), value :: dA, dB

+

+  end subroutine magma_zgetrs_gpu_c

+

   end interface

-end module magma_zfortran

+

+  character, intent(in) :: trans

+  integer, intent(in) :: n, nrhs, ldda, ipiv(*), lddb

+  integer, intent(out) :: info

+  complex(C_DOUBLE_COMPLEX), intent(in) :: dA

+  complex(C_DOUBLE_COMPLEX), intent(inout) :: dB



+  call magma_zgetrs_gpu_c(trans, n, nrhs, c_loc(dA), ldda, c_loc(ipiv), c_loc(dB), lddb, info)



+  end subroutine magma_zgetrs_gpu

+

Index: /src/zheevd.cpp

===================================================================

--- /src/zheevd.cpp   (revision 1)

+++ /src/zheevd.cpp   (revision 2)

@@ -15,4 +15,5 @@

 #include "magma.h"

 #include "magmablas.h"

+#include <math.h>

 

 extern "C" magma_int_t

@@ -154,6 +155,4 @@

     double d__1;

 

-    double sqrt(double);

-

     static double eps;

     static magma_int_t inde;

@@ -162,6 +161,6 @@

     static double rmin, rmax;

     static magma_int_t lopt;

-    extern int dscal_(magma_int_t *, double *, double *,

-       magma_int_t *);

+    extern void dscal_(const magma_int_t *, double *, double *,

+       const magma_int_t *);

     static double sigma;

     static magma_int_t iinfo, lwmin, liopt;

@@ -170,5 +169,5 @@

     static magma_int_t wantz;

     static magma_int_t indwk2, llwrk2;

-    extern double dlamch_(char *);

+    extern double dlamch_(const char *);

     static magma_int_t iscale;

     static double safmin;

Index: /src/cheevd.cpp

===================================================================

--- /src/cheevd.cpp   (revision 1)

+++ /src/cheevd.cpp   (revision 2)

@@ -15,4 +15,5 @@

 #include "magma.h"

 #include "magmablas.h"

+#include <math.h>

 

 extern "C" magma_int_t

@@ -154,6 +155,4 @@

     float d__1;

 

-    float sqrt(float);

-

     static float eps;

     static magma_int_t inde;

@@ -162,6 +161,6 @@

     static float rmin, rmax;

     static magma_int_t lopt;

-    extern int dscal_(magma_int_t *, float *, float *,

-       magma_int_t *);

+    extern void sscal_(const magma_int_t *, float *, float *,

+       const magma_int_t *);

     static float sigma;

     static magma_int_t iinfo, lwmin, liopt;

@@ -170,5 +169,5 @@

     static magma_int_t wantz;

     static magma_int_t indwk2, llwrk2;

-    extern float slamch_(char *);

+    extern float slamch_(const char *);

     static magma_int_t iscale;

     static float safmin;

@@ -348,5 +347,5 @@

    }

    d__1 = 1. / sigma;

-   dscal_(&imax, &d__1, &w[1], &c__1);

+   sscal_(&imax, &d__1, &w[1], &c__1);

     }

 

Index: /src/ssyev.cpp

===================================================================

--- /src/ssyev.cpp   (revision 1)

+++ /src/ssyev.cpp   (revision 2)

@@ -15,4 +15,5 @@

 #include "magma.h"

 #include "magmablas.h"

+#include <math.h>

 

 extern "C" magma_int_t

@@ -154,6 +155,4 @@

     float d__1;

 

-    float sqrt(float);

-

     static float eps;

     static magma_int_t inde;

@@ -162,6 +161,6 @@

     static float rmin, rmax;

     static magma_int_t lopt;

-    extern int dscal_(magma_int_t *, float *, float *,

-       magma_int_t *);

+    extern void sscal_(const magma_int_t *, float *, float *,

+       const magma_int_t *);

     static float sigma;

     static magma_int_t iinfo, lwmin, liopt;

@@ -170,5 +169,5 @@

     static magma_int_t wantz;

     static magma_int_t indwk2, llwrk2;

-    extern float slamch_(char *);

+    extern float slamch_(const char *);

     static magma_int_t iscale;

     static float safmin;

@@ -348,5 +347,5 @@

    }

    d__1 = 1. / sigma;

-   dscal_(&imax, &d__1, &w[1], &c__1);

+   sscal_(&imax, &d__1, &w[1], &c__1);

     }

 

Index: /src/magma_cfortran.f90

===================================================================

--- /src/magma_cfortran.f90   (revision 1)

+++ /src/magma_cfortran.f90   (revision 2)

@@ -6,28 +6,66 @@

 !      November 2010

 !

-!   @generated c

+!   -- Modified for MULTIBLAS/COACCEL --

+!      SRCC MSU

+!      January 2011

 !

+     

+  subroutine magma_cgetrf_gpu(m, n, A, lda, ipiv, info)



+  use iso_c_binding



+  interface

 

-module magma_cfortran

+  subroutine magma_cgetrf_gpu_c(m, n, A, lda, ipiv, info)

   

-  implicit none

+  use iso_c_binding

+

+  integer(c_int), value :: m, n, lda

+  type(c_ptr), value :: ipiv

+  integer(c_int), value :: info

+  type(c_ptr), value :: A

+

+  end subroutine magma_cgetrf_gpu_c

   

-  !---- Fortran interfaces to MAGMA subroutines ----

+  end interface



+  integer, intent(in) :: m, n, lda

+  integer, intent(out) :: ipiv(*), info

+  complex(C_FLOAT_COMPLEX), dimension(m, n) :: A



+  call magma_cgetrf_gpu_c(m, n, c_loc(A), lda, c_loc(ipiv), info)



+  end subroutine magma_cgetrf_gpu

+

+

+

+  subroutine magma_cgetrs_gpu(trans, n, nrhs, dA, ldda, ipiv, dB, lddb, info)



+  use iso_c_binding

+

   interface

-     

-     subroutine magma_cgetrf_gpu(m, n, A, lda, ipiv, info)

-       integer,          intent(in)    :: m, n, lda

-       integer,          intent(out)   :: ipiv(*), info

-       integer(kind=16), intent(inout) :: A

-     end subroutine magma_cgetrf_gpu

-     

-     subroutine magma_cgetrs_gpu(trans, n, nrhs, dA, ldda, ipiv, dB, lddb, info)

-       character,        intent(in)    :: trans

-       integer,          intent(in)    :: n, nrhs, ldda, ipiv(*), lddb

-       integer,          intent(out)   :: info

-       integer(kind=16), intent(in)    :: dA

-       integer(kind=16), intent(inout) :: dB

-     end subroutine magma_cgetrs_gpu

-     



+  subroutine magma_cgetrs_gpu_c(trans, n, nrhs, dA, ldda, ipiv, dB, lddb, info)



+  use iso_c_binding

+

+  character(c_char), value :: trans

+  integer(c_int), value :: n, nrhs, ldda, lddb

+  type(c_ptr), value :: ipiv

+  integer(c_int), value :: info

+  type(c_ptr), value :: dA, dB

+

+  end subroutine magma_cgetrs_gpu_c

+

   end interface

-end module magma_cfortran

+

+  character, intent(in) :: trans

+  integer, intent(in) :: n, nrhs, ldda, ipiv(*), lddb

+  integer, intent(out) :: info

+  complex(C_FLOAT_COMPLEX), intent(in) :: dA

+  complex(C_FLOAT_COMPLEX), intent(inout) :: dB



+  call magma_cgetrs_gpu_c(trans, n, nrhs, c_loc(dA), ldda, c_loc(ipiv), c_loc(dB), lddb, info)



+  end subroutine magma_cgetrs_gpu

+

Index: /src/magma_sfortran.f90

===================================================================

--- /src/magma_sfortran.f90   (revision 1)

+++ /src/magma_sfortran.f90   (revision 2)

@@ -6,28 +6,66 @@

 !      November 2010

 !

-!   @generated s

+!   -- Modified for MULTIBLAS/COACCEL --

+!      SRCC MSU

+!      January 2011

 !

+     

+  subroutine magma_sgetrf_gpu(m, n, A, lda, ipiv, info)



+  use iso_c_binding



+  interface

 

-module magma_sfortran

+  subroutine magma_sgetrf_gpu_c(m, n, A, lda, ipiv, info)

   

-  implicit none

+  use iso_c_binding

+

+  integer(c_int), value :: m, n, lda

+  type(c_ptr), value :: ipiv

+  integer(c_int), value :: info

+  type(c_ptr), value :: A

+

+  end subroutine magma_sgetrf_gpu_c

   

-  !---- Fortran interfaces to MAGMA subroutines ----

+  end interface



+  integer, intent(in) :: m, n, lda

+  integer, intent(out) :: ipiv(*), info

+  real(C_FLOAT), dimension(m, n) :: A



+  call magma_sgetrf_gpu_c(m, n, c_loc(A), lda, c_loc(ipiv), info)



+  end subroutine magma_sgetrf_gpu

+

+

+

+  subroutine magma_sgetrs_gpu(trans, n, nrhs, dA, ldda, ipiv, dB, lddb, info)

+

+  use iso_c_binding



   interface

-     

-     subroutine magma_sgetrf_gpu(m, n, A, lda, ipiv, info)

-       integer,          intent(in)    :: m, n, lda

-       integer,          intent(out)   :: ipiv(*), info

-       integer(kind=16), intent(inout) :: A

-     end subroutine magma_sgetrf_gpu

-     

-     subroutine magma_sgetrs_gpu(trans, n, nrhs, dA, ldda, ipiv, dB, lddb, info)

-       character,        intent(in)    :: trans

-       integer,          intent(in)    :: n, nrhs, ldda, ipiv(*), lddb

-       integer,          intent(out)   :: info

-       integer(kind=16), intent(in)    :: dA

-       integer(kind=16), intent(inout) :: dB

-     end subroutine magma_sgetrs_gpu

-     

+

+  subroutine magma_sgetrs_gpu_c(trans, n, nrhs, dA, ldda, ipiv, dB, lddb, info)



+  use iso_c_binding

+

+  character(c_char), value :: trans

+  integer(c_int), value :: n, nrhs, ldda, lddb

+  type(c_ptr), value :: ipiv

+  integer(c_int), value :: info

+  type(c_ptr), value :: dA, dB

+

+  end subroutine magma_sgetrs_gpu_c

+

   end interface

-end module magma_sfortran

+

+  character, intent(in) :: trans

+  integer, intent(in) :: n, nrhs, ldda, ipiv(*), lddb

+  integer, intent(out) :: info

+  real(C_FLOAT), intent(in) :: dA

+  real(C_FLOAT), intent(inout) :: dB



+  call magma_sgetrs_gpu_c(trans, n, nrhs, c_loc(dA), ldda, c_loc(ipiv), c_loc(dB), lddb, info)



+  end subroutine magma_sgetrs_gpu

+

Index: /src/cgeev.cpp

===================================================================

--- /src/cgeev.cpp   (revision 1)

+++ /src/cgeev.cpp   (revision 2)

@@ -15,4 +15,5 @@

 #include "magma.h"

 #include "magmablas.h"

+#include <math.h>

 

 #define PRECISION_c

@@ -130,6 +131,4 @@

     cuFloatComplex z__1, z__2;

 

-    float sqrt(float);

-

     static magma_int_t i__, k, ihi;

     static float scl;

@@ -142,9 +141,9 @@

     static magma_int_t ierr, itau, iwrk, nout;

     extern int

-      cscal_(magma_int_t *, cuFloatComplex *, cuFloatComplex *, magma_int_t *),

-      slabad_(float *, float *);

+      cscal_(const magma_int_t *, cuFloatComplex *, cuFloatComplex *, const magma_int_t *);

+    extern void slabad_(float *, float *);

     extern float scnrm2_(magma_int_t *, cuFloatComplex *, magma_int_t *);

     magma_int_t scalea;

-    extern float slamch_(char *);

+    extern float slamch_(const char *);

     static float cscale;

     extern int

Index: /src/dgeev.cpp

===================================================================

--- /src/dgeev.cpp   (revision 1)

+++ /src/dgeev.cpp   (revision 2)

@@ -15,4 +15,5 @@

 #include "magma.h"

 #include "magmablas.h"

+#include <math.h>

 

 #define PRECISION_d

@@ -130,6 +131,4 @@

     double z__1, z__2;

 

-    double sqrt(double);

-

     static magma_int_t i__, k, ihi;

     static double scl;

@@ -141,10 +140,9 @@

     static double anrm;

     static magma_int_t ierr, itau, iwrk, nout;

-    extern int

-      dscal_(magma_int_t *, double *, double *, magma_int_t *),

-      dlabad_(double *, double *);

+    extern void dscal_(const magma_int_t *, double *, double *, const magma_int_t *);

+    extern void dlabad_(double *, double *);

     extern double dnrm2_(magma_int_t *, double *, magma_int_t *);

     magma_int_t scalea;

-    extern double dlamch_(char *);

+    extern double dlamch_(const char *);

     static double cscale;

     extern int

@@ -627,6 +625,4 @@

   double z__1, z__2;

 

-  double sqrt(double);

-

   static magma_int_t i__, k, ihi;

   static double scl;

@@ -638,10 +634,9 @@

   static double anrm;

   static magma_int_t ierr, itau, iwrk, nout;

-    extern int

-      dscal_(magma_int_t *, double *, double *, magma_int_t *),

-      dlabad_(double *, double *);

+  extern void dscal_(const magma_int_t *, double *, double *, const magma_int_t *);

+  extern void dlabad_(double *, double *);

     extern double dnrm2_(magma_int_t *, double *, magma_int_t *);

     magma_int_t scalea;

-    extern double dlamch_(char *);

+    extern double dlamch_(const char *);

     static double cscale;

     extern int

@@ -655,6 +650,4 @@

                 magma_int_t *, magma_int_t *, magma_int_t, magma_int_t);

     magma_int_t select[1];

-    extern int dscal_(magma_int_t *, double *,

-             double *, magma_int_t *);

     static double bignum;

     extern int

Index: /src/sgeev.cpp

===================================================================

--- /src/sgeev.cpp   (revision 1)

+++ /src/sgeev.cpp   (revision 2)

@@ -15,4 +15,5 @@

 #include "magma.h"

 #include "magmablas.h"

+#include <math.h>

 

 #define PRECISION_s

@@ -130,6 +131,4 @@

     float z__1, z__2;

 

-    float sqrt(float);

-

     static magma_int_t i__, k, ihi;

     static float scl;

@@ -146,5 +145,5 @@

     extern float snrm2_(magma_int_t *, float *, magma_int_t *);

     magma_int_t scalea;

-    extern float slamch_(char *);

+    extern float slamch_(const char *);

     static float cscale;

     extern int

@@ -158,6 +157,6 @@

                 magma_int_t *, magma_int_t *, magma_int_t, magma_int_t);

     magma_int_t select[1];

-    extern int sscal_(magma_int_t *, float *,

-             float *, magma_int_t *);

+    extern void sscal_(const magma_int_t *, float *,

+             float *, const magma_int_t *);

     static float bignum;

     extern int

@@ -627,6 +626,4 @@

   float z__1, z__2;

 

-  float sqrt(float);

-

   static magma_int_t i__, k, ihi;

   static float scl;

@@ -638,10 +635,9 @@

   static float anrm;

   static magma_int_t ierr, itau, iwrk, nout;

-    extern int

-      sscal_(magma_int_t *, float *, float *, magma_int_t *),

-      slabad_(float *, float *);

+  extern void sscal_(const magma_int_t *, float *, float *, const magma_int_t *);

+  extern void slabad_(float *, float *);

     extern float snrm2_(magma_int_t *, float *, magma_int_t *);

     magma_int_t scalea;

-    extern float slamch_(char *);

+    extern float slamch_(const char *);

     static float cscale;

     extern int

@@ -655,6 +651,4 @@

                 magma_int_t *, magma_int_t *, magma_int_t, magma_int_t);

     magma_int_t select[1];

-    extern int sscal_(magma_int_t *, float *,

-             float *, magma_int_t *);

     static float bignum;

     extern int

Index: /src/zgeev.cpp

===================================================================

--- /src/zgeev.cpp   (revision 1)

+++ /src/zgeev.cpp   (revision 2)

@@ -15,4 +15,5 @@

 #include "magma.h"

 #include "magmablas.h"

+#include <math.h>

 

 #define PRECISION_z

@@ -130,6 +131,4 @@

     cuDoubleComplex z__1, z__2;

 

-    double sqrt(double);

-

     static magma_int_t i__, k, ihi;

     static double scl;

@@ -141,10 +140,10 @@

     static double anrm;

     static magma_int_t ierr, itau, iwrk, nout;

-    extern int

-      zscal_(magma_int_t *, cuDoubleComplex *, cuDoubleComplex *, magma_int_t *),

-      dlabad_(double *, double *);

+    extern void zscal_(const magma_int_t*,

+   cuDoubleComplex *, cuDoubleComplex *, const magma_int_t *);

+    extern void dlabad_(double *, double *);

     extern double dznrm2_(magma_int_t *, cuDoubleComplex *, magma_int_t *);

     magma_int_t scalea;

-    extern double dlamch_(char *);

+    extern double dlamch_(const char *);

     static double cscale;

     extern int

Index: /src/zgesvd.cpp

===================================================================

--- /src/zgesvd.cpp   (revision 1)

+++ /src/zgesvd.cpp   (revision 2)

@@ -15,4 +15,5 @@

 #include "magma.h"

 #include "magmablas.h"

+#include <math.h>

 

 //#define lapackf77_zgebrd MAGMA_ZGEBRD

@@ -166,5 +167,4 @@

 

     int sp_cat(char *, char **, magma_int_t *, magma_int_t *, magma_int_t);

-    double sqrt(double);

 

     static magma_int_t i__, ie, ir, iu, blk, ncu;

@@ -178,5 +178,5 @@

     static magma_int_t wrkbl, itaup, itauq, mnthr, iwork;

     magma_int_t wntua, wntva, wntun, wntuo, wntvn, wntvo, wntus, wntvs;

-    extern double dlamch_(char *);

+    extern double dlamch_(const char *);

     extern int

       dlascl_(char *, magma_int_t *, magma_int_t *,

@@ -211,6 +211,6 @@

          cuDoubleComplex *, magma_int_t *, magma_int_t *);

     magma_int_t lquery, wntuas, wntvas;

-    extern int zungqr_(magma_int_t *, magma_int_t *, magma_int_t *,

-             cuDoubleComplex *, magma_int_t *, cuDoubleComplex *,

+    extern void zungqr_(magma_int_t *, magma_int_t *, magma_int_t *,

+             cuDoubleComplex *, magma_int_t *, const cuDoubleComplex *,

              cuDoubleComplex *, magma_int_t *, magma_int_t  *);

 

Index: /src/cgesvd.cpp

===================================================================

--- /src/cgesvd.cpp   (revision 1)

+++ /src/cgesvd.cpp   (revision 2)

@@ -15,4 +15,5 @@

 #include "magma.h"

 #include "magmablas.h"

+#include <math.h>

 

 //#define lapackf77_cgebrd MAGMA_CGEBRD

@@ -166,5 +167,4 @@

 

     int sp_cat(char *, char **, magma_int_t *, magma_int_t *, magma_int_t);

-    float sqrt(float);

 

     static magma_int_t i__, ie, ir, iu, blk, ncu;

@@ -178,5 +178,5 @@

     static magma_int_t wrkbl, itaup, itauq, mnthr, iwork;

     magma_int_t wntua, wntva, wntun, wntuo, wntvn, wntvo, wntus, wntvs;

-    extern float slamch_(char *);

+    extern float slamch_(const char *);

     extern int

       dlascl_(char *, magma_int_t *, magma_int_t *,

@@ -211,6 +211,6 @@

          cuFloatComplex *, magma_int_t *, magma_int_t *);

     magma_int_t lquery, wntuas, wntvas;

-    extern int cungqr_(magma_int_t *, magma_int_t *, magma_int_t *,

-             cuFloatComplex *, magma_int_t *, cuFloatComplex *,

+    extern void cungqr_(magma_int_t *, magma_int_t *, magma_int_t *,

+             cuFloatComplex *, magma_int_t *, const cuFloatComplex *,

              cuFloatComplex *, magma_int_t *, magma_int_t  *);

 

Index: /src/sgesvd.cpp

===================================================================

--- /src/sgesvd.cpp   (revision 1)

+++ /src/sgesvd.cpp   (revision 2)

@@ -15,4 +15,5 @@

 #include "magma.h"

 #include "magmablas.h"

+#include <math.h>

 

 //#define lapackf77_sgebrd MAGMA_SGEBRD

@@ -166,5 +167,4 @@

 

     int sp_cat(char *, char **, magma_int_t *, magma_int_t *, magma_int_t);

-    float sqrt(float);

 

     static magma_int_t i__, ie, ir, iu, blk, ncu;

@@ -178,5 +178,5 @@

     static magma_int_t wrkbl, itaup, itauq, mnthr, iwork;

     magma_int_t wntua, wntva, wntun, wntuo, wntvn, wntvo, wntus, wntvs;

-    extern float slamch_(char *);

+    extern float slamch_(const char *);

     extern int

       dlascl_(char *, magma_int_t *, magma_int_t *,

@@ -188,5 +188,5 @@

     static float bignum;

     extern int

-      slascl_(char *, magma_int_t *, magma_int_t *, float *,

+      slascl_(char *, magma_int_t *, magma_int_t *, float *,

              float *, magma_int_t *, magma_int_t *,

              float *, magma_int_t *, magma_int_t *),

@@ -211,7 +211,7 @@

          float *, magma_int_t *, magma_int_t *);

     magma_int_t lquery, wntuas, wntvas;

-    extern int sorgqr_(magma_int_t *, magma_int_t *, magma_int_t *,

-             float *, magma_int_t *, float *,

-             float *, magma_int_t *, magma_int_t  *);

+    extern void sorgqr_(magma_int_t *, magma_int_t *, magma_int_t *,

+             float *, magma_int_t *, const float *,

+             float *, magma_int_t *, magma_int_t *);

 

 

Index: /src/magma_dfortran.f90

===================================================================

--- /src/magma_dfortran.f90   (revision 1)

+++ /src/magma_dfortran.f90   (revision 2)

@@ -6,28 +6,66 @@

 !      November 2010

 !

-!   @generated d

+!   -- Modified for MULTIBLAS/COACCEL --

+!      SRCC MSU

+!      January 2011

 !

+     

+  subroutine magma_dgetrf_gpu(m, n, A, lda, ipiv, info)



+  use iso_c_binding



+  interface

 

-module magma_dfortran

+  subroutine magma_dgetrf_gpu_c(m, n, A, lda, ipiv, info)

   

-  implicit none

+  use iso_c_binding

+

+  integer(c_int), value :: m, n, lda

+  type(c_ptr), value :: ipiv

+  integer(c_int), value :: info

+  type(c_ptr), value :: A

+

+  end subroutine magma_dgetrf_gpu_c

   

-  !---- Fortran interfaces to MAGMA subroutines ----

+  end interface



+  integer, intent(in) :: m, n, lda

+  integer, intent(out) :: ipiv(*), info

+  real(C_DOUBLE), dimension(m, n) :: A



+  call magma_dgetrf_gpu_c(m, n, c_loc(A), lda, c_loc(ipiv), info)



+  end subroutine magma_dgetrf_gpu

+

+

+

+  subroutine magma_dgetrs_gpu(trans, n, nrhs, dA, ldda, ipiv, dB, lddb, info)

+

+  use iso_c_binding



   interface

-     

-     subroutine magma_dgetrf_gpu(m, n, A, lda, ipiv, info)

-       integer,          intent(in)    :: m, n, lda

-       integer,          intent(out)   :: ipiv(*), info

-       integer(kind=16), intent(inout) :: A

-     end subroutine magma_dgetrf_gpu

-     

-     subroutine magma_dgetrs_gpu(trans, n, nrhs, dA, ldda, ipiv, dB, lddb, info)

-       character,        intent(in)    :: trans

-       integer,          intent(in)    :: n, nrhs, ldda, ipiv(*), lddb

-       integer,          intent(out)   :: info

-       integer(kind=16), intent(in)    :: dA

-       integer(kind=16), intent(inout) :: dB

-     end subroutine magma_dgetrs_gpu

-     

+

+  subroutine magma_dgetrs_gpu_c(trans, n, nrhs, dA, ldda, ipiv, dB, lddb, info)



+  use iso_c_binding

+

+  character(c_char), value :: trans

+  integer(c_int), value :: n, nrhs, ldda, lddb

+  type(c_ptr), value :: ipiv

+  integer(c_int), value :: info

+  type(c_ptr), value :: dA, dB

+

+  end subroutine magma_dgetrs_gpu_c

+

   end interface

-end module magma_dfortran

+

+  character, intent(in) :: trans

+  integer, intent(in) :: n, nrhs, ldda, ipiv(*), lddb

+  integer, intent(out) :: info

+  real(C_DOUBLE), intent(in) :: dA

+  real(C_DOUBLE), intent(inout) :: dB



+  call magma_dgetrs_gpu_c(trans, n, nrhs, c_loc(dA), ldda, c_loc(ipiv), c_loc(dB), lddb, info)



+  end subroutine magma_dgetrs_gpu

+

Index: /src/dgesvd.cpp

===================================================================

--- /src/dgesvd.cpp   (revision 1)

+++ /src/dgesvd.cpp   (revision 2)

@@ -15,4 +15,5 @@

 #include "magma.h"

 #include "magmablas.h"

+#include <math.h>

 

 //#define lapackf77_dgebrd MAGMA_DGEBRD

@@ -166,5 +167,4 @@

 

     int sp_cat(char *, char **, magma_int_t *, magma_int_t *, magma_int_t);

-    double sqrt(double);

 

     static magma_int_t i__, ie, ir, iu, blk, ncu;

@@ -178,5 +178,5 @@

     static magma_int_t wrkbl, itaup, itauq, mnthr, iwork;

     magma_int_t wntua, wntva, wntun, wntuo, wntvn, wntvo, wntus, wntvs;

-    extern double dlamch_(char *);

+    extern double dlamch_(const char *);

     extern int

       dlascl_(char *, magma_int_t *, magma_int_t *,

@@ -211,6 +211,6 @@

          double *, magma_int_t *, magma_int_t *);

     magma_int_t lquery, wntuas, wntvas;

-    extern int dorgqr_(magma_int_t *, magma_int_t *, magma_int_t *,

-             double *, magma_int_t *, double *,

+    extern void dorgqr_(magma_int_t *, magma_int_t *, magma_int_t *,

+             double *, magma_int_t *, const double *,

              double *, magma_int_t *, magma_int_t  *);

 

Index: /src/dsyevd.cpp

===================================================================

--- /src/dsyevd.cpp   (revision 1)

+++ /src/dsyevd.cpp   (revision 2)

@@ -15,4 +15,5 @@

 #include "magma.h"

 #include "magmablas.h"

+#include <math.h>

 

 extern "C" magma_int_t

@@ -154,6 +155,4 @@

     double d__1;

 

-    double sqrt(double);

-

     static double eps;

     static magma_int_t inde;

@@ -162,6 +161,6 @@

     static double rmin, rmax;

     static magma_int_t lopt;

-    extern int dscal_(magma_int_t *, double *, double *,

-       magma_int_t *);

+    extern void dscal_(const magma_int_t *, double *, double *,

+       const magma_int_t *);

     static double sigma;

     static magma_int_t iinfo, lwmin, liopt;

@@ -170,5 +169,5 @@

     static magma_int_t wantz;

     static magma_int_t indwk2, llwrk2;

-    extern double dlamch_(char *);

+    extern double dlamch_(const char *);

     static magma_int_t iscale;

     static double safmin;

Index: /Makefile

===================================================================

--- /Makefile   (revision 1)

+++ /Makefile   (revision 2)

@@ -68,2 +68,6 @@

        > $(prefix)/lib/pkgconfig/magma.pc

 

+NAME = magma

+

+snap:

+   tar -cvzf ../$(NAME)_`date +%y%m%d%H%M%S`.tar.gz ../$(NAME)

Index: /testing/Makefile

===================================================================

--- /testing/Makefile   (revision 1)

+++ /testing/Makefile   (revision 2)

@@ -54,8 +54,8 @@

 endif

 

-ZSRC += $(ZSRCF)

-CSRC = testing_cgemm.cpp testing_chemv.cpp testing_cgemv.cpp testing_csymv.cpp testing_cpotrf.cpp testing_cgetrf.cpp testing_cgeqrf.cpp testing_cgeqlf.cpp testing_cgelqf.cpp testing_cpotrf_gpu.cpp testing_cgetrf_gpu.cpp testing_cgesv_gpu.cpp testing_cgeqrf_gpu.cpp testing_cgeqrs_gpu.cpp testing_cungqr_gpu.cpp testing_cgebrd.cpp testing_cgetrf_gpu_f.f

-DSRC = testing_dgemm.cpp testing_dsymv.cpp testing_dgemv.cpp testing_dpotrf.cpp testing_dgetrf.cpp testing_dgeqrf.cpp testing_dgeqlf.cpp testing_dgelqf.cpp testing_dpotrf_gpu.cpp testing_dgetrf_gpu.cpp testing_dgesv_gpu.cpp testing_dgeqrf_gpu.cpp testing_dgeqrs_gpu.cpp testing_dorgqr_gpu.cpp testing_dgebrd.cpp testing_dsposv_gpu.cpp testing_dsgesv_gpu.cpp testing_dsgeqrsv_gpu.cpp testing_dgetrf_gpu_f.f

-SSRC = testing_sgemm.cpp testing_ssymv.cpp testing_sgemv.cpp testing_spotrf.cpp testing_sgetrf.cpp testing_sgeqrf.cpp testing_sgeqlf.cpp testing_sgelqf.cpp testing_spotrf_gpu.cpp testing_sgetrf_gpu.cpp testing_sgesv_gpu.cpp testing_sgeqrf_gpu.cpp testing_sgeqrs_gpu.cpp testing_sorgqr_gpu.cpp testing_sgebrd.cpp testing_sgetrf_gpu_f.f

+# ZSRC += $(ZSRCF)

+CSRC = testing_cgemm.cpp testing_chemv.cpp testing_cgemv.cpp testing_csymv.cpp testing_cpotrf.cpp testing_cgetrf.cpp testing_cgeqrf.cpp testing_cgeqlf.cpp testing_cgelqf.cpp testing_cpotrf_gpu.cpp testing_cgetrf_gpu.cpp testing_cgesv_gpu.cpp testing_cgeqrf_gpu.cpp testing_cgeqrs_gpu.cpp testing_cungqr_gpu.cpp testing_cgebrd.cpp # testing_cgetrf_gpu_f.f

+DSRC = testing_dgemm.cpp testing_dsymv.cpp testing_dgemv.cpp testing_dpotrf.cpp testing_dgetrf.cpp testing_dgeqrf.cpp testing_dgeqlf.cpp testing_dgelqf.cpp testing_dpotrf_gpu.cpp testing_dgetrf_gpu.cpp testing_dgesv_gpu.cpp testing_dgeqrf_gpu.cpp testing_dgeqrs_gpu.cpp testing_dorgqr_gpu.cpp testing_dgebrd.cpp testing_dsposv_gpu.cpp testing_dsgesv_gpu.cpp testing_dsgeqrsv_gpu.cpp # testing_dgetrf_gpu_f.f

+SSRC = testing_sgemm.cpp testing_ssymv.cpp testing_sgemv.cpp testing_spotrf.cpp testing_sgetrf.cpp testing_sgeqrf.cpp testing_sgeqlf.cpp testing_sgelqf.cpp testing_spotrf_gpu.cpp testing_sgetrf_gpu.cpp testing_sgesv_gpu.cpp testing_sgeqrf_gpu.cpp testing_sgeqrs_gpu.cpp testing_sorgqr_gpu.cpp testing_sgebrd.cpp # testing_sgetrf_gpu_f.f

 

 ALLSRC  = $(ZSRC) $(CSRC) $(DSRC) $(SSRC)

@@ -101,8 +101,8 @@

 # These two files are provided by cuda

 #

-fortran.o : $(CUDADIR)/src/fortran.c

+fortran.o : $(wildcard $(CUDAROOT)/src/fortran.c)

    $(CC) $(OPTS) $(INC) -c $< -o $@

 

-fortran_thunking.o : $(CUDADIR)/src/fortran_thunking.c

+fortran_thunking.o : $(wildcard $(CUDAROOT)/src/fortran_thunking.c)

    $(CC) $(OPTS) $(INC) -c $< -o $@



Code: Select all
#//////////////////////////////////////////////////////////////////////////////
#   -- MAGMA (version 1.0) --
#      Univ. of Tennessee, Knoxville
#      Univ. of California, Berkeley
#      Univ. of   Colorado, Denver
#      November 2010
#//////////////////////////////////////////////////////////////////////////////

#
# GPU_TARGET specifies for which GPU you want to compile MAGMA
#      0: Tesla family
#      1: Fermi Family
#
GPU_TARGET = 1

CC        = icc
NVCC      = nvcc
FORT      = ifort

ARCH      = ar
ARCHFLAGS = cr
RANLIB    = ranlib

OPTS      = -O3 -DADD_
NVOPTS    = --compiler-options -fno-strict-aliasing -DUNIX -O3 -DADD_
LDOPTS    = -fPIC -nofor_main -Xlinker -zmuldefs

CUDAROOT  = /usr/local/cuda /opt/cuda
MKLROOT   = /opt/intel/Compiler/11.1/072/mkl/lib

CUDALIBS  = $(addprefix -L, $(addsuffix /lib64, $(CUDAROOT))) -lcublas
MKLLIBS   = $(addprefix -L, $(addsuffix /em64t, $(MKLROOT))) \
   -Wl,--start-group -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -Wl,--end-group \
   -lguide -lifcore -lpthread -limf -lsvml -lintlc

LIB       = $(CUDALIBS) $(MKLLIBS)
INC       = $(addprefix -I, $(addsuffix /include, $(CUDAROOT)))

LIBMAGMA     = ../lib/libmagma.a
LIBMAGMABLAS = ../lib/libmagmablas.a
mmarc
 
Posts: 2
Joined: Mon Jan 31, 2011 7:53 am

Next

Return to User discussion

Who is online

Users browsing this forum: No registered users and 2 guests