NTrace
GPU ray tracing framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Stream.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2009-2011, NVIDIA Corporation
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  * * Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * * Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  * * Neither the name of NVIDIA Corporation nor the
13  * names of its contributors may be used to endorse or promote products
14  * derived from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19  * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
20  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  */
27 
28 #pragma once
29 #include "base/Array.hpp"
30 #include "base/String.hpp"
31 #include "base/Math.hpp"
32 
33 #include <stdarg.h>
34 
35 namespace FW
36 {
37 
38 //------------------------------------------------------------------------
39 
41 {
42 public:
43  InputStream (void) {}
44  virtual ~InputStream (void) {}
45 
46  virtual int read (void* ptr, int size) = 0; // out of data => partial result
47  void readFully (void* ptr, int size); // out of data => failure
48 
49  U8 readU8 (void) { U8 b; readFully(&b, sizeof(b)); return b; }
50  U16 readU16BE (void) { U8 b[2]; readFully(b, sizeof(b)); return (U16)((b[0] << 8) | b[1]); }
51  U16 readU16LE (void) { U8 b[2]; readFully(b, sizeof(b)); return (U16)((b[1] << 8) | b[0]); }
52  U32 readU32BE (void) { U8 b[4]; readFully(b, sizeof(b)); return (b[0] << 24) | (b[1] << 16) | (b[2] << 8) | b[3]; }
53  U32 readU32LE (void) { U8 b[4]; readFully(b, sizeof(b)); return (b[3] << 24) | (b[2] << 16) | (b[1] << 8) | b[0]; }
54  U64 readU64BE (void) { U8 b[8]; readFully(b, sizeof(b)); return ((U64)b[0] << 56) | ((U64)b[1] << 48) | ((U64)b[2] << 40) | ((U64)b[3] << 32) | ((U64)b[4] << 24) | ((U64)b[5] << 16) | ((U64)b[6] << 8) | (U64)b[7]; }
55  U64 readU64LE (void) { U8 b[8]; readFully(b, sizeof(b)); return ((U64)b[7] << 56) | ((U64)b[6] << 48) | ((U64)b[5] << 40) | ((U64)b[4] << 32) | ((U64)b[3] << 24) | ((U64)b[2] << 16) | ((U64)b[1] << 8) | (U64)b[0]; }
56 };
57 
58 //------------------------------------------------------------------------
59 
61 {
62 public:
63  OutputStream (void) {}
64  virtual ~OutputStream (void) {}
65 
66  virtual void write (const void* ptr, int size) = 0;
67  virtual void flush (void) = 0;
68 
69  void writeU8 (U32 v) { U8 b[1]; b[0] = (U8)v; write(b, sizeof(b)); }
70  void writeU16BE (U32 v) { U8 b[2]; b[0] = (U8)(v >> 8); b[1] = (U8)v; write(b, sizeof(b)); }
71  void writeU16LE (U32 v) { U8 b[2]; b[1] = (U8)(v >> 8); b[0] = (U8)v; write(b, sizeof(b)); }
72  void writeU32BE (U32 v) { U8 b[4]; b[0] = (U8)(v >> 24); b[1] = (U8)(v >> 16); b[2] = (U8)(v >> 8); b[3] = (U8)v; write(b, sizeof(b)); }
73  void writeU32LE (U32 v) { U8 b[4]; b[3] = (U8)(v >> 24); b[2] = (U8)(v >> 16); b[1] = (U8)(v >> 8); b[0] = (U8)v; write(b, sizeof(b)); }
74  void writeU64BE (U64 v) { U8 b[8]; b[0] = (U8)(v >> 56); b[1] = (U8)(v >> 48); b[2] = (U8)(v >> 40); b[3] = (U8)(v >> 32); b[4] = (U8)(v >> 24); b[5] = (U8)(v >> 16); b[6] = (U8)(v >> 8); b[7] = (U8)v; write(b, sizeof(b)); }
75  void writeU64LE (U64 v) { U8 b[8]; b[7] = (U8)(v >> 56); b[6] = (U8)(v >> 48); b[5] = (U8)(v >> 40); b[4] = (U8)(v >> 32); b[3] = (U8)(v >> 24); b[2] = (U8)(v >> 16); b[1] = (U8)(v >> 8); b[0] = (U8)v; write(b, sizeof(b)); }
76 };
77 
78 //------------------------------------------------------------------------
79 
81 {
82 public:
83  BufferedInputStream (InputStream& stream, int bufferSize = 64 << 10);
84  virtual ~BufferedInputStream (void);
85 
86  virtual int read (void* ptr, int size);
87  char* readLine (bool combineWithBackslash = false, bool normalizeWhitespace = false);
88 
89  bool fillBuffer (int size);
90  int getBufferSize (void) { return m_numRead - m_numConsumed; }
91  U8* getBufferPtr (void) { return m_buffer.getPtr(m_numConsumed); }
92  void consumeBuffer (int num);
93 
94 private:
95  BufferedInputStream (const BufferedInputStream&); // forbidden
96  BufferedInputStream& operator= (const BufferedInputStream&); // forbidden
97 
98 private:
99  InputStream& m_stream;
100  Array<U8> m_buffer;
101  S32 m_numRead;
102  S32 m_numConsumed;
103 };
104 
105 //------------------------------------------------------------------------
106 
108 {
109 public:
110  BufferedOutputStream (OutputStream& stream, int bufferSize = 64 << 10, bool writeOnLF = false, bool emulateCR = false);
111  virtual ~BufferedOutputStream (void);
112 
113  virtual void write (const void* ptr, int size);
114  void writef (const char* fmt, ...);
115  void writefv (const char* fmt, va_list args);
116  virtual void flush (void);
117 
118  S32 getNumBytesWritten (void) const { return m_numFlushed + m_numValid; }
119 
120 private:
121  void addValid (int size);
122  void flushInternal (void);
123 
124 private:
125  BufferedOutputStream (const BufferedOutputStream&); // forbidden
126  BufferedOutputStream& operator= (const BufferedOutputStream&); // forbidden
127 
128 private:
129  OutputStream& m_stream;
130  bool m_writeOnLF;
131  bool m_emulateCR;
132 
133  Array<U8> m_buffer;
134  S32 m_numValid;
135  S32 m_lineStart;
136  S32 m_currOfs;
137  S32 m_numFlushed;
138 };
139 
140 //------------------------------------------------------------------------
141 
143 {
144 public:
145  MemoryInputStream (void) { reset(); }
146  MemoryInputStream (const void* ptr, int size) { reset(ptr, size); }
147  template <class T> explicit MemoryInputStream (const Array<T>& data) { reset(data); }
148  virtual ~MemoryInputStream (void);
149 
150  virtual int read (void* ptr, int size);
151 
152  int getOffset (void) const { return m_ofs; }
153  void seek (int ofs) { FW_ASSERT(ofs >= 0 && ofs <= m_size); m_ofs = ofs; }
154 
155  void reset (void) { m_ptr = NULL; m_size = 0; m_ofs = 0; }
156  void reset (const void* ptr, int size) { FW_ASSERT(size >= 0); FW_ASSERT(ptr || !size); m_ptr = (const U8*)ptr; m_size = size; m_ofs = 0; }
157  template <class T> void reset (const Array<T>& data) { reset(data.getPtr(), data.getNumBytes()); }
158 
159 private:
160  MemoryInputStream (const MemoryInputStream&); // forbidden
161  MemoryInputStream& operator= (const MemoryInputStream&); // forbidden
162 
163 private:
164  const U8* m_ptr;
165  S32 m_size;
166  S32 m_ofs;
167 };
168 
169 //------------------------------------------------------------------------
170 
172 {
173 public:
174  MemoryOutputStream (int capacity = 0) { m_data.setCapacity(capacity); }
175  virtual ~MemoryOutputStream (void);
176 
177  virtual void write (const void* ptr, int size);
178  virtual void flush (void);
179 
180  void clear (void) { m_data.clear(); }
181  Array<U8>& getData (void) { return m_data; }
182  const Array<U8>& getData (void) const { return m_data; }
183 
184 private:
185  MemoryOutputStream (const MemoryOutputStream&); // forbidden
186  MemoryOutputStream& operator= (const MemoryOutputStream&); // forbidden
187 
188 private:
189  Array<U8> m_data;
190 };
191 
192 //------------------------------------------------------------------------
193 
195 {
196 public:
197  Serializable (void) {}
198  virtual ~Serializable (void) {}
199 
200  virtual void readFromStream (InputStream& s) = 0;
201  virtual void writeToStream (OutputStream& s) const = 0;
202 };
203 
204 //------------------------------------------------------------------------
205 // Primitive types.
206 //------------------------------------------------------------------------
207 
208 inline InputStream& operator>> (InputStream& s, U8& v) { v = s.readU8(); return s; }
209 inline InputStream& operator>> (InputStream& s, U16& v) { v = s.readU16LE(); return s; }
210 inline InputStream& operator>> (InputStream& s, U32& v) { v = s.readU32LE(); return s; }
211 inline InputStream& operator>> (InputStream& s, U64& v) { v = s.readU64LE(); return s; }
212 inline InputStream& operator>> (InputStream& s, S8& v) { v = s.readU8(); return s; }
213 inline InputStream& operator>> (InputStream& s, S16& v) { v = s.readU16LE(); return s; }
214 inline InputStream& operator>> (InputStream& s, S32& v) { v = s.readU32LE(); return s; }
215 inline InputStream& operator>> (InputStream& s, S64& v) { v = s.readU64LE(); return s; }
216 inline InputStream& operator>> (InputStream& s, F32& v) { v = bitsToFloat(s.readU32LE()); return s; }
217 inline InputStream& operator>> (InputStream& s, F64& v) { v = bitsToDouble(s.readU64LE()); return s; }
218 inline InputStream& operator>> (InputStream& s, char& v) { v = s.readU8(); return s; }
219 inline InputStream& operator>> (InputStream& s, bool& v) { v = (s.readU8() != 0); return s; }
220 
221 inline OutputStream& operator<< (OutputStream& s, U8 v) { s.writeU8(v); return s; }
222 inline OutputStream& operator<< (OutputStream& s, U16 v) { s.writeU16LE(v); return s; }
223 inline OutputStream& operator<< (OutputStream& s, U32 v) { s.writeU32LE(v); return s; }
224 inline OutputStream& operator<< (OutputStream& s, U64 v) { s.writeU64LE(v); return s; }
225 inline OutputStream& operator<< (OutputStream& s, S8 v) { s.writeU8(v); return s; }
226 inline OutputStream& operator<< (OutputStream& s, S16 v) { s.writeU16LE(v); return s; }
227 inline OutputStream& operator<< (OutputStream& s, S32 v) { s.writeU32LE(v); return s; }
228 inline OutputStream& operator<< (OutputStream& s, S64 v) { s.writeU64LE(v); return s; }
231 inline OutputStream& operator<< (OutputStream& s, char v) { s.writeU8(v); return s; }
232 inline OutputStream& operator<< (OutputStream& s, bool v) { s.writeU8((v) ? 1 : 0); return s; }
233 
234 //------------------------------------------------------------------------
235 // Types defined or included by this header.
236 //------------------------------------------------------------------------
237 
239 {
240  v.readFromStream(s);
241  return s;
242 }
243 
244 //------------------------------------------------------------------------
245 
247 {
248  v.writeToStream(s);
249  return s;
250 }
251 
252 //------------------------------------------------------------------------
253 
254 template <class T> InputStream& operator>>(InputStream& s, Array<T>& v)
255 {
256  S32 len;
257  s >> len;
258  v.reset(len);
259  for (int i = 0; i < len; i++)
260  s >> v[i];
261  return s;
262 }
263 
264 //------------------------------------------------------------------------
265 
266 template <class T> OutputStream& operator<<(OutputStream& s, const Array<T>& v)
267 {
268  s << v.getSize();
269  for (int i = 0; i < v.getSize(); i++)
270  s << v[i];
271  return s;
272 }
273 
274 //------------------------------------------------------------------------
275 
277 {
278  S32 len;
279  s >> len;
280  Array<char> t(NULL, len + 1);
281  for (int i = 0; i < len; i++)
282  s >> t[i];
283  t[len] = '\0';
284  v.set(t.getPtr());
285  return s;
286 }
287 
288 //------------------------------------------------------------------------
289 
291 {
292  s << v.getLength();
293  for (int i = 0; i < v.getLength(); i++)
294  s << v[i];
295  return s;
296 }
297 
298 //------------------------------------------------------------------------
299 
300 template <class T, int L, class S> InputStream& operator>>(InputStream& s, VectorBase<T, L, S>& v)
301 {
302  for (int i = 0; i < L; i++)
303  s >> v[i];
304  return s;
305 }
306 
307 //------------------------------------------------------------------------
308 
309 template <class T, int L, class S> OutputStream& operator<<(OutputStream& s, const VectorBase<T, L, S>& v)
310 {
311  for (int i = 0; i < L; i++)
312  s << v[i];
313  return s;
314 }
315 
316 //------------------------------------------------------------------------
317 
318 template <class T, int L, class S> InputStream& operator>>(InputStream& s, MatrixBase<T, L, S>& v)
319 {
320  for (int i = 0; i < L * L; i++)
321  s >> v.getPtr()[i];
322  return s;
323 }
324 
325 //------------------------------------------------------------------------
326 
327 template <class T, int L, class S> OutputStream& operator<<(OutputStream& s, const MatrixBase<T, L, S>& v)
328 {
329  for (int i = 0; i < L * L; i++)
330  s << v.getPtr()[i];
331  return s;
332 }
333 
334 //------------------------------------------------------------------------
335 }
FW_CUDA_FUNC const T * getPtr(void) const
Definition: Math.hpp:518
virtual ~OutputStream(void)
Definition: Stream.hpp:64
virtual ~Serializable(void)
Definition: Stream.hpp:198
U32 floatToBits(F32 a)
Definition: Math.hpp:95
virtual void flush(void)
Definition: Stream.cpp:275
#define NULL
Definition: Defs.hpp:39
void writeU16LE(U32 v)
Definition: Stream.hpp:71
BufferedOutputStream(OutputStream &stream, int bufferSize=64<< 10, bool writeOnLF=false, bool emulateCR=false)
Definition: Stream.cpp:195
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value CUfunction int CUtexref hTexRef CUfunction int int grid_height CUevent unsigned int Flags CUevent hEvent CUevent hEvent CUstream unsigned int Flags CUstream hStream GLuint bufferobj unsigned int CUdevice dev CUdeviceptr unsigned int CUmodule const char name CUdeviceptr unsigned int bytesize CUdeviceptr dptr void unsigned int bytesize void CUdeviceptr unsigned int ByteCount CUarray unsigned int CUdeviceptr unsigned int ByteCount CUarray unsigned int const void unsigned int ByteCount CUarray unsigned int CUarray unsigned int unsigned int ByteCount void CUarray unsigned int unsigned int CUstream hStream const CUDA_MEMCPY2D pCopy CUdeviceptr const void unsigned int CUstream hStream const CUDA_MEMCPY2D CUstream hStream CUdeviceptr unsigned char unsigned int N CUdeviceptr unsigned int unsigned int N CUdeviceptr unsigned int unsigned short unsigned int unsigned int Height CUarray const CUDA_ARRAY_DESCRIPTOR pAllocateArray CUarray const CUDA_ARRAY3D_DESCRIPTOR pAllocateArray unsigned int CUtexref CUdeviceptr unsigned int bytes CUcontext unsigned int CUdevice device GLenum texture GLenum GLuint buffer GLenum GLuint renderbuffer GLenum GLsizeiptr const GLvoid * data
Definition: DLLImports.inl:319
void ** ptr
Definition: DLLImports.cpp:74
MemoryInputStream(const void *ptr, int size)
Definition: Stream.hpp:146
unsigned __int64 U64
Definition: Defs.hpp:97
signed char S8
Definition: Defs.hpp:86
int L
Definition: Math.hpp:509
double F64
Definition: Defs.hpp:90
virtual void write(const void *ptr, int size)
Definition: Stream.cpp:217
void reset(const Array< T > &data)
Definition: Stream.hpp:157
void writeU16BE(U32 v)
Definition: Stream.hpp:70
virtual void write(const void *ptr, int size)=0
void clear(void)
Definition: Array.hpp:359
void writeU64BE(U64 v)
Definition: Stream.hpp:74
OutputStream(void)
Definition: Stream.hpp:63
U8 * getBufferPtr(void)
Definition: Stream.hpp:91
S32 getNumBytes(void) const
char * readLine(bool combineWithBackslash=false, bool normalizeWhitespace=false)
Definition: Stream.cpp:89
virtual void flush(void)
Definition: Stream.cpp:388
S32 getNumBytesWritten(void) const
Definition: Stream.hpp:118
virtual int read(void *ptr, int size)
Definition: Stream.cpp:365
void reset(S32size=0)
void reset(void)
Definition: Stream.hpp:155
virtual void writeToStream(OutputStream &s) const =0
float F32
Definition: Defs.hpp:89
void writeU8(U32 v)
Definition: Stream.hpp:69
InputStream(void)
Definition: Stream.hpp:43
Serializable(void)
Definition: Stream.hpp:197
signed short S16
Definition: Defs.hpp:87
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value CUfunction int CUtexref hTexRef CUfunction int int grid_height CUevent unsigned int Flags CUevent hEvent CUevent hEvent CUstream unsigned int Flags CUstream hStream GLuint bufferobj unsigned int CUdevice dev CUdeviceptr unsigned int CUmodule const char name CUdeviceptr unsigned int bytesize CUdeviceptr dptr void unsigned int bytesize void CUdeviceptr unsigned int ByteCount CUarray unsigned int CUdeviceptr unsigned int ByteCount CUarray unsigned int const void unsigned int ByteCount CUarray unsigned int CUarray unsigned int unsigned int ByteCount void CUarray unsigned int unsigned int CUstream hStream const CUDA_MEMCPY2D pCopy CUdeviceptr const void unsigned int CUstream hStream const CUDA_MEMCPY2D CUstream hStream CUdeviceptr unsigned char unsigned int N CUdeviceptr unsigned int unsigned int N CUdeviceptr unsigned int unsigned short unsigned int unsigned int Height CUarray const CUDA_ARRAY_DESCRIPTOR pAllocateArray CUarray const CUDA_ARRAY3D_DESCRIPTOR pAllocateArray unsigned int CUtexref CUdeviceptr unsigned int bytes CUcontext unsigned int CUdevice device GLenum texture GLenum GLuint buffer GLenum GLuint renderbuffer GLenum GLsizeiptr const GLvoid GLenum usage GLuint shader GLenum type GLsizei const GLuint framebuffers GLsizei const GLuint renderbuffers GLuint v
Definition: DLLImports.inl:329
MemoryInputStream(const Array< T > &data)
Definition: Stream.hpp:147
U8 readU8(void)
Definition: Stream.hpp:49
FW_CUDA_FUNC F64 bitsToDouble(U64 a)
Definition: Math.hpp:64
String & set(char chr)
Definition: String.cpp:38
void readFully(void *ptr, int size)
Definition: Stream.cpp:36
void seek(int ofs)
Definition: Stream.hpp:153
Array< U8 > & getData(void)
Definition: Stream.hpp:181
BufferedInputStream(InputStream &stream, int bufferSize=64<< 10)
Definition: Stream.cpp:49
virtual void flush(void)=0
#define FW_ASSERT(X)
Definition: Defs.hpp:67
signed int S32
Definition: Defs.hpp:88
virtual void readFromStream(InputStream &s)=0
int getLength(void) const
Definition: String.hpp:49
void consumeBuffer(int num)
Definition: Stream.cpp:180
virtual ~InputStream(void)
Definition: Stream.hpp:44
CUdevice int ordinal char int len
Definition: DLLImports.inl:48
void setCapacity(S numElements)
Definition: Array.hpp:326
void reset(const void *ptr, int size)
Definition: Stream.hpp:156
FW_CUDA_FUNC U64 doubleToBits(F64 a)
Definition: Math.hpp:63
signed __int64 S64
Definition: Defs.hpp:98
unsigned int U32
Definition: Defs.hpp:85
U32 readU32LE(void)
Definition: Stream.hpp:53
FW_CUDA_FUNC S operator>>(const T &a, const VectorBase< T, L, S > &b)
Definition: Math.hpp:475
F32 bitsToFloat(U32 a)
Definition: Math.hpp:96
U64 readU64LE(void)
Definition: Stream.hpp:55
virtual ~BufferedInputStream(void)
Definition: Stream.cpp:60
virtual ~MemoryOutputStream(void)
Definition: Stream.cpp:375
FW_CUDA_FUNC S operator<<(const T &a, const VectorBase< T, L, S > &b)
Definition: Math.hpp:474
void writeU64LE(U64 v)
Definition: Stream.hpp:75
int getOffset(void) const
Definition: Stream.hpp:152
int getBufferSize(void)
Definition: Stream.hpp:90
U64 readU64BE(void)
Definition: Stream.hpp:54
void writeU32BE(U32 v)
Definition: Stream.hpp:72
unsigned char U8
Definition: Defs.hpp:83
unsigned short U16
Definition: Defs.hpp:84
U16 readU16BE(void)
Definition: Stream.hpp:50
MemoryOutputStream(int capacity=0)
Definition: Stream.hpp:174
virtual void write(const void *ptr, int size)
Definition: Stream.cpp:381
virtual ~BufferedOutputStream(void)
Definition: Stream.cpp:211
void writeU32LE(U32 v)
Definition: Stream.hpp:73
void writefv(const char *fmt, va_list args)
Definition: Stream.cpp:249
void writef(const char *fmt,...)
Definition: Stream.cpp:239
const T * getPtr(S idx=0) const
Definition: Array.hpp:202
U32 readU32BE(void)
Definition: Stream.hpp:52
U16 readU16LE(void)
Definition: Stream.hpp:51
bool fillBuffer(int size)
Definition: Stream.cpp:149
virtual ~MemoryInputStream(void)
Definition: Stream.cpp:359
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value CUfunction int CUtexref hTexRef CUfunction int int grid_height CUevent unsigned int Flags CUevent hEvent CUevent hEvent CUstream unsigned int Flags CUstream hStream GLuint bufferobj unsigned int CUdevice dev CUdeviceptr unsigned int CUmodule const char name CUdeviceptr unsigned int bytesize CUdeviceptr dptr void unsigned int bytesize void CUdeviceptr unsigned int ByteCount CUarray unsigned int CUdeviceptr unsigned int ByteCount CUarray unsigned int const void unsigned int ByteCount CUarray unsigned int CUarray unsigned int unsigned int ByteCount void CUarray unsigned int unsigned int CUstream hStream const CUDA_MEMCPY2D pCopy CUdeviceptr const void unsigned int CUstream hStream const CUDA_MEMCPY2D CUstream hStream CUdeviceptr unsigned char unsigned int N CUdeviceptr unsigned int unsigned int N CUdeviceptr unsigned int unsigned short unsigned int unsigned int Height CUarray const CUDA_ARRAY_DESCRIPTOR pAllocateArray CUarray const CUDA_ARRAY3D_DESCRIPTOR pAllocateArray unsigned int CUtexref CUdeviceptr unsigned int bytes CUcontext unsigned int CUdevice device GLenum texture GLenum GLuint buffer GLenum GLuint renderbuffer GLenum GLsizeiptr size
Definition: DLLImports.inl:319
const Array< U8 > & getData(void) const
Definition: Stream.hpp:182
virtual int read(void *ptr, int size)
Definition: Stream.cpp:66
virtual int read(void *ptr, int size)=0