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

2D Convolution methode

KIM__ILTAEK
Beginner
2,150 Views

Hi, 

 

Matlab supports three methods when using conv2. As you can see from the reference site below, Full, Same, and Valid methods are supported.

https://johnloomis.org/ece563/notes/filter/conv/convolution.html

Is it possible to add an option like this using vsldConvExec? Or if there is any other way, please advise.

0 Kudos
1 Solution
Gennady_F_Intel
Moderator
2,150 Views

here is what I see on my part.

Math kernel Lib Runtime : 1.859sec
Naive Algorithm Runtime : 1.157sec
Press any key to continue . . .

Yes, the naive implementation is faster then what mkl suggested. You may submit the request to the intel online service center or as I already suggested you - check the IPP library. The Conv/Corr functionality from IPP is very much optimized.

 

View solution in original post

0 Kudos
6 Replies
Gennady_F_Intel
Moderator
2,150 Views

I see two options: #1. You could try to submit the Feature Request against Intel MKL to add these options and #2 - Try to take Intel IPP which already supported all of the modes you are looking for. Please refer to the IPP Developer Reference follow this link:https://software.intel.com/en-us/ipp-dev-reference-conv

0 Kudos
KIM__ILTAEK
Beginner
2,150 Views

Thank for your reply. 

First, we implemented convolution by full method and crop by input size.

However, it is slower than the navie algorithm. I am developing on windows 10 with i7-5960X.

Below is my test code result. Please advise if I have something wrong. Code is attached. Please review.

 

Math kernel lib runtime : 1.282sec

Naive Algorithm runtime : 0.234sec

 

 

 

0 Kudos
Gennady_F_Intel
Moderator
2,150 Views

At first glance, everything is correct with the mkl part but I didn't try to build the case. Is it requires to build from VS as I see the test included only stdafx.h? 

0 Kudos
KIM__ILTAEK
Beginner
2,150 Views

The project file was compressed and uploaded. The development environment is using visual studio 2015.
Please review together. 

0 Kudos
Gennady_F_Intel
Moderator
2,151 Views

here is what I see on my part.

Math kernel Lib Runtime : 1.859sec
Naive Algorithm Runtime : 1.157sec
Press any key to continue . . .

Yes, the naive implementation is faster then what mkl suggested. You may submit the request to the intel online service center or as I already suggested you - check the IPP library. The Conv/Corr functionality from IPP is very much optimized.

 

0 Kudos
KIM__ILTAEK
Beginner
2,150 Views

Thank you for your confirm. 

I will check it again using IPP.

0 Kudos
Reply