Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

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

csnatarajan

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-09-2011
08:09 PM

50 Views

Is there an example code for 2D or 3D convolution using vsldConvExecX? I am not sure I understand the documentation (Ch. 10 in MKL doc.). It seems like I cannot pass a dynamically allocated 2D array to vsldConvExecX. Is this correct? If so do I just pass a 1D array (with the usual pointer arithmetic to access elements in i,j fashion?)? If so what do the strides and shapes look like?

I have something like this

.........

VSLConvTaskPtr task;

MKL_INT rank,mode,xshape[2],yshape[2],zshape[2];

static double x[sx*sx],y[sy*sy],z[sz*sz];

MKL_INT xstride[2],ystride[2],zstride[2];

int status,i;

xshape[0] = xshape[1] = sx; yshape[0] = yshape[1] = sy; zshape[0] = zshape[1] = sz;

xstride[0] = 1; xstride[1] = sx; ystride[0] = 1; ystride[1] = sy; zstride[0] = 1; zstride[1] = ??

for (i=0; i<(sx*sx); i++)

x

for (i=0; i<(sy*sy); i++)

y

rank = 1;

mode = VSL_CONV_MODE_AUTO;

status = vsldConvNewTask(&task,mode,rank,xshape,yshape,zshape);

...

status = vsldConvExecX(task,y,ystride,z,zstride);

........

I am unsure what zstride[1] will be. Also, I am thinking that sz would be the same size as the input signal, is this ok?

Please let me know if I am messing up the code real bad and what is the correct way to proceed.

Thanks in advance,

C.S.N

Link Copied

Accepted Solutions

Victor_Gladkikh

New Contributor I

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-09-2011
11:53 PM

50 Views

// First of allI recommend set

rank=2; //It's 2D problem

// Also

sz = sx + sy - 1; //sznot equal to sx or sy; szequal or more then sx + sy - 1

zstride[1] = sz;

Best regards

Victor

3 Replies

VipinKumar_E_Intel

Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-09-2011
08:14 PM

50 Views

Pleaserefer the VSL convolution examples provided in the

--Vipin

Victor_Gladkikh

New Contributor I

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-09-2011
11:53 PM

51 Views

// First of allI recommend set

rank=2; //It's 2D problem

// Also

sz = sx + sy - 1; //sznot equal to sx or sy; szequal or more then sx + sy - 1

zstride[1] = sz;

Best regards

Victor

csnatarajan

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-10-2011
06:04 AM

50 Views

thanks for the response.

Vipin, there are no multidimensional example provided! In fact vslConvExecX is used on a 1d array!

Victor, sorry for the spasm! Of course it should be (sx-1) + (sy-1) + 1 and yes thanks for pointing out the rank = 2 and zstride. I changed them as suggested. The last few pages on the doc I didn't read too thoroughly were very useful! Also had to change to vsldConvNewTaskX from vsldConvNewTask!!

Best,

C.S.N

For more complete information about compiler optimizations, see our Optimization Notice.