Commit 7308e61b authored by Berenger Bramas's avatar Berenger Bramas

Update examples -- use inastemp scalar and scalar in exp and gemm

parent 6acba381
......@@ -13,6 +13,7 @@
#include <memory>
#include <iostream>
#include <cmath>
#ifdef INASTEMP_USE_SSE41
......@@ -381,13 +382,33 @@ void compareExpTime(const size_t NbOverLoop, const size_t NbExp){
for (size_t idxLoop = 0; idxLoop < NbOverLoop; ++idxLoop) {
for (size_t idx = 0; idx < NbExp; ++idx) {
resScalar[idx] = static_cast<RealType>(InaVecSCALAR<RealType>(RealType(idx % 200)).exp());
resScalar[idx] = static_cast<RealType>(std::exp(RealType(idx % 200)));
}
}
timer.stop();
std::cout << "Scalar for " << NbExp * NbOverLoop
<< " exp took " << timer.getElapsed() << "s (" << timer.getElapsed()/double(NbExp * NbOverLoop) << "s per exp)\n";
// Ensure that optimization compute for real
volatile RealType tmp;
tmp = resScalar[0];
}
std::cout << "\n";
/////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////
{
InaTimer timer;
for (size_t idxLoop = 0; idxLoop < NbOverLoop; ++idxLoop) {
for (size_t idx = 0; idx < NbExp; ++idx) {
resScalar[idx] = static_cast<RealType>(InaVecSCALAR<RealType>(RealType(idx % 200)).exp());
}
}
timer.stop();
std::cout << "Inastemp Scalar for " << NbExp * NbOverLoop
<< " exp took " << timer.getElapsed() << "s (" << timer.getElapsed()/double(NbExp * NbOverLoop) << "s per exp)\n";
// Ensure that optimization compute for real
volatile RealType tmp;
tmp = resScalar[0];
......
......@@ -10,6 +10,10 @@
#include "InastempConfig.h"
#include "Common/InaTimer.hpp"
#include "SCALAR/InaVecSCALARDouble.hpp"
#include "SCALAR/InaVecSCALARFloat.hpp"
#include <memory>
#include <iostream>
#include <cstring>
......@@ -945,6 +949,10 @@ void compareGemmTime(const size_t NbOverLoop, const size_t matDim){
}
/////////////////////////////////////////////////////////////
ComputeGemmIna<InaVecSCALAR<RealType>, RealType, PanelSizeA, PanelSizeB, PanelSizeK>(NbOverLoop, matDim, nbFlops, A.get(), B.get());
/////////////////////////////////////////////////////////////
#ifdef INASTEMP_USE_SSE41
ComputeGemmIna<InaVecSSE41<RealType>, RealType, PanelSizeA, PanelSizeB, PanelSizeK>(NbOverLoop, matDim, nbFlops, A.get(), B.get());
......
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