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

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

*=i*i;*

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

y

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

y

*= 1;*

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

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

1 Solution

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

// 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

Link Copied

3 Replies

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

Pleaserefer the VSL convolution examples provided in the

--Vipin

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

// 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

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

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

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