/[escript]/branches/numpy/escript/src/BufferGroup.h
ViewVC logotype

Contents of /branches/numpy/escript/src/BufferGroup.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2396 - (show annotations)
Thu Apr 23 23:58:29 2009 UTC (10 years ago) by jfenwick
File MIME type: text/plain
File size: 1001 byte(s)
Branching to port escript to use numpy rather than numarray

1
2 /*******************************************************
3 *
4 * Copyright (c) 2008 by University of Queensland
5 * Earth Systems Science Computational Center (ESSCC)
6 * http://www.uq.edu.au/esscc
7 *
8 * Primary Business: Queensland, Australia
9 * Licensed under the Open Software License version 3.0
10 * http://www.opensource.org/licenses/osl-3.0.php
11 *
12 *******************************************************/
13
14
15 /** \file BufferGroup.h */
16
17 #ifndef BUFFERGROUP_H
18 #define BUFFERGROUP_H
19
20 #include "DataVector.h"
21 #ifdef _OPENMP
22 #include <omp.h>
23 #endif
24
25 namespace escript
26 {
27
28 class BufferGroup
29 {
30 public:
31 BufferGroup(size_t buffersize,size_t numbuffs);
32 ~BufferGroup();
33 DataVector& getBuffer(size_t buffnum);
34 size_t getOffset(size_t buffnum);
35
36 private:
37 DataVector m_vec;
38 size_t m_numbuffs;
39 size_t m_step;
40 };
41
42 inline DataVector& BufferGroup::getBuffer(size_t buffnum)
43 {
44 return m_vec;
45 }
46
47 inline size_t BufferGroup::getOffset(size_t buffnum)
48 {
49 return m_step*buffnum;
50 }
51
52 } // end namespace
53
54 #endif // BUFFERGROUP_H
55

  ViewVC Help
Powered by ViewVC 1.1.26