/[escript]/branches/clazy/escriptcore/src/DataLazy.cpp
ViewVC logotype

Diff of /branches/clazy/escriptcore/src/DataLazy.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4620 by jfenwick, Wed Jul 24 02:50:22 2013 UTC revision 4621 by jfenwick, Thu Jan 16 10:07:44 2014 UTC
# Line 822  DataLazy::~DataLazy() Line 822  DataLazy::~DataLazy()
822    For reasons of efficiency do not call this method on DataExpanded nodes.    For reasons of efficiency do not call this method on DataExpanded nodes.
823  */  */
824  DataReady_ptr  DataReady_ptr
825  DataLazy::collapseToReady()  DataLazy::collapseToReady() const
826  {  {
827    if (m_readytype=='E')    if (m_readytype=='E')
828    { // this is more an efficiency concern than anything else    { // this is more an efficiency concern than anything else
# Line 977  DataLazy::collapseToReady() Line 977  DataLazy::collapseToReady()
977     the purpose of using DataLazy in the first place).     the purpose of using DataLazy in the first place).
978  */  */
979  void  void
980  DataLazy::collapse()  DataLazy::collapse() const
981  {  {
982    if (m_op==IDENTITY)    if (m_op==IDENTITY)
983    {    {
# Line 1016  LAZYDEBUG(cout << " result=      " << re Line 1016  LAZYDEBUG(cout << " result=      " << re
1016  // The result will be stored in m_samples  // The result will be stored in m_samples
1017  // The return value is a pointer to the DataVector, offset is the offset within the return value  // The return value is a pointer to the DataVector, offset is the offset within the return value
1018  const DataTypes::ValueType*  const DataTypes::ValueType*
1019  DataLazy::resolveNodeSample(int tid, int sampleNo, size_t& roffset)  DataLazy::resolveNodeSample(int tid, int sampleNo, size_t& roffset) const
1020  {  {
1021  LAZYDEBUG(cout << "Resolve sample " << toString() << endl;)  LAZYDEBUG(cout << "Resolve sample " << toString() << endl;)
1022      // collapse so we have a 'E' node or an IDENTITY for some other type      // collapse so we have a 'E' node or an IDENTITY for some other type
# Line 1065  if (&x<stackend[omp_get_thread_num()]) Line 1065  if (&x<stackend[omp_get_thread_num()])
1065  }  }
1066    
1067  const DataTypes::ValueType*  const DataTypes::ValueType*
1068  DataLazy::resolveNodeUnary(int tid, int sampleNo, size_t& roffset)  DataLazy::resolveNodeUnary(int tid, int sampleNo, size_t& roffset) const
1069  {  {
1070      // we assume that any collapsing has been done before we get here      // we assume that any collapsing has been done before we get here
1071      // since we only have one argument we don't need to think about only      // since we only have one argument we don't need to think about only
# Line 1197  DataLazy::resolveNodeUnary(int tid, int Line 1197  DataLazy::resolveNodeUnary(int tid, int
1197    
1198    
1199  const DataTypes::ValueType*  const DataTypes::ValueType*
1200  DataLazy::resolveNodeReduction(int tid, int sampleNo, size_t& roffset)  DataLazy::resolveNodeReduction(int tid, int sampleNo, size_t& roffset) const
1201  {  {
1202      // we assume that any collapsing has been done before we get here      // we assume that any collapsing has been done before we get here
1203      // since we only have one argument we don't need to think about only      // since we only have one argument we don't need to think about only
# Line 1249  DataLazy::resolveNodeReduction(int tid, Line 1249  DataLazy::resolveNodeReduction(int tid,
1249  }  }
1250    
1251  const DataTypes::ValueType*  const DataTypes::ValueType*
1252  DataLazy::resolveNodeNP1OUT(int tid, int sampleNo, size_t& roffset)  DataLazy::resolveNodeNP1OUT(int tid, int sampleNo, size_t& roffset) const
1253  {  {
1254      // we assume that any collapsing has been done before we get here      // we assume that any collapsing has been done before we get here
1255      // since we only have one argument we don't need to think about only      // since we only have one argument we don't need to think about only
# Line 1294  DataLazy::resolveNodeNP1OUT(int tid, int Line 1294  DataLazy::resolveNodeNP1OUT(int tid, int
1294  }  }
1295    
1296  const DataTypes::ValueType*  const DataTypes::ValueType*
1297  DataLazy::resolveNodeNP1OUT_P(int tid, int sampleNo, size_t& roffset)  DataLazy::resolveNodeNP1OUT_P(int tid, int sampleNo, size_t& roffset) const
1298  {  {
1299      // we assume that any collapsing has been done before we get here      // we assume that any collapsing has been done before we get here
1300      // since we only have one argument we don't need to think about only      // since we only have one argument we don't need to think about only
# Line 1342  DataLazy::resolveNodeNP1OUT_P(int tid, i Line 1342  DataLazy::resolveNodeNP1OUT_P(int tid, i
1342    
1343    
1344  const DataTypes::ValueType*  const DataTypes::ValueType*
1345  DataLazy::resolveNodeNP1OUT_2P(int tid, int sampleNo, size_t& roffset)  DataLazy::resolveNodeNP1OUT_2P(int tid, int sampleNo, size_t& roffset) const
1346  {  {
1347    if (m_readytype!='E')    if (m_readytype!='E')
1348    {    {
# Line 1378  DataLazy::resolveNodeNP1OUT_2P(int tid, Line 1378  DataLazy::resolveNodeNP1OUT_2P(int tid,
1378  }  }
1379    
1380  const DataTypes::ValueType*  const DataTypes::ValueType*
1381  DataLazy::resolveNodeCondEval(int tid, int sampleNo, size_t& roffset)  DataLazy::resolveNodeCondEval(int tid, int sampleNo, size_t& roffset) const
1382  {  {
1383    if (m_readytype!='E')    if (m_readytype!='E')
1384    {    {
# Line 1422  DataLazy::resolveNodeCondEval(int tid, i Line 1422  DataLazy::resolveNodeCondEval(int tid, i
1422  // For example, 2+Vector.  // For example, 2+Vector.
1423  // In this case each double within the point is treated individually  // In this case each double within the point is treated individually
1424  const DataTypes::ValueType*  const DataTypes::ValueType*
1425  DataLazy::resolveNodeBinary(int tid, int sampleNo, size_t& roffset)  DataLazy::resolveNodeBinary(int tid, int sampleNo, size_t& roffset) const
1426  {  {
1427  LAZYDEBUG(cout << "Resolve binary: " << toString() << endl;)  LAZYDEBUG(cout << "Resolve binary: " << toString() << endl;)
1428    
# Line 1579  LAZYDEBUG(cout << "Result res[" << roffs Line 1579  LAZYDEBUG(cout << "Result res[" << roffs
1579  // have already been collapsed to IDENTITY. So we must have at least one expanded child.  // have already been collapsed to IDENTITY. So we must have at least one expanded child.
1580  // unlike the other resolve helpers, we must treat these datapoints separately.  // unlike the other resolve helpers, we must treat these datapoints separately.
1581  const DataTypes::ValueType*  const DataTypes::ValueType*
1582  DataLazy::resolveNodeTProd(int tid, int sampleNo, size_t& roffset)  DataLazy::resolveNodeTProd(int tid, int sampleNo, size_t& roffset) const
1583  {  {
1584  LAZYDEBUG(cout << "Resolve TensorProduct: " << toString() << endl;)  LAZYDEBUG(cout << "Resolve TensorProduct: " << toString() << endl;)
1585    
# Line 1638  LAZYDEBUG(cout << DataTypes::pointToStri Line 1638  LAZYDEBUG(cout << DataTypes::pointToStri
1638    
1639    
1640  const DataTypes::ValueType*  const DataTypes::ValueType*
1641  DataLazy::resolveSample(int sampleNo, size_t& roffset)  DataLazy::resolveSample(int sampleNo, size_t& roffset) const
1642  {  {
1643  #ifdef _OPENMP  #ifdef _OPENMP
1644      int tid=omp_get_thread_num();      int tid=omp_get_thread_num();

Legend:
Removed from v.4620  
changed lines
  Added in v.4621

  ViewVC Help
Powered by ViewVC 1.1.26