- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to run the code below.
#include <vector>
#include <iostream>
#include <mkl_lapack.h>
#include <mkl.h>
int main() {
MKL_INT n = 10000;
std::vector<float> A(n * n);
std::vector<float> eigenvalues(n);
std::vector<float> work;
std::vector<MKL_INT> iwork;
for (MKL_INT i = 0; i < n*n; ++i) {
A[i] = rand() % 100;
}
char jobz = 'V';
char uplo = 'U';
MKL_INT lda = n;
MKL_INT info;
float lwork_query = 0.0f;
MKL_INT liwork_query = 0;
MKL_INT neg_one = -1;
ssyevd_(&jobz, &uplo, &n, A.data(), &lda, eigenvalues.data(),
&lwork_query, &neg_one, &liwork_query, &neg_one, &info);
MKL_INT lwork_actual = static_cast<MKL_INT>(lwork_query);
MKL_INT liwork_actual = liwork_query;
work.assign(lwork_actual, 0.0f);
iwork.assign(liwork_actual, 0);
ssyevd_(&jobz, &uplo, &n, A.data(), &lda, eigenvalues.data(),
work.data(), &lwork_actual, iwork.data(), &liwork_actual, &info);
if (info == 0) {
std::cout << "SSYEVD successful. First eigenvalue: " << eigenvalues[0] << std::endl;
} else {
std::cerr << "SSYEVD failed with info: " << info << std::endl;
}
return 0;
}
The program compiles correctly with icpx (I'm using version 2024.2.0.20240602), but when I try to run it I get the error:
Intel oneMKL ERROR: Parameter 8 was incorrect on entry to SSYEVD.
SSYEVD failed with info: -8
The code runs without errors if I reduce n (to 2500 or below), if I change jobz to 'N', or if I replace ssyevd_ with ssyev_.
Any suggestions that could help me debug this issue would be much appreciated!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for posting this issue!
It looks the size of the working array is not big enough. The return value for lwork is 200060000 which is smaller than the minimum value needed, 2*n2+6*n +1=200060001. It is a regression. I will report it as a bug.
Thanks,
Fengrui
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for posting this issue!
It looks the size of the working array is not big enough. The return value for lwork is 200060000 which is smaller than the minimum value needed, 2*n2+6*n +1=200060001. It is a regression. I will report it as a bug.
Thanks,
Fengrui
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Fengrui – thanks a lot for debugging this program.
This is to confirm that the code above works if I change line 29 to:
MKL_INT lwork_actual = static_cast<MKL_INT>(lwork_query) + 1;
Hopefully this will be fixed in a future release of MKL, but this workaround works well for now.

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