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

Element-wise vector-vector multiplication (MKL or IPP)

hyouklee
Beginner
1,234 Views
Hi.

I'm looking for a function in MKL or IPP or other related libraries
that does element-wise multiplication on two vectors.

[a1, a2, a3, ...] * [b1, b2, b3, ...] = [(a1*b1), (a2*b2), (a3*b3), ...]

The elements will be floating point numbers (doubles or floats).

I searched the MKL and IPP documentations,
but could not find the function that does this operations.
Is there a function for this?
Thanks.

HyoukJoong.
0 Kudos
2 Replies
Shane_S_Intel
Employee
1,234 Views

Intel MKL contains these functions which should correspond to what you want to do - see the MKL reference manual Vector Math Library section.

Fortran:

call vsmul( n, a, b, y )

call vdmul( n, a, b, y )

call vcmul( n, a, b, y )

call vzmul( n, a, b, y )

C:

vsMul( n, a, b, y );

vdMul( n, a, b, y );

vcMul( n, a, b, y );

vzMul( n, a, b, y );

0 Kudos
Gennady_F_Intel
Moderator
1,233 Views
HyoukJoong,

Intel IPP offers the same functionality but only with C API.

IPP offers not-in place and in-place operations for floating and integer data with and without scaling.

See the details into the IPP Reference Manual, Signal Processing,

Arithmatic Functions section.

The examples of APIimmediately below shows the not-in-place operations on floating point data:

IppStatus ippsMul_64f(const Ipp64f* pSrc1, const Ipp64f* pSrc2, Ipp64f* pDst, int len);

IppStatus ippsMul_32fc(const Ipp32fc* pSrc1, const Ipp32fc* pSrc2, Ipp32fc* pDst, int len);

--Gennady

0 Kudos
Reply