PhoenixHPCProxy  0.8.0
Lightweight HPC proxy
Loading...
Searching...
No Matches
hadamard_product.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void hadamard_product (float *__restrict__ ptabResult, const float *__restrict__ ptabX, const float *__restrict__ ptabY, long unsigned int nbElement)
 Do the Hadamard product.
 

Function Documentation

◆ hadamard_product()

void hadamard_product ( float *__restrict__ ptabResult,
const float *__restrict__ ptabX,
const float *__restrict__ ptabY,
long unsigned int nbElement )

Do the Hadamard product.

Parameters
[out]ptabResult: table of results of tabX*tabY
ptabX: input table
ptabY: input table
nbElement: number of elements in the tables

Definition at line 17 of file hadamard_product.cpp.

17 {
18 const float* tabX = (const float*)__builtin_assume_aligned(ptabX, FLOAT_VECTOR_ALIGNEMENT);
19 const float* tabY = (const float*)__builtin_assume_aligned(ptabY, FLOAT_VECTOR_ALIGNEMENT);
20 float* tabResult = (float*)__builtin_assume_aligned(ptabResult, FLOAT_VECTOR_ALIGNEMENT);
21
22 for(long unsigned int i(0lu); i < nbElement; ++i){
23 tabResult[i] = tabX[i]*tabY[i];
24 }
25}