Commit d153d6e3 authored by Pierre Aubert's avatar Pierre Aubert
Browse files

Add very base of performance test project

parents
This diff is collapsed.
/** @mainpage Set of test performance
*
* <a href="coverage/cov_report.html">See test coverage detail from gcovr</a><br />
<a href="coverage/Coverage.xml">See test coverage report</a>
*/
#!/bin/bash
if [[ "$OSTYPE" == "darwin"* ]]; then
export nbproc=`sysctl -n hw.physicalcpu`
else
export nbproc=`nproc`
fi
INSTALL_PREFIX="$1"
if [ -z "$1" ]
then
INSTALL_PREFIX=$HOME/usr
fi
export PATH=$INSTALL_PREFIX/bin:$PATH
export LD_LIBRARY_PATH=$INSTALL_PREFIX/lib:$LD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=$INSTALL_PREFIX/lib:$DYLD_LIBRARY_PATH
if [ -d build ]
then
echo "Remove existing directory build"
rm -fr build
fi
mkdir -p build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX
if [ $? != 0 ]
then
echo "Error on cmake : exit -1"
exit -1
fi
make -j $nbproc
if [ $? != 0 ]
then
echo "Error on make : exit -1"
exit -1
fi
make install -j $nbproc
if [ $? != 0 ]
then
echo "Error on install : exit -1"
exit -1
fi
if [ -f $HOME/.bashrc ]; then
source $HOME/.bashrc
fi
project(Phoenix)
cmake_minimum_required(VERSION 2.8)
add_subdirectory(cpp20)
project(Phoenix)
cmake_minimum_required(VERSION 2.8)
add_subdirectory(saxpy)
project(Phoenix)
cmake_minimum_required(VERSION 2.8)
/***************************************
Auteur : Pierre Aubert
Mail : aubertp7@gmail.com
Licence : CeCILL-C
****************************************/
//some doc at : https://en.cppreference.com/w/cpp/header/algorithm
#include <algorithm>
//Some doc at : https://en.cppreference.com/w/cpp/header/execution
#include <execution>
#include "saxpy.h"
///Do a classical saxpy
/** @param[out] tabRes : table of the result
* @param tabX : talbe of x values
* @param tabY : table of y values
* @param scal : scalar which multiplies tabX
* @param nbElement : number of elements in the tables
*/
void saxpy(float * tabRes, const float* tabX, const float* tabY, float scal, size_t nbElement){
std::transform(std::execution::par_unseq, tabX, tabX + N, tabY, tabRes,
[=](float xi, float yi){ return scal * xi + yi; });
}
/***************************************
Auteur : Pierre Aubert
Mail : aubertp7@gmail.com
Licence : CeCILL-C
****************************************/
#ifndef __SAXPY_H__
#define __SAXPY_H__
#include <iostream>
void saxpy(float * tabRes, const float* tabX, const float* tabY, float scal, size_t nbElement);
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment