35 #define FW_IO_BUFFER_SIZE 65536
44 m_cpuPtr = (
U8*)cpuPtr;
64 m_glBuffer = glBuffer;
82 if ((m_exists & module) == 0 || m_exists == (
U32)module || m_original == module)
87 if (m_owner == module)
89 if (module != i && (m_exists & i) != 0 && (m_dirty & i) == 0)
95 if (m_owner == module)
97 if (module != i && (m_exists & i) != 0)
105 case CPU: cpuFree(m_cpuPtr, m_cpuBase, m_hints);
break;
106 case GL: glFree(m_glBuffer, m_cudaGLReg);
break;
107 case Cuda: cudaFree(m_cudaPtr, m_cudaBase, m_glBuffer, m_hints);
break;
117 FW_ASSERT(srcOfs >= 0 && srcOfs <= m_size - size);
141 if ((m_exists &
CPU) != 0)
142 memcpy(dst, m_cpuPtr + srcOfs, (
size_t)size);
151 FW_ASSERT(dstOfs >= 0 && dstOfs <= m_size - size);
186 FW_ASSERT(dstOfs >= 0 && dstOfs <= m_size - size);
187 FW_ASSERT(srcOfs >= 0 && srcOfs <= src.m_size - size);
194 else if ((src.m_exists &
CPU) != 0 && (src.m_dirty &
CPU) == 0)
205 FW_ASSERT(dstOfs >= 0 && dstOfs <= m_size - size);
233 if ((module != Cuda && modify) ||
234 (module ==
GL && (m_dirty &
GL) != 0))
236 cudaFree(m_cudaPtr, m_cudaBase, m_glBuffer, m_hints);
244 if (m_owner == module)
260 if ((m_exists &
CPU) == 0)
262 cpuAlloc(m_cpuPtr, m_cpuBase, m_size, m_hints, m_align);
266 validateCPU(async, cudaStream, validSize);
271 bool needGL = (module ==
GL);
272 if (module == Cuda && (m_hints & Hint_CudaGL) != 0)
275 if (needGL && (m_exists &
GL) == 0)
277 validateCPU(
false,
NULL, validSize);
278 glAlloc(m_glBuffer, m_size, m_cpuPtr);
282 else if (module == GL && (m_dirty & GL) != 0)
284 validateCPU(
false,
NULL, validSize);
304 if ((m_exists & Cuda) == 0)
306 cudaAlloc(m_cudaPtr, m_cudaBase, m_cudaGLReg, m_size, m_glBuffer, m_hints, m_align);
309 if ((m_hints & Hint_CudaGL) != 0 && (m_dirty & GL) == 0)
313 if ((m_dirty & Cuda) != 0)
315 validateCPU(
false,
NULL, validSize);
316 if ((m_exists &
CPU) != 0 && validSize)
317 memcpyHtoD(m_cudaPtr, m_cpuPtr, (
U32)validSize, async, cudaStream);
367 void Buffer::init(
S64 size,
U32 hints,
int align)
371 m_hints = validateHints(hints, align,
Module_None);
389 U32 Buffer::validateHints(
U32 hints,
int align, Module original)
397 if ((hints &
Hint_CudaGL) != 0 && original !=
Cuda && align == 1 && isAvailable_cuGLRegisterBufferObject())
404 void Buffer::deinit(
void)
413 if (m_original !=
Cuda)
414 cudaFree(m_cudaPtr, m_cudaBase, m_glBuffer, m_hints);
416 if (m_original !=
GL)
417 glFree(m_glBuffer, m_cudaGLReg);
418 else if (m_cudaGLReg)
421 if (m_original !=
CPU)
422 cpuFree(m_cpuPtr, m_cpuBase, m_hints);
432 m_hints = validateHints(m_hints, m_align, module);
441 void Buffer::realloc(
S64 size,
U32 hints,
int align)
448 if (m_size == size && m_hints == hints && m_align == align)
481 if (m_owner ==
Cuda && (hints & Hint_CudaGL) == 0)
484 CUdeviceptr cudaBase;
485 bool cudaGLReg =
false;
486 cudaAlloc(cudaPtr, cudaBase, cudaGLReg, size, 0, hints, align);
492 m_cudaBase = cudaBase;
500 cpuAlloc(cpuPtr, cpuBase, size, hints, align);
501 memcpy(cpuPtr,
getPtr(), (
size_t)
min(size, m_size));
511 void Buffer::validateCPU(
bool async, CUstream cudaStream,
S64 validSize)
517 if ((m_exists &
CPU) != 0 && (m_dirty & CPU) == 0)
526 if (i != CPU && (m_exists & i) != 0 && (m_dirty & i) == 0)
540 if ((m_exists & CPU) == 0)
542 cpuAlloc(m_cpuPtr, m_cpuBase, m_size, m_hints, m_align);
567 memcpyDtoH(m_cpuPtr, m_cudaPtr, (
U32)validSize, async, cudaStream);
573 void Buffer::cpuAlloc(
U8*& cpuPtr,
U8*& cpuBase,
S64 size,
U32 hints,
int align)
576 if ((hints & Hint_PageLock) != 0)
578 checkSize(size, 32,
"cuMemAllocHost");
580 max(1U, (
U32)(size + align - 1))));
584 checkSize(size,
sizeof(
U8*) * 8 - 1,
"malloc");
585 cpuBase =
new U8[(size_t)(size + align - 1)];
588 cpuPtr = cpuBase + align - 1;
589 cpuPtr -= (
UPTR)cpuPtr % (
UPTR)align;
594 void Buffer::cpuFree(
U8*& cpuPtr,
U8*& cpuBase,
U32 hints)
599 if ((hints & Hint_PageLock) != 0)
610 void Buffer::glAlloc(GLuint& glBuffer,
S64 size,
const void*
data)
617 glGenBuffers(1, &glBuffer);
619 checkSize(size,
sizeof(
GLsizeiptr) * 8 - 1,
"glBufferData");
627 void Buffer::glFree(GLuint& glBuffer,
bool& cudaGLReg)
636 glDeleteBuffers(1, &glBuffer);
644 void Buffer::cudaAlloc(CUdeviceptr& cudaPtr, CUdeviceptr& cudaBase,
bool& cudaGLReg,
S64 size, GLuint glBuffer,
U32 hints,
int align)
647 if ((hints & Hint_CudaGL) == 0)
650 checkSize(size, 32,
"cuMemAlloc");
652 max(1U, (
U32)(size + align - 1))));
653 cudaPtr = cudaBase + align - 1;
654 cudaPtr -= (
U32)cudaPtr % (
U32)align;
672 void Buffer::cudaFree(CUdeviceptr& cudaPtr, CUdeviceptr& cudaBase, GLuint glBuffer,
U32 hints)
677 if ((hints & Hint_CudaGL) == 0)
688 void Buffer::checkSize(
S64 size,
int bits,
const String& funcName)
691 if ((
U64)size > (((
U64)1 << bits) - 1))
692 fail(
"Buffer too large for %s()!", funcName.
getPtr());
705 if (dstHost && srcHost)
707 memcpy(dstHost, srcHost, (
size_t)size);
713 if (async && isAvailable_cuMemcpyHtoDAsync())
716 res = cuMemcpyHtoD(dstDevice, srcHost, (
U32)size);
722 if (async && isAvailable_cuMemcpyDtoHAsync())
723 res = cuMemcpyDtoHAsync(dstHost, srcDevice, (
U32)size, cudaStream);
731 #if (CUDA_VERSION >= 3000)
732 if (async && isAvailable_cuMemcpyDtoDAsync())
733 res = cuMemcpyDtoDAsync(dstDevice, srcDevice, (
U32)size, cudaStream);
736 res = cuMemcpyDtoD(dstDevice, srcDevice, (
U32)size);
742 if (res == CUDA_SUCCESS)
754 memcpyXtoX(dstHost, dstDevice, srcHost, srcDevice, mid, async, cudaStream);
757 (dstHost) ? (
U8*)dstHost + mid :
NULL,
758 (dstHost) ? NULL : (CUdeviceptr)(dstDevice + mid),
759 (srcHost) ? (
const U8*)srcHost + mid : NULL,
760 (srcHost) ? NULL : (CUdeviceptr)(srcDevice + mid),
761 size - mid, async, cudaStream);
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 * srcHost
void setRange(S64 dstOfs, const void *src, S64 size, bool async=false, CUstream cudaStream=NULL)
const char * getPtr(void) const
GLuint getMutableGLBuffer(void)
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 glBindBuffer
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 cuGLUnmapBufferObject
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 cuMemAlloc
virtual void writeToStream(OutputStream &s) const
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 dstDevice
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule * module
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 cuMemcpyDtoH
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 * dstHost
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
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 cuMemFree
void wrapCuda(CUdeviceptr cudaPtr, S64 size)
virtual void readFromStream(InputStream &s)
CUdeviceptr getCudaPtr(S64 ofs=0)
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 cuMemFreeHost
static void checkErrors(void)
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 glBufferData
virtual void write(const void *ptr, int size)=0
const U8 * getPtr(S64 ofs=0)
void setOwner(Module module, bool modify, bool async=false, CUstream cudaStream=NULL, S64 validSize=-1)
void wrapCPU(void *cpuPtr, S64 size)
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 GLuint v GLenum GLenum GLenum GLuint GLint level GLsizei GLuint framebuffers GLuint const GLchar name glGetBufferSubData
static void checkError(const char *funcName, CUresult res)
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 cuMemAllocHost
static void memcpyHtoD(CUdeviceptr dst, const void *src, S64 size, bool async=false, CUstream cudaStream=NULL)
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 cuMemcpyHtoDAsync
CUdeviceptr getMutableCudaPtr(S64 ofs=0)
U8 * getMutablePtr(S64 ofs=0)
FW_CUDA_FUNC T min(const VectorBase< T, L, S > &v)
FW_CUDA_FUNC T max(const VectorBase< T, L, S > &v)
#define GL_ARRAY_BUFFER_BINDING
#define FW_IO_BUFFER_SIZE
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 cuMemsetD8
void getRange(void *dst, S64 srcOfs, S64 size, bool async=false, CUstream cudaStream=NULL) const
void wrapGL(GLuint glBuffer)
static void memcpyDtoD(CUdeviceptr dst, CUdeviceptr src, S64 size, bool async=false, CUstream cudaStream=NULL)
void clearRange(S64 dstOfs, int value, S64 size, bool async=false, CUstream cudaStream=NULL)
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
static void memcpyDtoH(void *dst, CUdeviceptr src, S64 size, bool async=false, CUstream cudaStream=NULL)
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 srcDevice
static void staticInit(void)
const T * getPtr(S idx=0) const
void fail(const char *fmt,...)
void resizeDiscard(S64 size)
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
static void staticInit(void)
void profilePush(const char *id)