Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

Element-wise Matrix Multiplication

Bryan
Beginner
1,172 Views

I'm new to IPP and am trying to find the function (if it exists) that supports element-wise matrix multiplication. I've found some matrix operations, but none of them seem to support element-wise operations. Can someone please point me in the right direction?

Thanks!

0 Kudos
6 Replies
SergeyKostrov
Valued Contributor II
1,172 Views
Do you mean [ 2 2 2 ] [ 4 4 4 ] [ 8 8 8 ] [ 2 2 2 ] x [ 4 4 4 ] => [ 8 8 8 ] [ 2 2 2 ] [ 4 4 4 ] [ 8 8 8 ] or you're trying to find out if IPP supports a classic transposed based matrix multiplication?
0 Kudos
SergeyKostrov
Valued Contributor II
1,172 Views
Here is a comment to IDZ developers: Why does the editor remove spaces in posts? It is simply impossible in some cases to format examples.
0 Kudos
Bryan
Beginner
1,172 Views

Good question Sergey, I should have been more explicit.

Using Matlab notation:
[a1,a2 ; a3,a4] .* [b1,b2 ; b3,b4] = [a1*b1,a2*b2 ; a3*b3,a4*b4]

Thanks!

0 Kudos
SergeyKostrov
Valued Contributor II
1,172 Views
Please take a look at a set of DSP functions from ipps.h header file: ... IPPAPI( IppStatus, ippsMul_32fc_A11, (const Ipp32fc a[],const Ipp32fc b[],Ipp32fc r[],Ipp32s n)) IPPAPI( IppStatus, ippsMul_32fc_A21, (const Ipp32fc a[],const Ipp32fc b[],Ipp32fc r[],Ipp32s n)) IPPAPI( IppStatus, ippsMul_32fc_A24, (const Ipp32fc a[],const Ipp32fc b[],Ipp32fc r[],Ipp32s n)) IPPAPI( IppStatus, ippsMul_64fc_A26, (const Ipp64fc a[],const Ipp64fc b[],Ipp64fc r[],Ipp32s n)) IPPAPI( IppStatus, ippsMul_64fc_A50, (const Ipp64fc a[],const Ipp64fc b[],Ipp64fc r[],Ipp32s n)) IPPAPI( IppStatus, ippsMul_64fc_A53, (const Ipp64fc a[],const Ipp64fc b[],Ipp64fc r[],Ipp32s n)) ...
0 Kudos
SergeyKostrov
Valued Contributor II
1,172 Views
In overall, a set of IPP functions ippsMul_xxfc_Axx could be used. This is because both matrices with the same sizes are represented in memory as "vectors" if they are located in contiguous memory blocks. Note 1: In case of array-of-arrays representations of matrices these IPP functions can't be used. However, multiplication could be done as row by row. Note 2: Take a look at IPP Vector Math library. Note 3: You could also look at MKL library and let me know if you're interested in that and I'll point you in a right direction.
0 Kudos
Gennady_F_Intel
Moderator
1,172 Views

two comments on this topic:

1) all -- ipp mxm operations are well optimized for very small matrixes ( <= 6x6)

2) in the case if need to compute larger problems, I would recommend you to look at MKL's implementaion of m x m operations.

 

0 Kudos
Reply