- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
"
#include "stdafx.h"
#include "mkl_blas.h"
#include "mkl_cblas.h"
#include "mkl_types.h"
int _tmain(int argc, char *argv[])
{
MKL_INT m = 2, n = 4, k = 3;
MKL_INT lda = k, ldb = n, ldc = n;
float alpha = 1, beta = 1;
float *a = new float[6], *b = new float[12], *c = new float[8];
CBLAS_ORDER order = CblasRowMajor;
CBLAS_TRANSPOSE transA = CblasNoTrans, transB = CblasNoTrans;
a[0] = 1;
a[1] = 2;
a[2] = 3;
a[3] = 4;
a[4] = 5;
a[5] = 6;
b[0] = 0;
b[1] = 1;
b[2] = 0;
b[3] = 1;
b[4] = 1;
b[5] = 0;
b[6] = 0;
b[7] = 1;
b[8] = 1;
b[9] = 0;
b[10] = 1;
b[11] = 0;
c[0] = 0;
c[1] = 0;
c[2] = 0;
c[3] = 0;
c[4] = 0;
c[5] = 0;
c[6] = 0;
c[7] = 0;
printf("\n C B L A S _ S G E M M EXAMPLE PROGRAM\n");
printf("\n INPUT DATA");
printf("\n M=%d N=%d K=%d", m, n, k);
printf("\n ALPHA=%5.1f BETA=%5.1f", alpha, beta);
/* Call SGEMM subroutine ( C Interface ) */
cblas_sgemm(order, transA, transB, m, n, k, alpha,
a, lda, b, ldb, beta, c, ldc);
/* Print output data */
printf("\n\n OUTPUT DATA");
return 0;
}
"
I receive the following output:
C B L A S _ S G E M M EXAMPLE PROGRAM
INPUT DATA
M=2 N=4 K=3
ALPHA= 1.0 BETA= 1.0MKL ERROR: Parameter 5 was incorrect on entry to c
blas_sgemm
OUTPUT DATA
I've tried to change the parameters value, but as far as I can see,there is no problem with parameter 5 (N), or is there?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, I used the same MKL's version, but MSVC 2005.
Please open the project property pages and modify: LinkerInputAdditional Dependencies: "mkl_intel_c.lib mkl_intel_thread.lib mkl_core.lib libiomp5md.lib"
--Gennady
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
But I was not able to reproduce the problem you reported.
Below the output I ve got:
C B L A S _ S G E M M EXAMPLE PROGRAM
INPUT DATA
M=2 N=4 K=3
ALPHA= 1.0 BETA= 1.0
OUTPUT DATA
Press any key to continue . . .
I used MKL version 10.1
VS2005
Can you provide more details about your environment for reproducing the problem?
-- MKL version
-- linking dependencies
-- MSVC version
Regards,Gennady
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
But I was not able to reproduce the problem you reported.
Below the output I ve got:
C B L A S _ S G E M M EXAMPLE PROGRAM
INPUT DATA
M=2 N=4 K=3
ALPHA= 1.0 BETA= 1.0
OUTPUT DATA
Press any key to continue . . .
I used MKL version 10.1
VS2005
Can you provide more details about your environment for reproducing the problem?
-- MKL version
-- linking dependencies
-- MSVC version
Regards,Gennady
MKL version: 10.1.0.018
Linking dependencies: libguide.lib libguide40.lib libiomp5md.lib libiomp5mt.lib mkl_blacs_ilp64_dll.lib mkl_blacs_intelmpi_ilp64.lib mkl_blacs_intelmpi_lp64.lib mkl_blacs_lp64_dll.lib mkl_blacs_mpich2_ilp64.lib mkl_blacs_mpich2_lp64.lib mkl_blacs_msmpi_ilp64.lib mkl_blacs_msmpi_lp64.lib mkl_cdft.lib mkl_cdft_core.lib mkl_cdft_core_dll.lib mkl_cdft_dll.lib mkl_core.lib mkl_core_dll.lib mkl_dll.lib mkl_em64t.lib mkl_intel_ilp64.lib mkl_intel_ilp64_dll.lib mkl_intel_lp64.lib mkl_intel_lp64_dll.lib mkl_intel_thread.lib mkl_intel_thread_dll.lib mkl_lapack.lib mkl_pgi_thread.lib mkl_pgi_thread_dll.lib mkl_scalapack.lib mkl_scalapack_dll.lib mkl_scalapack_ilp64.lib mkl_scalapack_ilp64_dll.lib mkl_scalapack_lp64.lib mkl_scalapack_lp64_dll.lib mkl_sequential.lib mkl_sequential_dll.lib mkl_solver.lib mkl_solver_ilp64.lib mkl_solver_ilp64_sequential.lib mkl_solver_lp64.lib mkl_solver_lp64_sequential.lib
(I wasnt sure on which to use so I took em all:s)
MSVC: 2008
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, I used the same MKL's version, but MSVC 2005.
Please open the project property pages and modify: LinkerInputAdditional Dependencies: "mkl_intel_c.lib mkl_intel_thread.lib mkl_core.lib libiomp5md.lib"
--Gennady
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, I used the same MKL's version, but MSVC 2005.
Please open the project property pages and modify: LinkerInputAdditional Dependencies: "mkl_intel_c.lib mkl_intel_thread.lib mkl_core.lib libiomp5md.lib"
--Gennady
I used "mkl_em64t.lib libiomp5mt.lib" instead (compiling for x64) which solved the problem. Thanks allot for the help! Do you know the reason why I got that weird error message?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I believe that the reason is your linking dependencies are not correct.
We recommend the following libraries for linking cblas routines:
mkl_intel_lp64.lib mkl_intel_thread.lib mkl_core.lib libiomp5md.lib
[ for more info ( including some examples ) about that, please see userguide manual. ]
Please try to use this linking dependencies and let us know the result.
--Gennady
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I believe that the reason is your linking dependencies are not correct.
We recommend the following libraries for linking cblas routines:
mkl_intel_lp64.lib mkl_intel_thread.lib mkl_core.lib libiomp5md.lib
[ for more info ( including some examples ) about that, please see userguide manual. ]
Please try to use this linking dependencies and let us know the result.
--Gennady
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I believe that the reason is your linking dependencies are not correct.
We recommend the following libraries for linking cblas routines:
mkl_intel_lp64.lib mkl_intel_thread.lib mkl_core.lib libiomp5md.lib
[ for more info ( including some examples ) about that, please see userguide manual. ]
Please try to use this linking dependencies and let us know the result.
--Gennady
BTW: we have to use static library for the cluster, and the original thread of my question are here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page