Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
7074 Discussions

MKL problems running vslzCorrExec1D, cross correlation.

Serjio
New Contributor I
1,395 Views

I can't run vslzCorrExec1D because I get status=-2303 or -2302.

Here is my code:

 

 

    // Creating input and output vetcors
    std::vector<std::complex<double>> x, y, z;
    x.resize(5);
    y.resize(5);
    z.resize(2*std::max(x.size(),y.size()) - 1);

    // Starting MKL cross correlation 
    VSLCorrTaskPtr task;
    int status = 0;
    int iy0 = y.size() - 1;
    status = vslzCorrNewTask1D(&task, VSL_CORR_MODE_AUTO, y.size(), x.size(), z.size());
    status = vslCorrSetStart(task,&iy0);
    status = vslzCorrExec1D(task, (MKL_Complex16*)y.data(), xyz_indx, (MKL_Complex16*)x.data(), xyz_indx, (MKL_Complex16*)z.data(), xyz_indx);

 

 

Where are errors?

 

 

 

0 Kudos
1 Solution
VidyalathaB_Intel
Moderator
1,360 Views

Hi,

 

Thanks for reaching out to us.

 

>>Where are errors?

 

Could you please try changing the below line as follows?

 

int iy0 = y.size() - 1;

 

to

int iy0 = -(y.size() - 1);

 

Please refer to the below link for details about the start parameter while using the vslCorrSetStart routine.

https://www.intel.com/content/www/us/en/develop/documentation/onemkl-developer-reference-c/top/statistical-functions/convolution-and-correlation/convolution-and-correlation-task-editors/vslconvsetstart-vslcorrsetstart.html#vslconvsetstart-vslcorrsetstart

 

Please try running your code with the above changes and do let us know if it resolves your issue. If not, please provide us a complete reproducer with oneMKL version and your OS details so that we can work on it from our end.

 

Regards,

Vidya.

 

View solution in original post

0 Kudos
3 Replies
VidyalathaB_Intel
Moderator
1,361 Views

Hi,

 

Thanks for reaching out to us.

 

>>Where are errors?

 

Could you please try changing the below line as follows?

 

int iy0 = y.size() - 1;

 

to

int iy0 = -(y.size() - 1);

 

Please refer to the below link for details about the start parameter while using the vslCorrSetStart routine.

https://www.intel.com/content/www/us/en/develop/documentation/onemkl-developer-reference-c/top/statistical-functions/convolution-and-correlation/convolution-and-correlation-task-editors/vslconvsetstart-vslcorrsetstart.html#vslconvsetstart-vslcorrsetstart

 

Please try running your code with the above changes and do let us know if it resolves your issue. If not, please provide us a complete reproducer with oneMKL version and your OS details so that we can work on it from our end.

 

Regards,

Vidya.

 

0 Kudos
Serjio
New Contributor I
1,356 Views

dear Vidya, after your suggestion my code works without any errors

 

int iy0 = -(y.size() - 1); // it works

 

Thank you.

0 Kudos
VidyalathaB_Intel
Moderator
1,351 Views

Hi,


Thanks for accepting our solution.

As your issue is resolved we are closing this thread.

If you need any additional assistance from Intel please post a new question as this thread will no longer be monitored.


Have a Nice Day!


Regards,

Vidya.


0 Kudos
Reply