OpenNet
Processor.h
Go to the documentation of this file.
1 
2 // Product OpenNet
3 
8 
9 #pragma once
10 
11 // Includes
13 
14 // ===== Includes ===========================================================
15 #include <OpenNet/OpenNet.h>
16 #include <OpenNet/Status.h>
17 
18 namespace OpenNet
19 {
20 
21  class UserBuffer;
22 
23  // Class
25 
33  class Processor
34  {
35 
36  public:
37 
38  // TODO OpenNet.Processor
39  // Normal (Feature) - Ajouter un chemin de recherche
40  // additionnel pour les includes dans la configuration.
41 
42  // TODO OpenNet.Processor
43  // Normal (Feature) - Ajouter un parametre de configuration
44  // pour le chemin de recherche des include d'OpenNet.
45 
54  typedef struct
55  {
56  struct
57  {
58  unsigned mProfilingEnabled : 1;
59 
60  unsigned mReserved0 : 31;
61  }
62  mFlags;
63 
64  unsigned char mReserved0[60];
65  }
66  Config;
67 
78  typedef struct
79  {
80  uint64_t mGlobalMemCacheSize_byte ;
81  uint64_t mGlobalMemSize_byte ;
82  uint64_t mImage2DMaxHeight ;
83  uint64_t mImage2DMaxWidth ;
84  uint64_t mImage3DMaxDepth ;
85  uint64_t mImage3DMaxHeight ;
86  uint64_t mImage3DMaxWidth ;
87  uint64_t mLocalMemSize_byte ;
88  uint64_t mMaxConstantBufferSize_byte;
89  uint64_t mMaxMemAllocSize_byte ;
90  uint64_t mMaxParameterSize_byte ;
91  uint64_t mMaxWorkGroupSize ;
92  uint64_t mMaxWorkItemSizes [3];
93 
94  uint8_t mReserved0[8];
95 
96  uint32_t mGlobalMemCacheType ;
97  uint32_t mGlobalMemCacheLineSize_byte;
98  uint32_t mLocalMemType ;
99  uint32_t mMaxComputeUnits ;
100  uint32_t mMaxConstantArgs ;
101  uint32_t mMaxReadImageArgs ;
102  uint32_t mMaxSamplers ;
103  uint32_t mMaxWriteImageArgs ;
104  uint32_t mMemBaseAddrAlign_bit ;
105  uint32_t mMinDataTypeAlignSize_byte ;
106  uint32_t mPreferredVectorWidthChar ;
107  uint32_t mPreferredVectorWidthShort ;
108  uint32_t mPreferredVectorWidthInt ;
109  uint32_t mPreferredVectorWidthLong ;
110  uint32_t mVendorId ;
111 
112  uint8_t mReserved1[64];
113 
114  struct
115  {
116  unsigned mAvailable : 1;
117  unsigned mCompilerAvailable : 1;
118  unsigned mImageSupport : 1;
119  unsigned mEndianLittle : 1;
120 
121  unsigned mReserved0 : 28;
122  }
123  mFlags;
124 
125  char mDriverVersion[128];
126  char mName [128];
127  char mProfile [128];
128  char mVendor [128];
129  char mVersion [128];
130 
131  uint8_t mReserved2[128];
132 
133  }
134  Info;
135 
149  static OPEN_NET_PUBLIC Status Display(const Info & aIn, FILE * aOut);
150 
162  virtual Status GetConfig(Config * aOut) const = 0;
163 
173  virtual void * GetContext() = 0;
174 
184  virtual void * GetDevice() = 0;
185 
196  virtual Status GetInfo(Info * aOut) const = 0;
197 
207  virtual const char * GetName() const = 0;
208 
220  virtual Status SetConfig(const Config & aConfig) = 0;
221 
236  virtual UserBuffer * AllocateUserBuffer(unsigned int aSize_byte) = 0;
237 
248  virtual Status Display(FILE * aOut) const = 0;
249 
250  // Internal
251 
252  virtual ~Processor();
253 
254  protected:
255 
256  Processor();
257 
258  private:
259 
260  Processor(const Processor &);
261 
262  const Processor & operator = (const Processor &);
263 
264  };
265 
266 }
virtual UserBuffer * AllocateUserBuffer(unsigned int aSize_byte)=0
Allocate a user buffer in the processor memory.
Definition: Adapter.h:19
static OPEN_NET_PUBLIC Status Display(const Info &aIn, FILE *aOut)
Display.
This structure contains the information about a Processor.
Definition: Processor.h:78
virtual Status SetConfig(const Config &aConfig)=0
Modify the configuration.
virtual void * GetDevice()=0
Retrieve the OpenCL device id.
virtual void * GetContext()=0
Retrieve the OpenCL context.
virtual const char * GetName() const =0
Retrieve the instance's name.
virtual Status GetInfo(Info *aOut) const =0
Retrieve the Info.
The UserBuffer class.
Definition: UserBuffer.h:29
virtual Status GetConfig(Config *aOut) const =0
Retrieve configuration.
This structure contains the configuration of a Processor.
Definition: Processor.h:54
This class define the processor level interface.
Definition: Processor.h:33