PhoenixHPCProxy  0.8.0
Lightweight HPC proxy
Loading...
Searching...
No Matches
hadamard_product.cpp
Go to the documentation of this file.
1/***************************************
2 Auteur : Pierre Aubert
3 Mail : pierre.aubert@lapp.in2p3.fr
4 Licence : CeCILL-C
5****************************************/
6
7
8#include "hadamard_product.h"
9
10
12
17void hadamard_product(float* __restrict__ ptabResult, const float* __restrict__ ptabX, const float* __restrict__ ptabY, long unsigned int nbElement){
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}
26
27
void hadamard_product(float *__restrict__ ptabResult, const float *__restrict__ ptabX, const float *__restrict__ ptabY, long unsigned int nbElement)
Do the Hadamard product.