/[escript]/trunk/ripley/src/blocktools2.cpp
ViewVC logotype

Diff of /trunk/ripley/src/blocktools2.cpp

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

revision 4695 by jfenwick, Wed Feb 19 00:03:29 2014 UTC revision 4696 by jfenwick, Wed Feb 19 07:29:50 2014 UTC
# Line 123  size_t Block2::getBuffSize(unsigned char Line 123  size_t Block2::getBuffSize(unsigned char
123      {      {
124      return 0;        return 0;  
125      }      }
126      return dims[bid][0]*dims[bid][1]*dims[bid][2];        return dims[bid][0]*dims[bid][1]*dims[bid][2]*dpsize;  
127  }  }
128    
129  double* Block2::getOutBuffer(unsigned char bid)  double* Block2::getOutBuffer(unsigned char bid)
# Line 150  size_t Block2::getBuffSize(unsigned char Line 150  size_t Block2::getBuffSize(unsigned char
150      {      {
151      return 0;        return 0;  
152      }      }
153      return dims[bid][0]*dims[bid][1];        return dims[bid][0]*dims[bid][1]*dpsize;    
154  }  }
155    
156    
# Line 186  void Block2::populateOffsetTable(size_t Line 186  void Block2::populateOffsetTable(size_t
186      for (int i=0;i<9;++i)      for (int i=0;i<9;++i)
187      {      {
188      flatoffsets[i]=cur;      flatoffsets[i]=cur;
189      cur+=dims[i][0]*dims[i][1];      cur+=dims[i][0]*dims[i][1]*dpsize;
190      }      }
191      for (int i=0;i<4;++i)      for (int i=0;i<4;++i)
192      {      {
# Line 324  void Block2::copyToBuffer(unsigned char Line 324  void Block2::copyToBuffer(unsigned char
324      double* dest=outbuffptr[bid];      double* dest=outbuffptr[bid];
325      size_t ylim=dims[bid][1];   // how big is the block      size_t ylim=dims[bid][1];   // how big is the block
326      size_t xlim=dims[bid][0];      size_t xlim=dims[bid][0];
327        
328    // // testing for mismatch in the copy
329    // for (int i=0;i<ylim*xlim*dpsize;++i)
330    // {
331    // dest[i]=-42;    
332    // }
333        
334      for (size_t y=0;y<ylim;++y)      for (size_t y=0;y<ylim;++y)
335      {          {    
336      memcpy(dest, start, xlim*sizeof(double)*dpsize);      memcpy(dest, start, xlim*sizeof(double)*dpsize);

Legend:
Removed from v.4695  
changed lines
  Added in v.4696

  ViewVC Help
Powered by ViewVC 1.1.26