Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
7234 Discussions

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

hyouklee
Beginner
2,010 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
2,010 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
2,009 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