- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I try to compute the mean of an array by the summary statistics function, I am following the link
https://software.intel.com/en-us/articles/overview-of-summary-statistics-ss-in-intel-mkl-v103
However. after I compile it and run it, then it will have Segmentation fault (core dumped) error.
Here is my code:
int N = 4;
VSLSSTaskPtr task; /* SS task descriptor */
double x
double mean; /* Array for mean estimate */
double* w = 0; /* Null pointer to array of weights, default weight equal to one will be used in the computation */
MKL_INT p, n, xstorage;
int status;
x[0] = 0.1;
x[1] = 0.2;
x[2] = 0.3;
x[3] = 0.4;
/* Initialize variables used in the computation of mean */
p = 1;
n = N;
xstorage = VSL_SS_MATRIX_STORAGE_ROWS;
mean = 0.0;
/* Step 1 - Create task */
status = vsldSSNewTask( &task, &p, &n, &xstorage, x, w, 0 );
/* Step 2- Initialize task parameters */
status = vsldSSEditTask( task, VSL_SS_ED_MEAN, &mean );
/* Step 3 - Compute the mean estimate using SS one-pass method */
status = vsldSSCompute(task, VSL_SS_MEAN, VSL_SS_METHOD_1PASS );
/* Step 4 - deallocate task resources */
status = vslSSDeleteTask( &task );
Almost the same as the example in the link. I don't know what is the problem, is it because i misunderstand the function?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When I use the example to check the error information, then I have
VSL_SS_ERROR_STORAGE_NOT_SUPPORTED.
I changed the format based on the reference, actually, there are only two kinds of storage format and neither of them does work. Could any one help me solve it? thanks before hand.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Jun,
Can you please clarify the version of Intel MKL and cpu you use in your experiments? Also, additional details on type of linkage and the version, 32- or 64 bit of the library would be helpful.
Thanks,
Andrey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Andrey N. (Intel) wrote:
Hi Jun,
Can you please clarify the version of Intel MKL and cpu you use in your experiments? Also, additional details on type of linkage and the version, 32- or 64 bit of the library would be helpful.
Thanks,
Andrey
Hi, Andrey,
Thanks for your reply, I figured out the problem that I miss some parts in the makefile of my code. After fixed it, it works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For folks who may see the same issue. You need to add the following to the compile line:
-DMKL_ILP64 -m64
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page