Commit edcbaa0f authored by Douglas Serson's avatar Douglas Serson
Browse files

Performance improvement for 1D simulations

parent 3c8cffaa
......@@ -289,10 +289,6 @@ IF( NEKTAR_USE_TINYXML_STL )
ADD_DEFINITIONS( -DTIXML_USE_STL)
ENDIF( NEKTAR_USE_TINYXML_STL )
IF( NEKTAR_USE_DIRECT_BLAS_CALLS )
ADD_DEFINITIONS(-DNEKTAR_USING_DIRECT_BLAS_CALLS)
ENDIF( NEKTAR_USE_DIRECT_BLAS_CALLS )
IF( NEKTAR_USE_EXPRESSION_TEMPLATES )
ADD_DEFINITIONS(-DNEKTAR_USE_EXPRESSION_TEMPLATES -DNEKTAR_USING_CMAKE)
ENDIF( NEKTAR_USE_EXPRESSION_TEMPLATES )
......
......@@ -69,9 +69,7 @@ namespace Nektar
{
int nquad = GetTotPoints();
DNekMatSharedPtr D = m_base[0]->GetD();
#ifdef NEKTAR_USING_DIRECT_BLAS_CALLS
if( inarray.data() == outarray.data())
{
Array<OneD, NekDouble> wsp(nquad);
......@@ -84,23 +82,6 @@ namespace Nektar
Blas::Dgemv('N',nquad,nquad,1.0,&(D->GetPtr())[0],nquad,
&inarray[0],1,0.0,&outarray[0],1);
}
#else //NEKTAR_USING_DIRECT_BLAS_CALLS
NekVector<NekDouble> out(nquad,outarray,eWrapper);
if(inarray.data() == outarray.data()) // copy intput array
{
NekVector<NekDouble> in(nquad,inarray,eCopy);
out = (*D)*in;
}
else
{
NekVector<NekDouble> in (nquad,inarray,eWrapper);
out = (*D)*in;
}
#endif //NEKTAR_USING_DIRECT_BLAS_CALLS
}
NekDouble StdExpansion0D::v_PhysEvaluate(const Array<OneD, const NekDouble>& Lcoord, const Array<OneD, const NekDouble>& physvals)
......
......@@ -70,8 +70,6 @@ namespace Nektar
int nquad = GetTotPoints();
DNekMatSharedPtr D = m_base[0]->GetD();
#ifdef NEKTAR_USING_DIRECT_BLAS_CALLS
if( inarray.data() == outarray.data())
{
Array<OneD, NekDouble> wsp(nquad);
......@@ -84,23 +82,6 @@ namespace Nektar
Blas::Dgemv('N',nquad,nquad,1.0,&(D->GetPtr())[0],nquad,
&inarray[0],1,0.0,&outarray[0],1);
}
#else //NEKTAR_USING_DIRECT_BLAS_CALLS
NekVector<NekDouble> out(nquad,outarray,eWrapper);
if(inarray.data() == outarray.data()) // copy intput array
{
NekVector<NekDouble> in(nquad,inarray,eCopy);
out = (*D)*in;
}
else
{
NekVector<NekDouble> in (nquad,inarray,eWrapper);
out = (*D)*in;
}
#endif //NEKTAR_USING_DIRECT_BLAS_CALLS
}
NekDouble StdExpansion1D::v_PhysEvaluate(
......
......@@ -97,21 +97,9 @@ namespace Nektar
}
else
{
#ifdef NEKTAR_USING_DIRECT_BLAS_CALLS
Blas::Dgemv('N',nquad,m_base[0]->GetNumModes(),1.0, (m_base[0]->GetBdata()).get(),
Blas::Dgemv('N',nquad,m_base[0]->GetNumModes(),1.0,
(m_base[0]->GetBdata()).get(),
nquad,&inarray[0],1,0.0,&outarray[0],1);
#else //NEKTAR_USING_DIRECT_BLAS_CALLS
NekVector<NekDouble> in(m_ncoeffs,inarray,eWrapper);
NekVector<NekDouble> out(nquad,outarray,eWrapper);
NekMatrix<NekDouble> B(nquad,m_ncoeffs,m_base[0]->GetBdata(),eWrapper);
out = B * in;
#endif //NEKTAR_USING_DIRECT_BLAS_CALLS
}
}
......
......@@ -228,19 +228,9 @@ namespace Nektar
else
{
#ifdef NEKTAR_USING_DIRECT_BLAS_CALLS
Blas::Dgemv('N',nquad,m_base[0]->GetNumModes(),1.0, (m_base[0]->GetBdata()).get(),
nquad,&inarray[0],1,0.0,&outarray[0],1);
#else //NEKTAR_USING_DIRECT_BLAS_CALLS
NekVector<NekDouble> in(m_ncoeffs,inarray,eWrapper);
NekVector<NekDouble> out(nquad,outarray,eWrapper);
NekMatrix<NekDouble> B(nquad,m_ncoeffs,m_base[0]->GetBdata(),eWrapper);
out = B * in;
#endif //NEKTAR_USING_DIRECT_BLAS_CALLS
Blas::Dgemv('N',nquad,m_base[0]->GetNumModes(),1.0,
(m_base[0]->GetBdata()).get(),
nquad,&inarray[0],1,0.0,&outarray[0],1);
}
}
......
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