- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm having a issue where cblas_sgemm wont execute on all cores when it's called from a .Net application. The following code executes on all cores when invoked from native code (Win32 - Console application):
const int M = m;
const int N = n;
const int K = k;
const float alpha = 1;
const float beta = 1;
const int lda = K;//K;//M;//K;//M;
const int ldb = N;//N;//K;//M;//N;
const int ldc = N;//M;//K;//M;
const CBLAS_ORDER rowOrder = CblasRowMajor;
const CBLAS_TRANSPOSE alphaTrans = CblasNoTrans;
const CBLAS_TRANSPOSE betaTrans = CblasNoTrans;
cblas_sgemm(rowOrder,
alphaTrans,
betaTrans,
(MKL_INT)M,
(MKL_INT)N,
(MKL_INT)K,
alpha,
a,
(MKL_INT)lda,
b,
(MKL_INT)ldb,
beta,
c,
(MKL_INT)ldc);
But the code is called from .Net, where the code has been put into a DLL which the .Net code uses, the computation is done but only on a single thread. I'm having the same issue when other native code which uses OpenMP. I suspect there's something fishy with the managed code since the multithreading using OpenMP has worked before, it's like it has stopped working for some reason. Any ideas or input would be appreciated.
I'm using Visual Studio 2008 and MKL: 10.1
const int M = m;
const int N = n;
const int K = k;
const float alpha = 1;
const float beta = 1;
const int lda = K;//K;//M;//K;//M;
const int ldb = N;//N;//K;//M;//N;
const int ldc = N;//M;//K;//M;
const CBLAS_ORDER rowOrder = CblasRowMajor;
const CBLAS_TRANSPOSE alphaTrans = CblasNoTrans;
const CBLAS_TRANSPOSE betaTrans = CblasNoTrans;
cblas_sgemm(rowOrder,
alphaTrans,
betaTrans,
(MKL_INT)M,
(MKL_INT)N,
(MKL_INT)K,
alpha,
a,
(MKL_INT)lda,
b,
(MKL_INT)ldb,
beta,
c,
(MKL_INT)ldc);
But the code is called from .Net, where the code has been put into a DLL which the .Net code uses, the computation is done but only on a single thread. I'm having the same issue when other native code which uses OpenMP. I suspect there's something fishy with the managed code since the multithreading using OpenMP has worked before, it's like it has stopped working for some reason. Any ideas or input would be appreciated.
I'm using Visual Studio 2008 and MKL: 10.1
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - sugarpie
But the code is called from .Net, where the code has been put into a DLL which the .Net code uses, the computation is done but only on a single thread. I'm having the same issue when other native code which uses OpenMP.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Could you please provide some more details?
What means "...worked before"?
How do you declare and call cblas_sgemm from managed code?
And how do you build the native dll?
Thanks,
-Vladimir

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page