Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
43 Views

Mkl geqrf+Cublas

Jump to solution
Hi,

I would like to implement the QR factorization for big matrix size.
When I use sgeqrf and larft functions alone (just compiled with icc), there is no problem.

If I want to use some Cublas function like sgemm, I have to compile with nvcc.
The problem is, when I compile, I have this error :

error : argument of type "int *" is incompatible with parameter of type "const long long *", at line of calling geqrf and larft functions, whereas these functions require int* ...

I've replaced the geqrf function from Mkl by the geqrf function of Cula.

It works, but the problem persist with the larft function ...

Here is my makefile :

CC=nvcc
CFLAG=-O3
LIBS=-lcuda -lcudart -lcula -lcublas -m64 -DMKL_ILP64
INCLUDE_CULA=/usr/local/cula//include
LIB_CULA=/usr/local/cula//lib64
INCLUDE_MKL=/opt/intel/mkl/include

build 64:
$(CC) $(CFLAG) -DReal=float qrBlocT2.cu $(LIBS) -I$(INCLUDE_CULA) -L$(LIB_CULA) -I$(INCLUDE_MKL) --linker-options /opt/intel/mkl/lib/intel64/libmkl_intel_lp64.a,/opt/intel/mkl/lib/intel64/libmkl_sequential.a,/opt/intel/mkl/lib/intel64/libmkl_core.a,-lpthread -o qrBlocTGPU

Has someone have any ideas ?

Thank you.
0 Kudos

Accepted Solutions
Highlighted
43 Views
Hi,

It seems you should NOT specify-DMKL_ILP64 macros within your compiler options.

MKL_ILP64 macros indicates that you want to use ILP64 mode (that means MKL_INT type used in all MKL interfaces would be "long long int" instead of "int"). Please try just to remove it.

P.S. If you want the program works with -DMKL_ILP64 you must do as follows:
1)Link with libmkl_intel_ilp64.a instead libmkl_intel_lp64.a
2) Make sure all your integer parameters passed to MKL are of "long long int" type where it'srequired by the interface.

Regards,
Konstantin

View solution in original post

0 Kudos
4 Replies
Highlighted
44 Views
Hi,

It seems you should NOT specify-DMKL_ILP64 macros within your compiler options.

MKL_ILP64 macros indicates that you want to use ILP64 mode (that means MKL_INT type used in all MKL interfaces would be "long long int" instead of "int"). Please try just to remove it.

P.S. If you want the program works with -DMKL_ILP64 you must do as follows:
1)Link with libmkl_intel_ilp64.a instead libmkl_intel_lp64.a
2) Make sure all your integer parameters passed to MKL are of "long long int" type where it'srequired by the interface.

Regards,
Konstantin

View solution in original post

0 Kudos
Highlighted
Beginner
43 Views
Using CULA is very straightforward. I have used CULA with MKL with minimal changes. The only difference between CULA and MKL is that you need to pass the values to CULA, instead of pointer. I have not used geqrf, but there shouldn't be big differences. For example, the code below works OK for me:

MKL version

[bash]dgetrf(&nCells, &nCells, MKLinvP, &nCells, ipiv, &info);
[/bash]

CULA version

[bash]culaDgetrf(nCells, nCells, MKLinvP, nCells, ipiv);
[/bash]

D.
0 Kudos
Highlighted
Beginner
43 Views
Thank you Konstantin, the code works now !
I've just removed -DMKL_ILP64.

Thank you Dan. I know that Cula is staightforward. I use the geqrf function from CULA, but CULA haven't an equivalent for larft function from Mkl ... ( construction of T for the YTY' representation )

Thank you!
0 Kudos
Highlighted
Beginner
43 Views
I've another problem.

When I use only Mkl's functions, the larft function take 3508 ms.
In my code with Mkl', Cula' and Cublas' functions, (compil with the Makefile I've shown, with nvcc), the larft function (Mkl) take 7845 ms !!!

Do you have any idea ? How it's possible ?

Thanks.
0 Kudos