13.1.1 : Test avec un produit de Hadamard



Compilons ce test :
cd SimpleHadamardProduct
mkdir -p build
cd build
cmake ..
-- The C compiler identification is GNU 11.3.0
-- The CXX compiler identification is GNU 11.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Use nvc++ compiler at /opt/nvidia/hpc_sdk/Linux_x86_64/23.5/compilers/bin/nvc++
-- Configuring done
-- Generating done
-- Build files have been written to: XXX/SimpleHadamardProduct/build


Appelons make :
1
2
3
4
make
[ 50%] Building CXX object CMakeFiles/simple_hadamard_product.dir/main.cpp.o
[100%] Linking CXX executable simple_hadamard_product
[100%] Built target simple_hadamard_product


Lançons notre programme :
./simple_hadamard_product 
x = 0, y = 0, res = 0


Profilons ce programme avec nsys :
nsys profile ./simple_hadamard_product 
WARNING: CPU IP/backtrace sampling not supported, disabling.
Try the 'nsys status --environment' command to learn more.

WARNING: CPU context switch tracing not supported, disabling. Try the 'nsys status --environment' command to learn more.

x = 0, y = 0, res = 0 Generating '/tmp/nsys-report-102d.qdstrm' [1/1] [========================100%] report1.nsys-rep Generated: XXX/SimpleHadamardProduct/build/report1.nsys-rep


Ensuite nous pouvons ouvrir le fichier report1.nsys-rep avec nsight.