- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am trying to use gather function in the follow code on MIC. When I ran it, it said "Segmentation fault". Can someone tell me how to fix it?
Thanks,
#include <stdlib.h>
#include <math.h>
#include <stdio.h>
#include <time.h>
#include <immintrin.h>
#define N 32
int main(){
double a
for(int i = 0; i < N; i++)
{
a = 1.0*i;
b = 2.0*i;
c = -1.0;
}
int index
for(int i = 0; i < N; i++) index = i;
__m512i __cdecl vindex = _mm512_load_epi32(index);
__m512d __cdecl va = _mm512_i32logather_pd(vindex, a, 1);
_mm512_store_pd(c, va);
for(int i = 0; i < N; i++) printf(" --- %f \n", c);
return 0;
}
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I thought perhaps this was just a case of non-alignment and needing:
__attribute__ ( (aligned(64) )) double a
__attribute__ ( (aligned(64) )) int index
But there seems to be more. I'm checking with our intrinsic expert about this now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, Kevin. I seemed misunderstand the parameter "scale in _mm512_i32logather_pd. It should be set as "8" (not "1"), which seems mean byte position in memory.
In addtiton, do you know where I can find the code mentioned in https://software.intel.com/en-us/articles/the-intel-math-kernel-library-sparse-matrix-vector-multiply-format-prototype-package?
Dahai
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In addition to using correct alignment, the scale parameter in the gather intrinsic is incorrect. Since it gathers double elements it should be 8 instead of 1.
When I make both changes the test case runs correctly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Glad you were able to sort out the scale parameter.
The article says to email intel.mkl@intel.com to download the Intel MKL SpMV Format Prototype Package if that is the code you are interested in. If it is not then let me know and I can ping the MKL team for what you are interested in.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I sent them an email to them about it several days ago. But no response ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, I'm sorry about that. I will get their attention promptly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
sent the package to customer's email address
Thanks,
Sridevi
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page