Directory: | ./ |
---|---|
File: | TESTS/TEST_PROXY_LIB/HadamardProduct/hadamard_product.cpp |
Date: | 2025-03-14 12:14:21 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 7 | 7 | 100.0% |
Branches: | 2 | 2 | 100.0% |
Line | Branch | Exec | Source |
---|---|---|---|
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 | |||
11 | ///Do the Hadamard product | ||
12 | /** @param[out] ptabResult : table of results of tabX*tabY | ||
13 | * @param ptabX : input table | ||
14 | * @param ptabY : input table | ||
15 | * @param nbElement : number of elements in the tables | ||
16 | */ | ||
17 | 1 | void hadamard_product(float* __restrict__ ptabResult, const float* __restrict__ ptabX, const float* __restrict__ ptabY, long unsigned int nbElement){ | |
18 | 1 | const float* tabX = (const float*)__builtin_assume_aligned(ptabX, FLOAT_VECTOR_ALIGNEMENT); | |
19 | 1 | const float* tabY = (const float*)__builtin_assume_aligned(ptabY, FLOAT_VECTOR_ALIGNEMENT); | |
20 | 1 | float* tabResult = (float*)__builtin_assume_aligned(ptabResult, FLOAT_VECTOR_ALIGNEMENT); | |
21 | |||
22 |
2/2✓ Branch 0 taken 1000 times.
✓ Branch 1 taken 1 times.
|
1001 | for(long unsigned int i(0lu); i < nbElement; ++i){ |
23 | 1000 | tabResult[i] = tabX[i]*tabY[i]; | |
24 | } | ||
25 | 1 | } | |
26 | |||
27 | |||
28 |